Home > Article > Operation and Maintenance > Introducing centos complete deletion of folders and files commands
The following column centos introductory tutorial will introduce to you the centos complete deletion of folders and files. I hope it will be helpful to friends in need!
1. Create a new folder mkdir file nameCreate a new folder named test in Under homeview source1 mkdir /home/test2. Create a new text Create a new test.sh script under home vi /home/test.sh3. Delete files or folders 1. Delete the test directory under the home directory rm /home/test2. This deletion method without parameters often prompts that it cannot be deleted because the permissions are not enough. rm -r /home/test3 , -r recursively deletes the directory and its subdirectories in the parameter table. The directory will be emptied and deleted. The user is usually prompted when deleting write-protected files contained in the directory. rm - rf /home/test-4. f does not prompt the user and deletes all files in the directory. Please check the path. It will be a tragedy if you enter it in another directory. rm -ir /home/test5. -i is interactive mode. Using this option, the rm command prompts the user for confirmation before deleting any files.4. Move files or folders mv [options] Source file or directory Target file or directory Example:1. Move all files in the hscripts folder/directory, Directories and subdirectories to the tmp directory mv hscripts tmp Analysis: In the above command, if the tmp directory already exists, the mv command will move all files, directories and subdirectories under the hscripts folder/directory to the tmp directory. If There is no tmp directory, it will rename the hscripts directory to the tmp directory. Move multiple files/more questions to another directorymv file1.txt tmp/file2.txt newdir 5. Copy files or folders cp [options] Source file (source) Destination file (destination)Parameters: -a: Equivalent to -pdr;
2. Back up the copied file : 6. Create directorymkdir file name |
The above is the detailed content of Introducing centos complete deletion of folders and files commands. For more information, please follow other related articles on the PHP Chinese website!