Example defined mytest or test user MyGroup user group
Cat/etc/group View Group Groupname:x:groupid: Other member Group name: X (encryption): Group ID: Group member
CAT/ETC/PASSWD View User User name: x: User id: Group Id:shell Parser
Useradd mytest Adding users
passwd mytest Set Password
Groupadd MyGroup Adding groups
Groupdel MyGroup Deleting a user group
Example:
Groupadd MyGroup Adding groups
Useradd test-g MyGroup Adding users to the MyGroup group
passwd Test Change Password
CAT/ETC/PASSWD for viewing
Cat/etc/group for viewing
Ls-a Show hidden files
Ls-l a row to display file information
Ls-al View more information
-rwx rwx rwx4 rootroot 4096Sep 8 14:06.
Permissions Connection owner user group file capacity modification time file name
-Documents
Catalog D
| Connection file
b devices in the device file that are available for storage
A serial port device in a C device file, such as a keyboard, mouse
R Readable 4
W writable 2
X executable 1
-| user | Other users in the same group | Other group User rights
CHGRP Changing the user group to which the file belongs
Chown Changing the file owner
chmod changing file permissions
Example:
In/home/test This Test folder is created by itself
CHGRP Group name File name
Chgrp Mygrouptest
Chown User name: Group name File name
Chown Test:mygroup Test
chmod 777 file or directory modify file permissions. The file can be read, written, and executed to all users.
Chomod 770 files or directories other groups are not rwx this group and the user can rwx
Mount command
Mount [-parameters] [device name] [Mount Point]
Mount/mnt/cdrom can be used directly when mounting the optical drive
Uninstall command
Umount [Mount Point]
Example/home/test under
MOUNT/DEV/SDA1 test to mount the content on test sda1
CD test
Ls-l can see a lot of files
Cd.. Exit to test parent directory
Umounttest Uninstall
RMRF * Recursive deletion
Ln-s Source Target
| pipe command
Give the result of the previous command | After the command is processed
More display file contents, by line
Less displays the contents of the file, by page
grep query content, keywords
-N shows the first few lines
If it's multiple file grep, add the folder directly.
Find files or folders
Find ABC files in find/home-name abchome directory by name
Files or directories accessed within find/home-amin-1010 minutes
Files or directories accessed within find/home-atime-1010 hours
Files or directories that have changed in find/home-cmin-1010 minutes
Find/home-ctime + 1010 hours ago changed files or directories
Find/home-size +10k to find files of size 10k in the/home directory
REDIRECT Command
Ls-l > A.txt The contents of the list are written to the file
Ls-l >>a.txt Append write to File
TAR-ZXVF File Decompression
& on the console to run
View disk usage
DF [-parameter]
such as Df-l
See which partition a directory is in
DF [Directory full path] There are some memory device management, Udev, SDA1, sda2 and so on device information
View Linux system partition specifics
Fdisk-l
View device usage, according to Inode block and other relational file operating system information
DUMPE2FS [-BH] Device file name
Disk and directory capacity
DF Lists the overall disk usage of the file system
Du evaluates the disk usage of the file system
RPM Package
Redhat Package Manager is gradually being used by Linux distributions to install packages
RPM-QA query all Linux installed with those RPM packages
Rpm-q MySQL to view MySQL package information
Rpm-i RPM Package Full path name: Install package to current system I=install
RPM-IVH RPM Package Full path name: Install the package to the current path on the prompt information V=verboseh=hash progress bar
RPM-E RPM Package Name Delete RPM Package
RPM-E--nodeps RPM Package name Force Delete RPM Package
Rpm-u RPM Package Full path upgrade
Top View CPU Memory usage
DATEMMDDHHMMCCYY.SS months, days and days are divided annually. seconds
Cal3 2012 View Monthly Calendar
Compression: tar-jcv-f filename.tar.bz2 files or directories to be compressed
Enquiry: Tar-jtv-f filename.tar.bz2
Unzip tar-jxv-f filename.tar.bz2-c The directory you want to extract
If you do not specify-C decompression content is in the current folder, the directory to create the first
-C New Package file
-j is for *.tar.bz2 compressed packets.
-Z is for *.tar.gz compressed packets
Linux Common Commands 3