mkdir
mkdir #make directory EG: mkdir books paintings
You can also create subdirectories at the same time with the -p (parent flag).
mkdir -p enum/{recon,exploit,report}
rmdir #remove directory (doesnt work like rm for simple files)
rm #remove (to remove files)
rm -f #remove all files
rm -i #will prompt for each file to remove
rm -r #directory (to remove directory) also done with rmdir
Windows
del (file to delete)
del powercat.ps1
Syntax is:
rm -rf dirName
Say you have a directory named /tmp/data/ that contains two files and one directory as follows:
ls -l /tmp/data/
If you run rmdir, you will get an error as follows:
rmdir /tmp/data/
As explained earlier rmdir only delete the DIRECTORIES, if they are empty.
Therefore you must use the rm command to remove a full directory in Linux:
rm -rf /tmp/data/ #-rf flag to recursively delete all files
Last updated