Listing, creating, copying, and moving files and directories, links, and hard links
It is important to know how to manage files and directories (also known as folders) in a system from the command line. It will serve as a 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@rhel8 ~]$ mkdir mydir [user@rhel8 ~]$ ls -l total 0 drwxrwxr-x. 2 user user 6 Dec 23 19:53 mydir
Folders can be deleted with the rmdir
command, short for remove directory:
[user@rhel8 ~]$ ls -l total 0 drwxrwxr-x. 2 user user 6 Dec 23 19:53 mydir [user@rhel8 ~]$ mkdir deleteme [user@rhel8 ~]$ ls -l total 0 drwxrwxr-x. 2 user user 6 Dec 23 20:15 deleteme drwxrwxr-x. 2 user user 6 Dec 23 19:53 mydir [user@rhel8 ~]$ rmdir deleteme [user@rhel8 ~]$ ls -l total 0 drwxrwxr-x. 2 user user 6 Dec 23 19:53 mydir
However, rmdir...