Linux command a daily 5 - rm

rm command. rm is commonly used commands, functions of the command to delete a directory one or more files or directories, it can also be a directory and all its files and subdirectories are deleted. For the linked file, just delete the link, the original files remain unchanged.

rm is a dangerous command, when used with special care, especially for the novice, otherwise the whole system will be destroyed in this command (such as in the implementation of rm * -rf / (root directory)). So, we'd better look for confirmation before executing rm in which directory, in the end you want to delete something, to keep a cool head during the height of the operation.

 

rm file name

rm readme.txt

Delete the file will be asked whether to delete

 

rm -f readme.txt

Forced to delete the file system will not prompt

 

rm -i *.log

Before you delete any .log files, one by one asked to confirm

 

rm s test1

The test1 subdirectory delete all files and subdirectories

 

rm -rf test2

The test2 subdirectory and all subdirectories deleted files, and do not - Confirmation

 

rm - -f

Delete files to the beginning of the -f

 

Guess you like

Origin www.cnblogs.com/laphome/p/11272813.html