Linux delete folder command. Linux delete directory is very simple, many people still used to use rmdir, but once the directory is not empty, it is deeply troubled, now use the rm-rf command.
Direct rm is fine, but add two parameters -rf ie: rm -rf directory name
delete directory, file rm(remove)
Description: Delete files or directories.
Syntax: rm [-dfirv][--help][--version][file or directory...]
Supplement: Execute the rm command to delete files or directories, such as To delete a directory, you must add the parameter ”-r”, otherwise the default will only delete the file.
Parameters:
-d or –directory Delete the hard-wired data of the directory to be deleted directly into 0 and delete the directory.
-f or –force Forces the deletion of files or directories.
-i or –interactive Ask the user before deleting the existing file or directory.
-r or -R or –recursive Recursive processing, all files and subdirectories under the specified directory are processed together.
-v or –verbose Shows the execution of the instruction.
1 Delete folder
de>rm -rf fileNamede>
-Delete folder instance:
rm -rf /var/log/httpd /access
will delete the /var/log/httpd/access directory and all files and folders under it
Need to be reminded: be careful when using this rm -rf , linux does not have a recycle bin
2 delete files
de> rm -f fileNamede>
When using rm -rf, be careful, linux does not have a recycle bin
Linux Add File Command
Create Directory: mkdir(make directories)
Function Description: Create Directory
Syntax: mkdir [-p][- -help][--version][-m <Directory Attributes>][Directory Name]
Note: mkdir can create directories and set permissions for directories at the same time.
Parameters:
-m<directory attribute> or –mode<directory attribute> Set the directory permissions at the same time when creating a directory.
-p or –parents If the upper directory of the directory to be created is not yet established, the upper directory will be created together.
Example: mkdir test
Creating a file touch
Description: Change the file or directory time.
Syntax: touch [-acfm][-d <datetime>][-r <reference file or directory>][-t <datetime>] [--help] [--version][file or directory...] or touch [-acfm][--help][--version][datetime][file or directory...]
Additional information: Use the touch command to change the date and time of a file or directory, including access time and change time.
Parameters:
-a or –time=atime or –time=access or –time=use Only change the access time.
-c or –no-create does not create any files.
-d<time date> Use the specified date and time instead of the current time.
-f This parameter will be ignored and will only be used to resolve compatibility issues with the BSD version of the touch directive.
-m or –time=mtime or –time=modify only changes the change time.
-r<reference file or directory> Set the date and time of the specified file or directory to the same date and time as the reference file or directory.
-t<datetime> Use the specified date and time instead of the current time.
Example: touch test.txt (Note: There is no file suffix under Linux to distinguish between file types, system file types are only executable and non-executable files)
What should I do if the Ubuntu system Grub fails? Many computer users think of reloading: Grub, howe
Install JDK in fact only need to get two problems, the installation directory and configuration file
First, thread creation header file #include <pthread.h> function declaration int pth
Understand the process: ? PID, PPID? Current process status? Memory allocation? CPU and actu
Ubuntu configuration SSH password-free login
Linuxbond configuration steps, seven bond mode descriptions
Linux solves file deletion but disk availability has not changed
RSA authentication in Linux login SSH
Linux installation php and memcache process record
Linux tutorial - view the process ps, top
Linux learning: find command problem
Linux view directory size and hard disk size
Three main package installation methods under redhat system
What should I do if the icon file in the win7 computer does not display the preview?
Where does windows add right-click admin rights? How to add?
Router defense attack technology analysis
Just one step to cancel the QQ mailbox multi-select status
Windows8 has no reason to sleep problem endings according to the scheme
How to clear the software residual service item in Win7 system?
Optimize BIOS to increase the speed of Windows 7
The file under win7 system is isolated by 360 antivirus security guards. How to recover
Wps table 2016 cells have spaces how to calculate the average?