Linux Terminal Commands
First, the file directory class
1.Build directory: mkdirDirectory Name
2.Delete Empty directory: RmDirDirectory Name
3.Delete subdirectories unconditionally: RM-RFDirectory Name
4.Change current directory: CDDirectory Name (Go to User HomeCatalog: cd ~;Go to the top level directory: CD-)
5.View your directory: PWD
6.View current directory Size: Du
7. display directory file list: ls-l (-a: Add display of hidden directories)
Where: blue: directory; Span lang= "ZH-CN" > green: executable file; red: Compressed file; light blue: linked files; Red bottom white: Wrong link file
8. Browse Files: More file name. Txt;less file name. TXT
9. Copy files: cp source file destination file (-r: Include directory)
10. Find files: (1) Find (2) locate command name
11. Links: (1) build hard link: ln source file Link file (-d : Create directory link); (2) establish symbolic Link: ln-s source file Link file
Two. Drive Mount Class
1.Check hard disk usage: df-t-H
2.Check disk partition: Fdisk-l
3. mount soft hard light zone: mount-t/dev/fdx|hdax/mnt/ directory name
Including:: Modos--fat16;vfat--fat32;ntfs--ntfs; optical drive--iso9660
support Chinese name: Mount-o iocharset=x/dev/hdax/mnt/ directory name ( where: X=cp936 or
Mount Optical drive: mount-t auto/dev/cdrom/mnt/cdrom
mount Iso file: mount-t Iso9660-o Loop xxx.iso/path
4. Lifting mount: Umount/mnt/ directory name
lifting all mounts: UMOUNT-A
5.< Span lang= "ZH-CN" > set up file system: Mkfs-t/dev/hdxx:ext2
Three. program installation class
1.RPMPackage Installation: (1)Installing RPM-IVH somesoft.rpm
(2) anti-installation rpm-e somefost.rpm
(3) query rpm-q somefost not installed; (4) query post installation location: RPM-QL somefost.rpm
(5) Upgrade installation: RPM -UVH somesoft.rpm
(6) mandatory installation: RPM-IVH--nodeps somesoft.rpm 2. SOURCE Package Installation:
check readme
basic usage (1) configuration: Unzip the directory under &NBSP;./CONFIGURE
(2) compile: Unzip the directory under make
(3) install: Unzip the directory under make install
3.src.rpm Installation
Four. compression Decompression class
1.tar.gzClass: (1)Decompression: TAR-XVZFFile. tar.gz; (2) tar.gzSolution to Tar: gzip-dFiles. tar.gz (2)Compression: gzipFiles to compress
2.tarUncompressed class: (1) unpacking: Tar-xvf file. Tar; (2) pack: Tar- Cvf file. Tar file list
3.zip decompression: Unzip file. zip-d dir (2) compression: Zip Zipfile List of files to be compressed
4.bz2 Decompression: Bunzip2 file. Bz2 or Bzip2-d file. bz2 compression: Bzip2 5.z decompression: Uncompress file. Z (2) Span lang= "ZH-CN" > compression: Compress file
Five. Process Control class
1. list the current process ID: PS-AUXW
2. terminating the process: (1) terminating a single process: Kill Process ID number
(2) terminate the program all processes: Killall program Name
(3) Terminate X-window program: Xkill
3. View Resource Usage: (1) Top (2) Free (3) DMESG
4. View environment variable values: ENV
5. Restart : (1) Reboot (2) Ctrl Alt Del (3) Init 6
6. Shutdown: (1) Shutdown-h now (2) halt (3) Init 0
7. Switch Desktop: Switchdesk gnome| kde| ...
Six. program run class
1. query command: Whereis command name
2. Background Run X-window Program: Program Name &
3. forced exit X-window program: Ctrl Alt Backspace
4. View Help:
(1) Concise Help: command name--help | less
(2) more help: man command name
(3) Info command name
(4) Help command name
5. View the system path: Echo $PATH
6. View the current shell stack: Echo $SHLVL
7.</>: Input/ output redirection; |: Pipe LEFT input is pipe right input
Six. user account Class
1.Add user account: (1)User name: AddUserUser account Name
(2)Set Password: passwdUser account Name
2.Delete user account: UserdelUser account Name
3.Add user group: GroupaddUser group name
4.Delete user group: GroupdelUser group name
5.Temporarily terminate user account: Passwd-lUser account Name
6.Restore terminated account: Passwd-uUser account Name
7.Permission settings
(1) Chmod-a|u|g|o |-|=r|w|xFileDirectory Name
of which: a--All users (all); u--(user); g--User groups (group); o--Other user (other users)
--Increase permissions;---Delete permission; =--Set permissions
Files: r-- Write permission (write); X-- Execute permissions (execute)
directory: R-- Allow files and subdirectories under the column directory; W-- allow generation and deletion of files under directory; X-- Allow access to the directory
(2) chmod xxx file/ directory name
where: execute=1;write=2;read=4 x value: 0-- No permissions ( can only be performed ( can only write ( can only be written and executed ( Read only ( read-only and execute ( Read and write ( read. Write and execute
Seven. Vi edit class
1. Enter after the command mode: (1) insert I open 0 modify C replace S
2. After (1) Enter full screen editing mode.
3. Command mode--> edit mode (a/i) Command mode (ESC) :) 4.:w/w newfile save
5. : q/q! Exit VI (or SHIFT+ZZ exit) ;:wq save exit
Eight. Network Services
1.Display Network interface parameters: Ifconfig
2.Display System mail: Mail
3. Start/ stop Web service: Httpd-k Start|stop|restart
4. View network Status: (1) online Status: Ping xxx.xxx.xxx.xxx;
(2) Display network status: Netstat , where: Options:-a== all sockets;-l== contains network devices;-n== digital IP;-o== Other information ;-r== routing table;
-t== only TCP sockets;-u== only UDP sockets;-w== only raw sockets;-x== only Unix Domain sockets
Linux Terminal commands Comprehensive introduction