Linux basic commands

Source: Internet
Author: User
Tags aliases sub command

Linux command  su: Switch account Note: When there is a # symbol, this is the superuser; when there is a $ sign, this is the normal user  cd: Enter the specified directory LL: Vertical display directory content ls: Horizontal display directory content LS- RTL: Sort by Time (ascending) Ls-tl: Sort by Time (descending) PWD: View current absolute path Date: View system time Date-s ' 2017-02-11 12:12:12 ': Modify system time Touch-t ' 201702021200 ': Modify the file time  1. Query class A. Query for System Information uname-a: View kernel version getconf long_bit: View system bits DF: View current system disk size free: View system memory Information LSCPU: View CPU-related information df-l: Display disk    Mount information fdisk-l: Viewing partition information mount: Load file unmount: Uninstall file fdisk: Format file (Caution) Tail-f: Refresh log in real time   last-x: View User Login History id+ user name: View Current User information WhoAmI: Query who is currently logged on who: query the current logged in user's information w: Query the details of the currently logged-on user  -help: information used to display some tools (e.g. LS--help) man ls: (list directory    Contents) See instructions for using "LS" instructions, man+ unfamiliar instructions, this feature can help us to quickly understand unfamiliar commands   history: Show previously used commands history-c: Clear historical record clear: Clean screen   Alias: View display aliases Unalias: Aliases   PS directive: ps-e: View all static processes Ps-ef: Show verbose static process Ps-ef|grep sshd: Filter out specific process 1234, service start Dynamic status isof-i:80 Query 80 port Service status, process status, top: Dynamic View process top-d 5: Refresh process every 5 seconds   du-m: View file size in megabytes (c bytes, K kilobytes, M Mega, G)   LS instruction (list Directory contents list contents): Ls-lth ll-h: Displays the current targetRecord all file size ls-a: Query All the files in the current directory, including hidden files ls-l: Query the current directory of files (without hidden files), available shortcut keys "ll" find command (exact lookup): Find/-name Hello: Exact Find file name is hello file Find/-iname H: Case-insensitive search for files with "H" Find/-size +1m: Full lookup of files larger than 1 megabytes (C-byte, K-Kbytes, M-Mega, G), less than "-", equal to no sign of add/subtract symbol Find/t Ype d: Search by directory (d: File F: directory) Find/-ctime-1: Full find files with a creation time of less than 1 days (-atime,-ctime,-mtime) (acesstime,creatime,modifytime) Find/-pe RM 644: Search for Find/-mtime by 644 permissions: + 1: Search by Time (+ 1: One day ago) view file Instructions Cat: View file contents more Duoceshi (file): View file duo content less Duoceshi: View the file duo content ( can be transferred up and down)  wc-l duo: Statistics file duo content Wc-c duo: Statistics file duo content rows nl Duo: line display file duo Content head-5 duo: Show file duo Top 3 lines tail-5      Duo: Show file duo 5 lines tail-f duo: Real-time Refresh file duo (used when viewing logs)    RM instruction: RM B (file): Delete b file rm-r xp (folder): Need to confirm continuously when deleting folder Rm-fr XP (folder): Direct and forced deletion, please use it carefully, once deleted difficult to reply to mkdir instructions (make directory): mkdir: Create a folder, the default owner of the folder is root mkdir a b C: simultaneously create a few Files Mkdir-p a/b/c: Create a contiguous directory rmdir xupan (file): Delete Xupan folder, and Xupan must be empty MV: Move or rename cp: Copy useradd Lichao: Add a new user, default owner group is LIC Hao Useradd lichao-g xp-g xpddx: Create user "Lichao"and specify the basic group "XP" and the group of "XP", "Xpddx" Userdel Lichao: Delete user passwd Lichao: Modify user Lichao password secret stored in:/etc/shadowcat/etc/passwd: Find All Users User stored in:/etc/passwdcat/etc/passwd |grep ' Lichao ': Find user ' Lichao '   chmod u=rwx keji Master permission changed to rwx chmod g=rw,o= Rx Keji Group Permissions change to RW other permissions to rx chmod a=rwx keji All permissions are changed to rwx chmod u-x Keji minus master permissions Chmo D a+x keji all plus permissions chmod ug+w,p-x keji Add and Subtract permissions rwx: Available 644 instead of CHOMD: Modify file (directory) permissions Chown Lichao A: Change the owner of a (file or directory) to ' Lichao ' Chgrp Lichao A: Modify the Group A (file or directory) to ' Lichao '   compress extract command: TAR-CVF duo_10.tar duo: Compress file or directory duo to DUO_10.TARTAR-XVF Duo_ 10.tar: Unzip DUO_10.TARTAR-ZCVF duo_10.tar.gz duo: Compress file or directory duo to DUO_10.TAR.GZTAR-ZXVF duo_10.tar.gz: Unzip Duo_10.tar.gzgzip Duo: Compressed file duo to duo.gz format gunzip duo.zip: Unzip zip file duo.gzzip duo.zip duo: Compressed file or directory duo for duo.zip format unzip duo.zip: Unzip file or directory Duo.zip   Ln-s KJ linkkj: Create a soft link to kj file if kj (file) is lost, then linkkj fail ln: Hard link ps-ef: View process Kill 1234: Close process 1234kill-9 1234: forcibly kills process 1234&N BSP;RPM-IVH mysql*.rpm: Installing the MYSQL.RPM package RPM-UVH MYSQL*.RPM: Upgrade mysql.rpm Package Rpm-aq: Query rpm Package   VI Editor: s/i/o/a: Enter Edit Status chrl+c: Exit edit yy+p: line copy 5yy: Copy cursor under 5 line 5DD: Delete cursor under 5 lines D : Delete Row after DD: Delete Row zz/: Exit Save: Wq Save exit: wq! Save forced Exit: Q does not save exit: Set Nu: Sets line number: 9,15 w/duo copy this 9-15-line record to duo text: W/duo Copy all content records with duo text: R/duo Copy the contents of the duo file after the cursor: 1,5 > 1-5 Line Right Indent one tab (4 bytes): 1,5 >> 1-5 lines indent right two tab (8 bytes): abbr 9 duo temporary replacement: VSP duo this file compared to duo file (Vim Editor)/Find J backspace u undo. Repeat last action   remote transmitter: sftp:192.168.1.123 Enter password get: Receive text put: Send file   database: Database online installation 5.1:yum install MySQL yum install Mysql-server Set Password: mysqladmin-u root password ' 123456 '   ps-ef|grep tomcat: View Tomcat process boot status lsof-i : 8080: View 8080 port condition   Sub command: Yum install Lrzsz: File transfer   supplement: Init 0/halt-p: Shutdown now init 6 reboot: Restart Ifconfig eth0 192.168.1.12 3 netmask: Temporarily replace IP address service iptables STOP: Turn off Firewall service iptables start: Start firewall sservice iptables Status: View firewall status Iptables-l- N: View firewall filter Port  chkconfig iptables on: Permanently turn on the firewall chkconfig iptables off: Permanently shut down the firewall  service Networkmanager Restart: Network Manager restarts the service (when the network connection icon disappears)  service network RestarT: Restart the NIC service mysqld start: Start Mysqlserbice mysqld stop: Close mysql pkill-9 java: Stop all Java process commands   View current language: Echo $ lang   mstsc        

Linux basic commands

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.