Linux System RM Delete command (dangerous)
Brief Description: in the Linux system operation and Operation of the rm Delete command, very dangerous, because the permissions are too large, a careless will be the entire server of the data instantly deleted, so how to skillfully use the RM command to delete files, and eliminate the accidental deletion of the situation happened?
Method One:
Description: We can find a command through find, will need to delete the file found after the correct deletion.
Command-Line Operations:
[[email protected] oldboy]# Find/-type f-name "Oldboy"-execrm-f {} \;
#find-type F Find file type,-name "Oldboy" Find file name-exec rm-f {} \; Delete changed file {} represents what has been found \; Escape
[[email protected] oldboy]# Find/-type f-name "Oldboy" |xargsrm-f
#find –type F find the file type, pipe |xargs means you can use the command to find the content on the line operation, rm-f delete the found content
Tips:
The above instructions, you need to ensure that the found content is what you want to delete and then delete.
Method Two:
Note: We can also move files that need to be deleted to other directories and then delete them by using the MV Move command, which is similar to how Windows moves deleted files to the Recycle Bin.
Command-Line Operations:
[email protected] oldboy]# mv oldboy/tmp/ # MV Mobile Oldboy to/tmp
[email protected] oldboy]# rm-f/tmp/oldboy # RM Delete-F Force Oldboy file
This article is from the "Breeze Cool" blog, please be sure to keep this source http://jiay1.blog.51cto.com/9144615/1708381
Linux system RM Delete command "dangerous"!!!