Copying, Moving, and Deleting Files

If you have ever owned a computer before, then you know how important it is to be able to copy and move files around. That's why I dedicated an entire chapter to talk just about that: copying, moving, and deleting files.

Copying one file

Sometimes you need to copy a single file. Luckily this is a simple operation on the command line. I have a file named cats.txt in my home directory:

elliot@ubuntu-linux:~$ cat cats.txt I love cars!I love cats!I love penguins!elliot@ubuntu-linux:~$

I can use the cp command to make a copy of cats.txt named copycats.txt as follows:

elliot@ubuntu-linux:~$ cp cats.txt copycats.txt elliot@ubuntu-linux:~$ cat copycats.txtI love cars!I love cats!I love penguins!elliot@ubuntu-linux:~$ ...

Get Learn Linux Quickly now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.