rmdir directoryname // This is will delete an empty directory.
rmdir -r directoryname // This is will delete everything in the directory
// including all files and subdirectories.
# 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'
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
To remove an empty directory, use either rmdir or rm -d followed by the directory name:
rm -d dirname rmdir dirname.
To remove non-empty directories and all the files within them, use the rm command with the -r (recursive) option:
rm -r dirname.
# plz suscribe to my youtube channel -->
# https://www.youtube.com/channel/UC-sfqidn2fKZslHWnm5qe-A
#remove a dir in linux command
rm
#after rm type the file or dir name it will remove it
# REMOVE ALL FILES IN LINUX ON CURRENT PATH
find . -type f -delete
# REMOVE DIRECTORY IN LINUX ON CURRENT PATH
find . -type d -delete
# REMOVE EVERTHING IN EXISTING PATH
find . -delete