[[Email protected]~]#
Command prompt:
Where Root: Current login user
localhost: Host name
~: Current directory (~ indicates home directory)
# Super User prompt
$ normal User prompt
File processing commands: LS, mkdir, RM, CP, MV, LN
ls [options] [file or directory]
Listing Directory Contents
-A: Show all files, including hidden files
-L: Show detailed information
-D: View Directory properties
-H: humanized Display file information
-I: Display inode
Ls-l View Details (Linux does not differentiate files by extension, but relies on permissions):
mkdir-p [directory Name]
Create a Directory
-P: Recursively create a directory
RM-RF [file or directory]
Delete a file or directory
-R: Delete Directory
-F: Force delete
CP [Options] [source] [Target]
Copy
-r: Copy directory
-P: File attribute copying
-D: If the source file is a linked file, copy the link property
-A: equivalent to-PDR
MV [source] [Target]
Cut or rename a file or directory
ln-s [source] [Target]
Generate a linked file
-S: Create soft links (similar to Windows shortcuts)
File Search command: Locate, find, grep
Locate file name
Search by file name in the background database, search faster.
/etc/updatedb.conf: Search configuration file
Background database for/var/lib/mlocate:locate command search
UpdateDB: Updating the database
Find [Search scope] [search criteria]
Search for eligible filenames in the system
-mtime: Search by modified time
-name: Search by file name
-size: Search by File size
grep [option] string file name
Match a qualifying string in a file
-I: Ignore case
-V: excludes the specified string
Compression commands (common compression format:. tar.gz,. tar.bz2): Tar
TAR-CVF package file name source file
-C: Packaging
-V: Display procedure
-F: Specifies the file name after packaging
EG:TAR-CVF File.tar File
TAR-XVF Package file name
-X: Unpacking
TAR-ZCVF compressed package name. tar.gz Source File
-Z: Compressed to. tar.gz format
TAR-ZXVF compressed package name. tar.gz
-Z: Unzip. tar.gz format
TAR-JCVF compressed package name. tar.bz2 Source File
-J: Compressed to. tar.gz format
Tar JXVF compressed package name. tar.bz2
-j: Unzip. tar.gz format
Shutdown and restart command: shutdown
shutdown [option] Time
-C: Cancel the previous shutdown command
-H: Shutdown
-R: Restart
Linux common commands are recorded