Categories
Linux Tutorial Series

Linux Tutorial Series – 65 – Executing multiple commands on the same line

Here is the video version, if you prefer it:

You can execute multiple commands on the same line. To do that, you need to add a semicolon, like so: (Shotts, 2019)⁠

command1; command2; command3

An example:

cd /; ls; cd

This lists the contents of the root directory and then switches your working directory back to your home directory.

Hope you learned something new!

References

Shotts, W. (2019). The Linux Command Line, Fifth Internet Edition. Retrieved from http://linuxcommand.org/tlcl.php. Page 74