Raspberry Pi Computer Architecture Essentials
上QQ阅读APP看书,第一时间看更新

Some handy Linux commands

The following Linux commands are very useful and you will find yourself using them often. Remember you can type man command where command is the command you are interested in at any time to learn more about it and the parameters it accepts.

Tip

Most commands also contain a more concise set of documentation under help as well.

The cd command allows you to change directories:

cd /home/pi

The touch command creates an empty file:

touch test.txt

The cp command can be used to copy files:

cp /home/pi/test.txt /home/newuser/test.txt

The mv command can be used to move a file or rename a file:

mv /home/pi/test.txt /home/pi/test2.txt

The rm command will remove a file or directory depending on the flag used:

rm text.txt

To find out which directory you are in you can use the pwd (present working directory) command:

pwd

If you wish to list the contents of a directory you can use the ls command:

ls

To learn more about basic Linux commands, the Debian operating system website provides a in-depth guide at https://www.debian.org/doc/manuals/user/ch6.html.