Ifconfig
Ping IP Address
Help: PING-T IP Address
PING-C Number of IP addresses
Size of the Ping-s package
Shutdown Restart:
Shutdown-h now
Reboot
Clear screen: Clear = = Ctrl + L
Delete line Ctrl + u before cursor
The history! Command number
Alias
Definition alias: alias COPY=CP xrm= "Rm-r"
Remove alias: unalias copy
To view (except for built-in commands) commands, configuration file Help: Man/info name (without path) Note: Help 9 kinds of 1: Command 5: Configuration file (Precedence command)
To view help for the shell's built-in commands:
Get command Brief usage information:: Whatis command name
Get profile Brief usage information: Apropos configuration file name equivalent to "man-k name"
Note: Establish the database used by the Whatis and Apropos command search: Makewhatis
View only help information: command name--help
Standard input: 0 standard output: 1 Error Output: 2
Output Redirect: overlay > Append >>
Input Redirect: <
Note: Cp-r/usr/backup/usr.bak 2>bak.error {Writes the backup failed information to the specified file}
Output from command 1 as input to command 2:
Pipe: Command 1 | Command 2
Command substitution: Command 2 ' command 1 '
Command connector:
Sequential execution:;
Logic and:&&
Logical OR: | |
Find command: Which/whereis command name
File search: Find path keywords
-name file name wildcard character: *?
-size File Size: +-in block
-user file Owner
-tyep-f binary file-L soft-connect file-D directory
-inum node Sequence number you can use "ls-i" to view the file's node number
Time:
Tian-ctime-atime-mtime
Sub-cmin-amin-mmin
-Within + over
Example: find/etc-mmin-120
Connector:-A with,-O or,-EXEC/-OK (with inquiry process)
Example: Find ...-exec follow-up instruction {} \;
Find/home-user samlee-exec rm-rf {} \; Delete a file with the owner as the specified user under a path
Find/home-inum 16-ok rm {} \; The delete file method of the Hundred Test Lark
Note: {}find query result \ escape character, Symbol command uses its own meaning
Linux-specific lookup instructions:
Locate file name mates: UpdateDB command
grep specifies the string source file
Add Users:
Useradd User Name
passwd Password
To switch users:
Su-user name
Rights Management:
chmod
U-owner G-owned group O other people
r-4-readable w-2-writable x-1-executable
Example: chmod u+wx file name or chmod 641 file name
Default Permissions
Umask-s 0022//777-022 = 755
Modified: Umask 027//777-027 = 750 Permissions modified to 750
Note: Linux permissions rule: The file created by default cannot grant executable x permissions, so it is actually 644
Change owner, owning group:
Chown User name File name
CHGRP Group name File name
Real-time communication between users: Users who are not online will never receive
Write user name Content Ctrl+d exit
Wall content Ctrl+d exit Send to everyone
CD/root directory
CD./Current directory PWD
Cd.. /Parent Directory
Manipulating files, directories
CP Cp-r
Ls-a-d-l
Cp-r: Copy Folder
MV: Move + rename
Mkdir
Rm-f: Do not ask
RM-R: Deleting a directory
Touch: Create an empty file
Note: The file unit size is not K, is block;1 block=512 bytes
View Files
Cat
More Space/enter Q exit
Head-rownum
Tail-rownum/-f
Ln-s Soft Connect: Symbolic links (similar to Windows shortcuts) can span partitions
ln Hard Link:(similar copy "cp-p" + Synchronous Update "Ls-i" file must have I node, one I node can correspond to multiple files) cannot cross partition
Note: cp-p: Time value unchanged
Compression decompression:. bz2. gz. tar.gz. zip
. bz2 cannot compress directories, do not keep source files, compression ratio is amazing
Compression: bzip2 file name bzip2-k file name {Keep source file}
Unzip: BUNZIP2 file name
. GZ cannot compress the directory and does not retain the source file
Compressed files: gzip file name
Unzip file: Gunzip file or gzip-d file
. tar.gz Compression Directory
Zip Directory: Tar: Package a directory as a file
TAR-ZCVF package file name. tar.gz Directory pack + compress
Extract directory: TAR-ZXVF package file name. tar.gz
Common formats for. zip Linux and Windows
Compressed file: Zip Archive package name File name
Compressed directory: Zip-r Compressed package name File name
Decompression: Unzip compressed package name
Note: Determine file type: filename
Learn basic operating instructions for Linux systems from scratch