Common command Learning for Linux system Management

Source: Internet
Author: User
Tags cst time

In the previous blog to introduce the Linux installation and directory structure of the relevant knowledge, today we will formally into the Linux system, the content of this issue is as follows:

1. Simple introduction of Linux command function

2. Common commands for Linux system Management

3. Common hotkeys for Linux system Management

4. Get Linux command Help

5. Summary of Contents


First, the Linux command function introduction

First, we introduce a noun "console", which is a human-computer interface, such as DOS, that we typically see using the character-manipulation interface. We say console commands, which are commands that can be used by the operating system via the character interface, such as a DOS command or console command. What we want to know now is the basic console command based on the Linux operating system. It is important to note that, unlike DOS commands, Linux commands (including filenames, and so on) are sensitive to capitalization, meaning that if you enter a command that is not case-insensitive, the system will not make the response you expect.

Linux commands are commands for managing a Linux system. For Linux systems, whether the CPU, memory, disk drives, keyboards, mice, or users are all files, the Linux System Management command is the core of its normal operation, similar to DOS commands. There are two types of Linux commands in the system: built-in shell commands and Linux commands.


Second, Linux system Management common commands

hear "command" two words, presumably everyone is already head big, for this question I think so, "Linux system use command is a very normal thing, this is it is different from the Windows system of an important identity; As long as the Linux system has enough interest, These commands are little things, if you really see these commands on the head big, unacceptable, then give up 650) this.width=650; "alt=" J_0070.gif "src=" http://img.baidu.com/hi/jx2/j_ 0070.gif "/>! ”

In fact, the way the whole instruction is very simple, let's learn some common commands in Linux system Management, as follows:


1. Date: A command that displays dates and times

If you want to know the current Linux system time in the text interface, then you can simply enter a date in the instruction column mode to display, such as:

650) this.width=650; "title=" 2014-12-19_205021.png "alt=" wkiom1suh02grjssaacyoy0omho233.jpg "src="/HTTP/ S3.51cto.com/wyfs02/m01/57/35/wkiom1suh02grjssaacyoy0omho233.jpg "/>

Shown above: Friday, December 19, 20:50 minutes, 06 seconds, CST time zone in 2014


2. Cal: Instructions for displaying calendars

If you want to list the current month's monthly calendar, haha, directly to my system issued CAL instructions can be achieved, as follows:

650) this.width=650; "Width=" 661 "height=" 226 "title=" 2014-12-19_210438.png "style=" width:661px;height:210px; "alt=" Wkiol1sui0sy-cnyaad4vjk1hrk246.jpg "src=" Http://s3.51cto.com/wyfs02/M00/57/32/wKioL1SUI0Sy-cNYAAD4vJK1HRk246.jpg "/>

See this month's monthly calendar, cal This command can do a lot of things, if you are interested in, recommend to consult some information


3, BC: Simple and useful calculator

If you suddenly want to make some simple subtraction in text mode, but you don't have a calculator handy, then BC can help you

650) this.width=650; "title=" 2014-12-19_211326.png "alt=" wkiol1sujv_xkd0faaewhu0j7ho544.jpg "src="/HTTP/ S3.51cto.com/wyfs02/m02/57/32/wkiol1sujv_xkd0faaewhu0j7ho544.jpg "/>

See the pattern, we have entered into the BC working environment, directly using the keyboard input numerical calculation can be, such as:

650) this.width=650; "Width=" 658 "height=" 253 "title=" 2014-12-19_211835.png "style=" WIDTH:658PX;HEIGHT:247PX; "alt=" Wkiom1sujfjwjalpaaeghzxltck393.jpg "src=" Http://s3.51cto.com/wyfs02/M01/57/35/wKiom1SUJfjwJalpAAEgHZxLTck393.jpg "/>

When the calculation is complete, be sure to enter [quit] to leave the BC Software environment


4, CD: (change directory) switch working directory commands, commonly used in the following several combinations

CD + NULL,CD does not add any parameters back to the current user's home directory,

650) this.width=650; "width=" 656 "height=" 187 "title=" 2014-12-19_213256.png "style=" WIDTH:656PX;HEIGHT:169PX; "alt=" Wkiom1sukvmxvpp_aae4g_5eiog890.jpg "src=" Http://s3.51cto.com/wyfs02/M01/57/35/wKiom1SUKVmxvPp_AAE4g_5eIog890.jpg "/>

As you can see, after entering the CD without any parameters command, the user switches directly to the user's home directory from the working directory

Cd+ '-': Users can switch back and forth between the previous directory and the current directory,

650) this.width=650; "Width=" 658 "height=" 159 "title=" 2014-12-19_213820.png "style=" width:658px;height:148px; "alt=" Wkiol1suk4iti-mjaadekiddoaa439.jpg "src=" Http://s3.51cto.com/wyfs02/M01/57/32/wKioL1SUK4iTI-MjAADEKidDoaA439.jpg "/>

For example, use cd+ '-' command to switch between/etc/and user home directories

Cd+ ' ... ' : Returns to the parent working directory,

650) this.width=650; "title=" 2014-12-19_214523.png "alt=" wkiol1sulmcyepr7aacewvobdck904.jpg "src="/HTTP/ S3.51cto.com/wyfs02/m01/57/32/wkiol1sulmcyepr7aacewvobdck904.jpg "/>

Cd+ '. /..‘ : Returns to the working directory on level Two,

650) this.width=650; "width=" 660 "height=" 158 "title=" 2014-12-19_214827.png "style=" width:660px;height:143px; "alt=" Wkiom1sulpbxaykraadoad_yfju640.jpg "src=" Http://s3.51cto.com/wyfs02/M00/57/35/wKiom1SULPbxaykrAADoAd_YfJU640.jpg "/>

For example, you can see the use of cd+ '. /.. ', command user to jump to '/' directory directly from '/etc/sysconfig ' directory


5. TTY: Print the file name of the terminal connected to the standard input,

650) this.width=650; "Width=" 658 "height=" 106 "title=" 001.png "style=" width:658px;height:91px; "alt=" WKioL1SY_y_ Sau5qaacwyhjvw9g886.jpg "src=" Http://s3.51cto.com/wyfs02/M02/57/5D/wKioL1SY_y_SAu5QAACWYhjvW9g886.jpg "/>

There are four main types of TTY terminals:

1), Virtual Terminal:/dev/tty#

2), pseudo-terminal:/dev/pts/#

3), control console:/dev/console
4), serial terminal:/dev/ttys#

Can be judged to be a pseudo terminal


6, Pwd:print work directory, display the current directory where the path, such as:

650) this.width=650; "Width=" 658 "height=" 223 "title=" 002.png "style=" width:658px;height:172px; "alt=" WKioL1SZAHHhmA _gaaeqzaw4lbq650.jpg "src=" Http://s3.51cto.com/wyfs02/M02/57/5D/wKioL1SZAHHhmA_gAAEqzAW4lBQ650.jpg "/>

For example, if you want to know the current working path, you can use the PWD command to view


7, Ls:ls command is one of the most commonly used commands under Linux, it has many options, today we only introduce three of them, as follows:

ls-a; Lists all files under the directory, including the. The implied file at the beginning of the

650) this.width=650; "Width=" 658 "height=" 342 "title=" 003.png "style=" width:739px;height:278px; "alt=" Wkiom1szakag0hczaajcheqdyqe553.jpg "src=" Http://s3.51cto.com/wyfs02/M02/57/5F/wKiom1SZAkag0HczAAJCHeQDYQE553.jpg "/>

ls-l; list the details of the file,

650) this.width=650; "Width=" 664 "height=" 258 "title=" 004.png "style=" width:738px;height:232px; "alt=" Wkiol1szaysybslraahwfwbvqoa925.jpg "src=" Http://s3.51cto.com/wyfs02/M01/57/5D/wKioL1SZAySyBSLrAAHwfwbvQoA925.jpg "/>

Ls-s, after each file name, output the size of the file,

650) this.width=650; "Width=" 659 "height=" 159 "title=" 005.png "style=" WIDTH:745PX;HEIGHT:159PX; "alt=" Wkiol1szaz2sjuwzaaefvu-uzgs951.jpg "src=" Http://s3.51cto.com/wyfs02/M02/57/5D/wKioL1SZAz2SjuWzAAEfvu-Uzgs951.jpg "/>


8. Type: Used to distinguish whether a command is brought by the shell or by a separate shell external binary file, such as:

650) this.width=650; "Width=" 659 "height=" 147 "title=" 002.png "style=" width:705px;height:168px; "alt=" Wkiol1szblwsgbvdaadwdelf5o0811.jpg "src=" Http://s3.51cto.com/wyfs02/M02/57/5D/wKioL1SZBLWSGBVdAADWdelF5O0811.jpg "/>


9, History:history command can review, modify and reuse the previous used historical commands, this issue introduces the following parameters:

History-n (numeric variable) that shows the most recently used N command;

650) this.width=650; "Width=" 661 "height=" 315 "title=" 001.png "style=" width:740px;height:315px; "alt=" Wkiol1szbnphrhbmaaesncn8vys094.jpg "src=" Http://s3.51cto.com/wyfs02/M01/57/5D/wKioL1SZBnPhRHbmAAESNcn8vys094.jpg "/>

History-c clears the command history;

650) this.width=650; "width=" 663 "height=" 460 "title=" 002.png "style=" width:740px;height:460px; "alt=" Wkiol1szboqaajtxaagrv-todsk324.jpg "src=" Http://s3.51cto.com/wyfs02/M02/57/5D/wKioL1SZBoqAaJtxAAGRV-ToDsk324.jpg "/>

History-d +offset can clear the specified entry (will save itself);;

650) this.width=650; "width=" 660 "height=" 310 "title=" 003.png "style=" width:743px;height:310px; "alt=" Wkiom1szbfnz5ufkaaeszrlprga703.jpg "src=" Http://s3.51cto.com/wyfs02/M00/57/60/wKiom1SZBfnz5uFKAAEsZrLPRgA703.jpg "/>

10, Who/whoami;

Who: This command is primarily used to view the current user situation on the online

650) this.width=650; "width=" 662 "height=" 145 "title=" 002.png "style=" WIDTH:740PX;HEIGHT:164PX; "alt=" Wkiol1szcc2cdre6aadinzfwoxs536.jpg "src=" Http://s3.51cto.com/wyfs02/M00/57/5D/wKioL1SZCC2CdRe6AADInZfwOxs536.jpg "/>

WHOAMI: Display its own user name, this directive is equivalent to execute "id-un" instruction,

650) this.width=650; "Width=" 659 "height=" 179 "title=" 001.png "style=" width:742px;height:171px; "alt=" wKiom1SZB7Oztk _aaac1uthnwrs963.jpg "src=" Http://s3.51cto.com/wyfs02/M01/57/60/wKiom1SZB7Oztk_AAAC1utHNwRs963.jpg "/>



Third, Linux system management commonly used hotkeys

Here we need to share an important knowledge, that is, our text mode has a lot of function combination keys, these keys can help us to automatically fill in the command and file name we need to enter! Please be sure to remember these keys! It's important.

1. esc+ ".": Call the last parameter of the previous command, press ESC and then press "." To:

650) this.width=650; "width=" 663 "height=" 393 "title=" 001.png "style=" width:740px;height:393px; "alt=" Wkiom1szcszq-2kgaaeyqafdga8461.jpg "src=" http://s3.51cto.com/wyfs02/M02/57/60/ Wkiom1szcszq-2kgaaeyqafdga8461.jpg "/>, the last command used is" history ", can be esc+., press the button to recall


2, [tab] key: [tab] button is the key in the keyboard of the upper case switch ([Caps Lock]) above the button! Among the various unix-like shells, this [Tab] key is one of the best features of the Linux bash shell! He has the function of "order complete" not "file-filling",

650) this.width=650; "width=" 662 "height=" 154 "title=" 002.png "style=" width:742px;height:210px; "alt=" wKiom1SZCwex_ 0huaadj0mleklk287.jpg "src=" http://s3.51cto.com/wyfs02/M01/57/60/wKiom1SZCwex_0huAADj0mLEKlk287.jpg "/>, Completion via TAB key after input complete Cd/etc/sys

3, [Ctrl]+c button: Terminate the execution of the current command;

650) this.width=650; "width=" 660 "height=" 464 "title=" 003.png "style=" WIDTH:741PX;HEIGHT:464PX; "alt=" wKioL1SZC_HxT_ Q8aaiwpe4bzuk585.jpg "src=" http://s3.51cto.com/wyfs02/M02/57/5E/wKioL1SZC_HxT_Q8AAIwpe4BZUk585.jpg "/>, After entering the Find/command, use CTRL + C to break the command execution


4, [Ctrl]+d button: On behalf of the keyboard input end, can be used instead of "exit",; 650) this.width=650; "Width=" 661 "height=" 149 "title=" 004.png "style=" width : 737px;height:149px; "alt=" wkiom1szdamahcpjaadzw0s-zqy607.jpg "src=" http://s3.51cto.com/wyfs02/M01/57/60/ Wkiom1szdamahcpjaadzw0s-zqy607.jpg "/>, after switching users, you can exit without entering" exit ", using the Ctrl+d shortcut key instead


Iv. getting Linux command Help

1, help + command, can obtain the relevant assistance of the command, applicable to internal commands;

650) this.width=650; "Width=" 657 "height=" 403 "title=" 001.png "style=" WIDTH:741PX;HEIGHT:317PX; "alt=" Wkiol1szejvrmyoiaaiwwfuxx64228.jpg "src=" http://s3.51cto.com/wyfs02/M01/57/5E/ Wkiol1szejvrmyoiaaiwwfuxx64228.jpg "/>650" this.width=650; "width=" 660 "height=" 175 "title=" 002.png "style=" width : 741px;height:175px; "alt=" wkiol1szelgc74fgaadsuz0qrg4574.jpg "src=" http://s3.51cto.com/wyfs02/M00/57/5F/ Wkiol1szelgc74fgaadsuz0qrg4574.jpg "/>

2, command--help, can obtain the relevant help of the order, apply to the external command; 650) this.width=650; "Width=" 658 "height=" 303 "title=" 001.png "style=" width : 743px;height:302px; "alt=" wkiol1szersiibulaaitrzr-qfy357.jpg "src=" http://s3.51cto.com/wyfs02/M01/57/5F/ Wkiol1szersiibulaaitrzr-qfy357.jpg "/>


3, man command, query the use of the specified command, the usage is as follows:

Note Manual manual is divided into chapters; Man # Command (#表示章节号)
1), commands that all users can use
2), system kernel call, not every command has a system call (such as: Man 2 read)
3), library call
4), special documents, such as:/dev/tty1
5), File Format (command configuration file syntax, such as: Man 5 passwd)
6), game-related
7), Miscellaneous
8), administrator commands, such as: fdisk

9), man command syntax;
[]: Optional content
<>: Must give the content
A|b|c: Choose one More
... : You can have multiple

10), man's use mechanism;

SPACEBAR to flip a screen to the end of the file
B: Flip a screen to the file header
Enter: Flip a line to the end of the file
K: Flip a line to the file header
Ctrl+d: Turn half screen at the end of the file
Ctrl+u: Turn half screen to file header
String search:/keyword: From the file header to the tail
Keyword: from the tail of the file to the header
N: Shows the next found
N: Displays the last found
Exit Esc+q

4, Info Command, there is a hyperlink document, info is the information page, provide the author, version, when the release of more detailed information, man manual is to tell you how to use,

5, README; most programs have a corresponding help document, saved in the/usr/share/doc folder such as:

# ls/usr/share/doc/ntp-4.2.4p8/
ChangeLog COPYRIGHT NEWS

6, Google encountered problems, apart Google, priority reference project official documents

V. Summary of CONTENTS

In this issue, we introduce some simple commands commonly used in Linux system management; yes, simple commands; system Management commands There are many, we need to continue to learn the memory, once a small blog is unable to cover all.

Hope that we have encountered in the study of the command, the priority to use Man/henlp/info/google and other ways to get help, so that their own improvement will soon, there is no way to ask others, after all, learned is their own knowledge, others can only be someone else's!

All right, bye!



This article is from the "Saiwang-linux" blog, make sure to keep this source http://1460074147.blog.51cto.com/9692916/1593877

Common command Learning for Linux system Management

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.