As for the Windows operating system, everyone is very familiar with it, because now 90% of the computer host is using it. The mention of Linux, for most people, is relatively unfamiliar, because in the PC maturity, the computer is rarely used to Linux systems. But sometimes it will be used, such as: we buy the site space is a server or VPS, at this time, more or less need us to understand a little bit of Linux operation. Below, the high time silver blog for everyone to enumerate some Linux common operation commands.
Shutdown (System shutdown, reboot, and logout)
Shutdown-h now Shutdown system (1)
Init 0 Shutdown System (2)
Telinit 0 Shutdown System (3)
Shutdown-h hours:minutes & Shut down system at scheduled time
Shutdown-c Cancel system shutdown at scheduled time
Shutdown-r now reboot (1)
Reboot reboot (2)
Logout logoff
Files and directories
Cd/home into '/home ' directory '
Cd.. Return to the previous level of the directory
Cd.. /.. Back to Level two directory
CD goes to personal home directory
CD ~user1 into a personal home directory
cd– back to the last directory
PWD Display work path
LS View the files in the directory
Ls-f view files in a directory
Ls-l display details of files and directories
Ls-a Show hidden files
LS *[0-9]* Displays the file name and directory name that contains the number
Tree shows the roots of the file and directory by the root directory (1)
Lstree display file and directory tree structure starting from root directory (2)
mkdir dir1 Create a directory called ' dir1′ '
mkdir dir1 DIR2 Create two directories at the same time
Mkdir-p/tmp/dir1/dir2 Create a directory tree
Rm-f file1 Delete a file called ' file1′ '
RmDir dir1 Delete a directory called ' dir1′ '
RM-RF Dir1 Deletes a directory called ' dir1′ ' and deletes its contents at the same time
RM-RF dir1 DIR2 Delete two directories and their contents at the same time
MV Dir1 new_dir rename/move a directory
CP file1 file2 Copy a file
CP dir/*. Copy all files in one directory to the current working directory
Cp-a/tmp/dir1. Copy a directory to the current working directory
Cp-a dir1 dir2 Copy a directory
Ln-s file1 lnk1 Create a soft link to a file or directory
ln file1 lnk1 Create a physical link to a file or directory
Touch-t 0712250000 File1 Modify the timestamp of a file or directory-(YYMMDDHHMM)
File File1 outputs the MIME type of the file as text
Iconv-l List of known encodings
Iconv-f fromencoding-t toencoding inputfile > OutputFile creates a new from the given input file by assuming it is en Coded in fromencoding and converting it to toencoding.
Find. -maxdepth 1-name *.jpg-print-exec Convert "{}"-resize 80x60 "thumbs/{}"; Batch resize files in the current directory and send them to a thumbnails directory (requires convert from Imagemagick)
Users and Groups
Groupadd group_name Create a new user group
Groupdel group_name Delete a user group
Groupmod-n new_group_name old_group_name Rename a user group
Useradd-c "Name Surname"-G admin-d/home/user1-s/bin/bash user1 create a user who belongs to the "admin" user group
Useradd User1 create a new user
Userdel-r User1 Delete a user (' R ' Exclude home directory)
Usermod-c the "User FTP"-G system-d/ftp/user1-s/bin/nologin user1 Modify user Properties
passwd Modify Password
passwd user1 modifies a user's password (only root execution is allowed)
Chage-e 2005-12-31 User1 set expiration period for user password
PWCK check the '/etc/passwd ' file format and syntax corrections as well as the existence of the user
GRPCK check the '/etc/passwd ' file format and syntax corrections as well as the existing group
NEWGRP group_name Log into a new group to change the default group of newly created files
Packaging and compressing files
BUNZIP2 file1.bz2 Extract a file called ' file1.bz2′ '
bzip2 File1 compresses a file called ' file1′ '
Gunzip file1.gz Extract a file called ' file1.gz '
gzip File1 compress a file called ' file1′ '
gzip-9 file1 Maximum Compression
RAR a file1.rar test_file to create a package called ' File1.rar '
RAR a file1.rar file1 file2 dir1 simultaneous compression ' file1′, ' file2′ and directory ' dir1′
rar x file1.rar decompression rar bag
Unrar x file1.rar decompression rar bag
TAR-CVF Archive.tar file1 Create a uncompressed tarball
TAR-CVF Archive.tar file1 file2 Dir1 creates a file containing ' file1′, ' file2′, and ' dir1′ '
TAR-TF Archive.tar Displays the contents of a package
TAR-XVF Archive.tar Release a package
TAR-XVF ARCHIVE.TAR-C/TMP releases the compressed package into the/tmp directory
TAR-CVFJ archive.tar.bz2 Dir1 Create a compressed package in BZIP2 format
TAR-XVFJ ARCHIVE.TAR.BZ2 Unzip a compressed package in a bzip2 format
TAR-CVFZ archive.tar.gz Dir1 Create a compressed package in gzip format
TAR-XVFZ archive.tar.gz Unzip a gzip-formatted compressed package
Zip file1.zip file1 Create a zip-formatted compressed package
Zip-r file1.zip file1 file2 Dir1 compresses several files and directories simultaneously into a zip-formatted compressed package
Unzip File1.zip unzip a ZIP format compressed package
These are the commands that we'll use when the server system is Linux. Of course, if your server system is windows, then there is no need.