A final handy tip: The tilde ~ is equivalent to your home directory. So typing cd ~ is the same as typing cd with no arguments. Also, you can type things like cd ~/practice/mysubdirectory to change to the directory /home/yourname/practice/mysubdirectory. In a similar way, ~myuser is equivalent to the home directory of the user “myuser,” which is probably something like /home/myuser; so ~myuser/docs/debian.ps is equivalent to /home/myuser/doc/debian.ps. / / / Here are some more file commands to try out, now that you know about relative filenames. cd to your home directory before you begin.

In your home directory, make a directory called practice. You’ll use this directory to try out some other commands. You might type ls to verify that your new directory exists.

Debian GNU/Linux : Guide to Installation and Usage — Part 44

cp is short for “copy.” /etc/profile is just a random file on your system, don’t worry about what it is for now. We’ve copied it to . (recall that . just means “the directory I’m in now,” or the current working directory). So this creates a copy of /etc/profile and puts it in your practice directory. Try typing ls to verify that there’s indeed a file called profile in your working directory, alongside the new mysubdirectory.

Debian GNU/Linux : Guide to Installation and Usage — Part 44

This lets you view the contents of the file profile. more is used to view the contents of text files. It’s called more because it shows one screenful of the file at a time, and you press the space bar to see more. more will exit when you get to the end of the file, or when you press q (quit).

Debian GNU/Linux : Guide to Installation and Usage — Part 44

Verifies that the original looks just like the copy you made.

mv stands for “move.” You’ve moved the file profile from the current directory into the subdirectory you created earlier.

Verifies that profile is no longer in the current directory.

Verifies that profile has moved to mysubdirectory.

Note that unlike some operating systems, there is no difference between moving a file and renaming it. Thus there’s no separate rename command. Note that the second argument to mv can be a directory to move the file or directory into, or it can be a new filename. cp works the same way.

As usual, you can type ls to see the result of mv.

Just as . means “the directory I’m in now,” .. means “parent of the current directory,” in this case the practice directory you created earlier. Use ls to verify that that’s where myprofile is now.