Chapter 4. Manipulating Files and Directories

At this point, we are ready for some real work! This chapter will introduce the following commands:

  • cp—Copy files and directories.

  • mv—Move/rename files and directories.

  • mkdir—Create directories.

  • rm—Remove files and directories.

  • ln—Create hard and symbolic links.

These five commands are among the most frequently used Linux commands. They are used for manipulating both files and directories.

Now, to be frank, some of the tasks performed by these commands are more easily done with a graphical file manager. With a file manager, we can drag and drop a file from one directory to another, cut and paste files, delete files, and so on. So why use these old command-line programs?

The answer is power and flexibility. ...

Get The Linux Command Line now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.