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 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. . . ]
Additional note: Execute the rm command to delete files or directories. If you want to delete the 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 Deleting a folder
de "rm -rf fileNamede"
- Deleting a 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 must be very 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 Properties" or –mode "Directory Properties" The permissions for setting the directory 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][ ,null,null,3],File or directory. . . ] or touch [-acfm][--help][--version][date time][file or directory. . . ]
Note: 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 and 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 "Date Time" 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 files and non-executable files)
The above is deleted under Linux. And the command to create a folder is introduced. It can be seen that the effect of using the command plus some parameters is different, so use it carefully.
The grep command is called global search regular expression (RE) and print out the line, which is a
using direct-lvm storage method Recently played docker on Bluemix virtual machine, but found that t
Liunx shared file server uses samba, so the linux shared server is to set up the samba server; 1, n
vi editor is the most commonly used text editor in Linux system, vi has the reputation of the editor
Linux scripts automatically enter passwords
Vsftpd 530 in linux owing to the underlying solution
Get CPU information under Linux
Network configuration commands under Linux
Ubuntu does not connect to the Internet how to do
Linux installer and common methods of relying on the installation package
Character encoding and conversion tool for files under GnuLinux
Linux tutorial - view the process ps, top
View cpu physics number, core number, logical cpu number under linux
Traditional art word making skills teach you to easily implement in Office
Watch the computer beauty live.
Windows 7 system changes the time zone method graphic tutorial
Win8 system component repair function
How to thoroughly optimize the computer's full Raiders skills
WinXP's skill of encrypting and decrypting files through the command line
How to identify the authenticity of Win7 system
Microsoft announced that it will sell Windows 10 Home and Professional Editions as 32-bit and 64-bit