Listing, creating, copying, and moving files, directories, links, and hard links
It is important to know how to manage files and directories in a system from the command line. It will serve as the basis for managing and copying important data, such as configuration files or data files.
Directories
Let’s start by creating a directory to keep some working files. We can do so by running mkdir
, short for “make directory”:
[user@rhel-instance ~]$ mkdir mydir [user@rhel-instance ~]$ ls -l total 0 drwxrwxr-x. 2 user user 6 Feb 13 19:53 mydir
Folders can be deleted with the rmdir
command, short for “remove directory”:
[user@rhel-instance ~]$ ls -l total 0 drwxrwxr-x. 2 user user 6 Feb 13 19:53 mydir [user@rhel-instance ~]$ mkdir deleteme [user@rhel-instance ~]$ ls -l total 0 drwxrwxr-x. 2 user user 6 Feb 13 20:15 deleteme drwxrwxr-x. 2 user user 6 Feb 13 19:53 mydir [user@rhel-instance ~]$ rmdir deleteme [user@rhel-instance ~]$ ls -l total...