xxxxxxxxxx
# Remove Single File Using rm:
rm file1.txt
# Remove Directory and it's contents:
rm -r dir1 # '-r' is short for '-recursive'
# Remove empty Directory:
rm -d dir1 # '-d' is short for '-dir'
xxxxxxxxxx
To remove an empty directory, use the rmdir command as follows:
$ rmdir foldername
If the directory still contains files or subdirectories, the rmdir command does not remove the directory.
To remove a directory and all its contents, including any subdirectories and files, use the rm command with the recursive option, -r.
$ rm -r foldername
xxxxxxxxxx
rm -r filename
rm -rf filename
this command remove the directory and subdirectory forecefully
xxxxxxxxxx
#In linux Terminal:
#To make a directory:
mkdir directory_name
#To delete a directory:
rmdir directory_name