Linux Basics Getting Started command

Source: Internet
Author: User
Tags clear screen disk usage

First, Basic view command

1. View CPU hardware information: LSCPU

650) this.width=650; "Src=" Http://s3.51cto.com/wyfs02/M00/84/93/wKiom1eVhu6SnrDIAABjynkg-og701.png-wh_500x0-wm_3 -wmp_4-s_1622197640.png "title=" 1.png "alt=" Wkiom1evhu6snrdiaabjynkg-og701.png-wh_50 "/>

2. Check memory usage: free-h

650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M01/84/93/wKioL1eViTHQ71jQAAAbiMChn7Q410.png "title=" 2.png " alt= "Wkiol1evithq71jqaaabimchn7q410.png"/>

3. View disk partition: Fdisk–l

650) this.width=650; "Src=" Http://s3.51cto.com/wyfs02/M01/84/93/wKioL1eViIPDOraNAABplk6DkR4925.png-wh_500x0-wm_3 -wmp_4-s_4018189509.png "title=" 3.png "alt=" Wkiol1eviipdoranaabplk6dkr4925.png-wh_50 "/>

4. View disk usage: df–h

650) this.width=650; "src=" Http://s4.51cto.com/wyfs02/M01/84/93/wKiom1eViU_SqLXLAABF860LAug165.png "title=" 4.png " alt= "Wkiom1eviu_sqlxlaabf860laug165.png"/>

5. View MD5 value of ISO image file: md5sum

650) this.width=650; "src=" Http://s1.51cto.com/wyfs02/M02/84/93/wKioL1eViWuzsx_sAAAWw9Gl58I722.png "title=" 5.png " alt= "Wkiol1eviwuzsx_saaaww9gl58i722.png"/>

6. Display full hostname: hostname

650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M00/84/93/wKiom1eViPHC_HqRAAAOmVvH_78567.png "title=" 6.png " alt= "Wkiom1eviphc_hqraaaomvvh_78567.png"/>

7. View IP Address: ifconfig or IP addrlist

650) this.width=650; "src=" Http://s1.51cto.com/wyfs02/M02/84/93/wKiom1eViY2yytIyAAC1wp-19j4194.png "style=" float: none; "title=" 7.png "alt=" Wkiom1eviy2yytiyaac1wp-19j4194.png "/>

650) this.width=650; "src=" Http://s5.51cto.com/wyfs02/M00/84/93/wKioL1eViY3QHGJnAACeN1ZiziM657.png "style=" float: none; "title=" 7-1.png "alt=" Wkiol1eviy3qhgjnaacen1zizim657.png "/>

8. View Linux version: Cat/etc/centos-release or Cat/etc/redhat-release

650) this.width=650; "src=" Http://s1.51cto.com/wyfs02/M00/84/93/wKiom1eVibjhIskiAAAe7b8r1YQ194.png "title=" 8.png " alt= "Wkiom1evibjhiskiaaae7b8r1yq194.png"/>

9. View Linux System kernel version: Uname–r

650) this.width=650; "src=" Http://s5.51cto.com/wyfs02/M00/84/93/wKiom1eVic2R9TqfAAAO2nVgHMo428.png "title=" 9.png " alt= "Wkiom1evic2r9tqfaaao2nvghmo428.png"/>

10. Check the system time: Date

650) this.width=650; "src=" Http://s4.51cto.com/wyfs02/M00/84/93/wKioL1eVieSAFLyoAAAPjFGTxPs818.png "title=" 10.png "alt=" Wkiol1eviesaflyoaaapjfgtxps818.png "/>

Set the system time format: Date [-u|--utc|--universal] [MMDDHHMM[[CC]YY][.SS]]

650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M01/84/93/wKioL1eVifeA_pN1AAARE7LyqR8047.png "title=" 10-1. PNG "alt=" Wkiol1evifea_pn1aaare7lyqr8047.png "/>

Show UTC Time: Date–u

650) this.width=650; "src=" Http://s5.51cto.com/wyfs02/M02/84/93/wKioL1eViiXw65N1AAAOXkWNAkQ242.png "title=" 10-2. PNG "alt=" Wkiol1eviixw65n1aaaoxkwnakq242.png "/>

Display a specific time format in +% form: Date +%f

650) this.width=650; "src=" Http://s4.51cto.com/wyfs02/M02/84/93/wKiom1eVijWjXzhSAAAXdV-I32U078.png "title=" 10-3. PNG "alt=" Wkiom1evijwjxzhsaaaxdv-i32u078.png "/>

11. Check the system hardware clock:

650) this.width=650; "src=" Http://s2.51cto.com/wyfs02/M01/84/93/wKioL1eVikjgNFrsAAAUr8167jc092.png "title=" 11.png "alt=" Wkiol1evikjgnfrsaaaur8167jc092.png "/>

Calibrate the system clock with the hardware clock: clock–s

650) this.width=650; "src=" Http://s4.51cto.com/wyfs02/M00/84/93/wKiom1eVinqyQCWLAAAhGOp6IHc697.png "title=" 11-1. PNG "alt=" Wkiom1evinqyqcwlaaahgop6ihc697.png "/>

Calibration of hardware clock with system clock: clock–w

650) this.width=650; "src=" Http://s2.51cto.com/wyfs02/M01/84/93/wKioL1eVioriz0CzAAAiIAmZZN8978.png "title=" 11-2. PNG "alt=" Wkiol1evioriz0czaaaiiamzzn8978.png "/>

12. View Calendar: Cal

650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M01/84/93/wKiom1eVit6Sc6g7AAAgTiETJhM668.png "title=" 11-3. PNG "alt=" Wkiom1evit6sc6g7aaagtietjhm668.png "/>

View a year's calendar: cal+ year

650) this.width=650; "src=" Http://s4.51cto.com/wyfs02/M02/84/93/wKiom1eViu-i16l2AABZGknyq7E030.png "title=" 12.png "alt=" Wkiom1eviu-i16l2aabzgknyq7e030.png "/>

To view a calendar for a year: Cal+ month + year

650) this.width=650; "src=" Http://s4.51cto.com/wyfs02/M00/84/93/wKiom1eViwLwbyE1AAAdB6JQ6iE174.png "title=" 12-1. PNG "alt=" Wkiom1eviwlwbye1aaadb6jq6ie174.png "/>

13. View System login User: Who

View current logged in User: WhoAmI

View current user and login terminal: Who am I

View the currently logged-on endpoint: TTY

650) this.width=650; "src=" Http://s5.51cto.com/wyfs02/M01/84/93/wKiom1eVjBahGFt7AAA0eEbnt-Y859.png "title=" 13.png "alt=" Wkiom1evjbahgft7aaa0eebnt-y859.png "/>

14. See if a command is internal or external: Type+command

650) this.width=650; "src=" Http://s4.51cto.com/wyfs02/M00/84/94/wKioL1eVjDeg04TJAAAWO2ytDdA826.png "title=" 14.png "alt=" Wkiol1evjdeg04tjaaawo2ytdda826.png "/>

Internal commands can display Help information using Help+command, while external commands need to display help with Command–help

650) this.width=650; "src=" Http://s4.51cto.com/wyfs02/M02/84/93/wKiom1eVjE3AnDCfAAA4IuOn4kE994.png "style=" float: none; "title=" 14-1.png "alt=" Wkiom1evje3andcfaaa4iuon4ke994.png "/>

650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M00/84/93/wKiom1eVjE6jb6gHAABKOYweY2Y666.png "style=" float: none; "title=" 14-2.png "alt=" Wkiom1evje6jb6ghaabkoywey2y666.png "/>

To view environment variables for external commands: Echo $PATH

650) this.width=650; "src=" Http://s1.51cto.com/wyfs02/M02/84/94/wKioL1eVjGmDen7cAAATwiXnoes484.png "title=" 14-3. PNG "alt=" Wkiol1evjgmden7caaatwixnoes484.png "/>

To view external commands loaded into memory: hash

650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M02/84/93/wKiom1eVjImDQSlNAAAlLwQt-tU144.png "title=" 14-4. PNG "alt=" Wkiom1evjimdqslnaaallwqt-tu144.png "/>

Hash–d command: Remove an external command that is loaded into memory

Hash–r: Clears all external commands that are loaded into memory

Note: Internal commands in bash take precedence over external commands, and external commands loaded into memory take precedence over external commands in environment variables. If there is a command to set the alias, then the command of the alias takes precedence over the internal command.


15. View the absolute path of a command: which

650) this.width=650; "src=" Http://s1.51cto.com/wyfs02/M00/84/93/wKiom1eVjR7DTuybAAAPhugBmz0305.png "title=" 15.png "alt=" Wkiom1evjr7dtuybaaaphugbmz0305.png "/>

16. View the absolute path of a command and the path to the Help document: Whereis

650) this.width=650; "src=" Http://s5.51cto.com/wyfs02/M00/84/93/wKiom1eVjTjRlW4sAAAgjzNP1NU310.png "title=" 16.png "alt=" Wkiom1evjtjrlw4saaagjznp1nu310.png "/>

17. See a simple help for a command: Whatis or man-f

650) this.width=650; "src=" Http://s4.51cto.com/wyfs02/M00/84/94/wKioL1eVjU_S54h0AAAqGsEV9nw444.png "title=" 17.png "alt=" Wkiol1evju_s54h0aaaqgsev9nw444.png "/>

18. View Historical commands: History

650) this.width=650; "src=" Http://s4.51cto.com/wyfs02/M02/84/93/wKiom1eVjYGDaXhaAAAgiTjIIGM870.png "title=" 18.png "alt=" Wkiom1evjygdaxhaaaagitjiigm870.png "/>

History Command Common parameter description:

-C: Empty command history

-D: Delete the specified command history

-r: Read command history from file to History list

-W: Append commands from the history list to the history file

history#: Show the most recent # command

Call the commands in the history list:

!#: Once again execute the # command in the History list

!! : Executes the previous command again

Commands that are run after the system shuts down are saved in the. bash_histry file in the home directory

650) this.width=650; "src=" Http://s1.51cto.com/wyfs02/M02/84/94/wKioL1eVjaKw8nxUAAA2d2zKO3o206.png "title=" 18-1. PNG "alt=" Wkiol1evjakw8nxuaaa2d2zko3o206.png "/>

Second, the use of simple shortcut keys

1. Switch between GUI and text interface

In CentOS6 or CentOS7:

Ctrl+alt+f1 graphical interface

Ctrl+alt+f2-f6 Text Interface

In CentOS5:

Ctrl+alt+f1-f6 Text Interface

Ctrl+alt+f7 graphical interface

2. Bash shortcut keys

Ctrl+l: Clear screen, equivalent to clear command

CTRL + C: Canceling execution of commands

CTRL + A: Move to the front of the command line

Ctrl+e: Move to the last side of the command line

Ctrl+u: Delete to the beginning of the line

Ctrl+k: Delete to end of line

3. Shortcut keys in Gnome graphical interface

Ctrl+shift+n: Create a new terminal

Ctrl+shift+t: Create a new tab page

CTRL+SHIFT+Q: Close a terminal

CTRL+SHIFT+W: Close a tab

Ctrl+pgup/pgun: Switch to the next or previous tab


This article is from the "Linux Operational Learning path" blog, please be sure to keep this source http://fengliang.blog.51cto.com/3453935/1829583

Linux Basics Getting Started command

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.