Common Linux File Processing commands and linux File Processing
I am a beginner in Linux. Take a note. Below are some common file processing commands in Linux:
Command Prompt
[Root @ localhost ~] #
Where:
Root indicates the current Login User
Localhost indicates the Host Name
~ Indicates the current directory (Home Directory)
# Prompt indicating Super User Name
The normal user's prompt is $
- Query pipeline content: ls
Ls [Option] [file or directory]
Options:
-A: displays all files, including hidden files.
-L display details
-D. view directory properties.
-H humanized display file size
-I display incode
Mkdir-p [directory name]
-P recursive Creation
Make directories
Cd [Directory]
Command: change directory
Simplified operations
Cd ~ (Or enter only cd) to enter the home directory of the current directory.
Cd-go to the last directory
Cd .. go to the upper-level directory
Cd. Enter the current directory
- Query Directory location: pwd
Pwd
Print working directory
- Delete an empty directory: rmdir
Rmdir [directory name]
Command: remove empty directory
- Delete a file or directory: rm
Rm-rf [file or directory]
Command: remove
Option:
-R: delete a directory.
-F force Delete
Cp [Option] [original file or directory] [target directory]
Option:
-R copy directory
-P joint file property Replication
-D if the source file is a linked file, copy the link property.
-A is equivalent to-pdr.
Mv [source file or directory] [target directory]
If the target directory is the current directory, rename it; otherwise, cut