This article is a mirror article of machine translation, please click here to jump to the original article.

View: 12912|Reply: 0

[linux] Linux command to delete folders and files

[Copy link]
Posted on 10/19/2014 10:52:10 PM | | |
Linux deleting directories is very simple, many people are still used to using rmdir, but once the directory is not empty, they fall into deep distress, and now use the rm -rf command.
Just rm is fine, but you need to add two parameters -rf, namely: rm -rf directory name
-r is a downward recursion, no matter how many levels of directories there are, they are deleted
-f means to forcibly delete it directly without any prompting

Delete a folder instance:
rm -rf /var/log/httpd/access
The /var/log/httpd/access directory and all files and folders under it will be deleted



Delete a file usage example:
rm -f /var/log/httpd/access.log
The /var/log/httpd/access.log file will be forcibly deleted


You must be extra careful when using this rm -rf, linux does not have a recycle bin

Many friends do not see this important reminder information before using it, so it is difficult to get it back after deletion









Previous:The seaside is nice
Next:CSS styles are used in a total of 3 Introductions
Disclaimer:
All software, programming materials or articles published by Code Farmer Network are only for learning and research purposes; The above content shall not be used for commercial or illegal purposes, otherwise, users shall bear all consequences. The information on this site comes from the Internet, and copyright disputes have nothing to do with this site. You must completely delete the above content from your computer within 24 hours of downloading. If you like the program, please support genuine software, purchase registration, and get better genuine services. If there is any infringement, please contact us by email.

Mail To:help@itsvse.com