Linux is the most commonly used commands (2)

Rights management command
chmod
permissions to change the file or directory: Function

Examples meaning
chmod u + x file or directory Increase to the owner execute (x) permission
chmod g + w, or a file or directory W permission to increase the owning group, other people permission to reduce r
chmod g = rwx file or directory Belongs to the group permission settings as rwx
chmod 640 file or directory The rights owner into 6 (rw-), authority belongs to the group changed to 4 (r-), other people's rights to 0 (-), Note: r-> 4, w-> 2, x- > 1
file or directory chmod -R 640 The permissions for all sub-directory under the file or files or subdirectories changed to 640

chown
Changes file owner or directory: Function

Examples meaning
chown user file or directory Changes file owner or directory

chgrp
function: to change the file or directory belongs to the group of

Examples meaning
chown belongs to the group file or directory Your group change the file or directory

File Find command
the Find
the locate
Which
whereis
grep
help command
man: get help
help: Getting Help Information shell built-in commands are
examples: ls --help or help umask
user management command
command: useradd
(ordinary users) to add a new user: function
example : useradd username

Command: passwd
functions: set user password
Example: passwd username

Note: Ordinary users can only change their own passwords, but the root (superuser, administrator) can change any person's password

Command: who
Function: View user's login information
information includes:
1, login user name (a user can log on several times)
2, login terminal (tty representing the local terminal, pts remote terminal)
3, login time
4, login host IP address (not shown indicates that the present terminal)

Command: W
Function: see more detailed information about the user
information comprises:
a current system time is
2, up: continuous running time
3, the total number of user
4, load average load balance index
5, IDLE: idle time indicates the user
6, PCPU: the user logged in to perform the operation occupied cpu time
7, JCPU: cumulative CPU-time
8, WHAT: the current user command being executed

Compression decompression command
command: gzip
functions: archive
example: gzip file
Note: gzip compressed file can not retain the original file compression, compressed file format .gz, the directory can not be compressed

Command: gunzip
Function: extracting compressed file .gz
example: gunzip file

Command: tar
functions: to compress or decompress directory
example: tar [-zcf] [filename after compression] [need to compress a directory]
-c: Packaging
-v: displays detailed information
-f: specify the file name
-z: packaged at the same time, the compression
generated .tar.gz file

Example: tar [-zxvf] [directory compressed]
the -X-: unpacking
-v: show details
-f: extracting a file name specified
-z: decompressing

Command: zip
functions: compressed files or directories
Example: zip [-r] [name of the compressed file] [file or directory]
-r: Compression directory
Note: zip compression can retain the original file

Command: unzip
functions: Extract the .zip file
example: unzip [archive]

Published 51 original articles · won praise 74 · views 240 000 +

Guess you like

Origin blog.csdn.net/weixin_44766179/article/details/103783263