Linux GUI switch to command mode (CTRL+ALT+F2), command mode switch to graphics mode (CTRL+ALT+F1)
First, System Information
The processor architecture of the Arch Display machine (1)
UNAME-M Display the processor architecture of the machine (2)
Uname-r displaying the kernel version in use
DMIDECODE-Q Display hardware system components-(SMBIOS/DMI)
Hdparm-i/DEV/HDA lists the architecture characteristics of a disk
HDPARM-TT/DEV/SDA performing a test read operation on the disk
Cat/proc/cpuinfo displaying information for CPU info
Cat/proc/interrupts Display Interrupt
Cat/proc/meminfo Verifying memory usage
Cat/proc/swaps shows which swap is used
Cat/proc/version version of the kernel is displayed
Cat/proc/net/dev Display network adapter and statistics
Cat/proc/mounts displaying the loaded file system
Lspci-tv List of PCI devices
LSUSB-TV Display USB Device
Date Displays the system date
Cal 2007 Displays the 2007 calendar table
Date 041217002007.00 sets the day and time of day-the year of the month. seconds
Clock-w saving time changes to the BIOS
Two: Shutdown (System shutdown, restart and logout)
SHUTDOWN-H now shut down system (1)
Init 0 Shutdown System (2)
Telinit 0 Shutdown System (3)
Shutdown-h Hours:minutes & Shutdown system at scheduled times
Shutdown-c Cancel the system at a predetermined time
Shutdown-r now restart (1)
Reboot restart (2)
Logout logoff
III: Files and directories
Cd/home Enter '/home ' directory '
Cd.. Return to the top level directory
Cd.. /.. Return to the top level two directory
CD into the personal home directory
CD ~user1 into the personal home directory
CD-Return to the last directory
PWD Display work path
ls to view the files in the directory
Ls-f viewing files in a directory
Ls-l displaying details of files and directories
Ls-a Show hidden files
LS *[0-9]* displays filenames and directory names that contain numbers
Tree displays files and directories starting with the root directory (1)
Lstree displaying files and directories starting with the root directory tree (2)
mkdir dir1 Create a directory called ' Dir1 '
mkdir dir1 DIR2 Create two directories at a 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 Delete a directory called ' Dir1 ' and delete its contents at the same time
RM-RF dir1 DIR2 Delete two directories and their contents at the same time
MV Dir1 New_dir Renaming/Moving a directory
CP file1 file2 Copy a file
CP dir/*. Copy all files under a 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
(vi longxian.txt) Edit or create a new file, after editing press ESC to exit the edit, Wq exit and save, Q exit
cp-rf/tmp/dir1/*/tmp/longxiantest Copy all files in Dir1 directory to Longxiantest
Iv. File Search
Find/-name file1 from '/' to the root file system to search for files and directories
Find/-user User1 search for files and directories belonging to user ' User1 '
Find/home/user1-name \*.bin in directory '/home/user1 ' search for files with '. Bin '
Find/usr/bin-type f-atime +100 Search execution files that have not been used in the last 100 days
Find/usr/bin-type f-mtime-10 search for files created or modified within 10 days
Find/-name \*.rpm-exec chmod 755 ' {} '; Search for files ending with '. RPM ' and define their permissions
Find/-xdev-name \*.rpm search for files ending with '. RPM ', ignoring removable devices such as optical drives, Czech disks, etc.
Locate \*.ps looking for files ending with '. ps '-run the ' updatedb ' command first
Whereis Halt shows the location of a binary file, source code, or man
Which halt displays the full path of a binary file or executable file
V. Packaging and compressing files
BUNZIP2 file1.bz2 Extract a file called ' file1.bz2 '
bzip2 file1 compress 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 create a package called ' File1.rar '
RAR a file1.rar file1 file2 dir1 simultaneously compresses ' file1 ', ' file2 ' and directory ' Dir1 '
rar x File1.rar decompression rar Package
Unrar x File1.rar decompression rar Package
TAR-CVF Archive.tar File1 Create a non-compressed tarball
TAR-CVF Archive.tar file1 file2 dir1 Create a file containing ' file1 ', ' file2 ' and ' Dir1 '
TAR-TF Archive.tar Display 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 extract a compressed package in BZIP2 format
TAR-CVFZ archive.tar.gz Dir1 Create a zipped package in gzip format
TAR-XVFZ archive.tar.gz Unzip a compressed package in gzip format
Zip file1.zip file1 Create a zip-format compression Package
Zip-r file1.zip file1 file2 Dir1 compresses several files and directories into a zip-format package at the same time
Unzip File1.zip unzip a zip-format tarball
Vi. Text Processing
Cat File1 file2 ... | Command <> File1_in.txt_or_file1_out.txt general syntax for text manipulation using PIPE, STDIN and STDOUT
Cat File1 | Command (SED, grep, awk, grep, etc ...) > Result.txt Merge the detailed description text of a file and write the introduction to a new file
Cat File1 | Command (SED, grep, awk, grep, etc ...) >> Result.txt Merge The detailed description text of a file and write the introduction to an existing file
grep aug/var/log/messages Find the keyword "/var/log/messages" in the file '
grep ^aug/var/log/messages in file '/var/log/messages ' to find words that begin with "."
grep [0-9]/var/log/messages selects all rows in the '/var/log/messages ' file that contain numbers
grep aug-r/var/log/* searches the directory '/var/log ' and subsequent directories for the string "the"
Sed ' s/stringa1/stringa2/g ' example.txt replace "string1" in Example.txt file with "string2"
Sed '/^$/d ' example.txt remove all blank lines from the Example.txt file
Sed '/*#/d; /^$/d ' Example.txt Remove all comments and blank lines from the Example.txt file
echo ' Esempio ' | TR ' [: Lower:] ' [: Upper:] ' merging upper and lower cell contents
Sed-e ' 1d ' result.txt excluding the first line from the file Example.txt
Sed-n '/stringa1/p ' view lines that contain only the word "string1"
Sed-e ' s/*$//' example.txt remove the last white space character from each line
Sed-e ' s/stringa1//g ' example.txt only removes the word "string1" from the document and retains all remaining
Sed-n ' 1,5p;5q ' example.txt view the contents from the first line to the 5th line
Sed-n ' 5p;5q ' example.txt view line 5th
Sed-e ' s/00*/0/g ' Example.txt replaces multiple zeros with a single 0
Cat-n file1 number of lines to mark a file
Cat Example.txt | awk ' nr%2==1 ' deletes all even lines in the Example.txt file
echo a b C | awk ' {print '} ' view one row of the first column
echo a b C | awk ' {print $1,$3} ' view the first and third columns of a row
Paste file1 file2 Merge two files or two columns of content
Paste-d ' + ' file1 file2 merge two files or two columns of content, in the middle with "+" distinction
Sort file1 file2 Sorting two contents of a file
Sort File1 File2 | Uniq Remove the set of two files (duplicate lines are retained only one copy)
Sort File1 File2 | Uniq-u Delete the intersection, leaving the other rows
Sort File1 File2 | Uniq-d Remove the intersection of two files (leaving only files that exist in two files)
Comm-1 file1 file2 Compare the contents of two files delete only what ' file1 ' contains
Comm-2 file1 file2 Compare the contents of two files delete only what ' file2 ' contains
comm-3 file1 file2 Compare the contents of two files delete only two files that are common to each other
Linux Learning Summary two: Linux basic command Learning