In this section, we will show a few frequently used commands for file and directory manipulation. These commands are; “cp,” “mv,” “rm,” “touch,” and “file.”
Ex: (kali@kali:~/Downloads$ cp Text.txt1 Text.txt2)
You can likewise utilize “cp” to duplicate various records into a directory. For this situation, the last argument must be a directory.
Ex: (kali@kali:~/Downloads$ cp Text.txt1 InfoSec/Text.txt2)
To copy everything in the directory, use the “-r” operator. The “-r” option forces recursive duplicating of all records in all sub-directories.
Ex: (kali@kali:~/Downloads$ cp -r InfoSec/ Security)
Ex: (kali@kali:~/Downloads$ mv Text.txt1 HelloWorld)
Ex: (kali@kali:~/Downloads$ rm HelloWorld)
Before erasing a current document, you can use “-i” (for interactive) option to brief the user for affirmation. If, in any case, this option isn’t determined, the “rm” command will quietly erase records.
Ex: (kali@kali:~/Downloads$ rm -i Text.txt2)
If you want to delete everything in the directory, you need to specify the “-r” (for recursive) option.
Ex: (kali@kali:~/Downloads$ rm -r InfoSec/)
Ex: (kali@kali:~/Downloads$ file Security_Report)
Ex: (kali@kali:~/Downloads$ touch HelloWorld)