Linux Getting Started Basics command (i)

Source: Internet
Author: User

Linux Getting Started Basics command
Internal command
Resident Memory: brought by the shell and provided by a command

Help: Get a list of all internal commands (only one part is intercepted)

650) this.width=650; "Src=" http://upload-images.jianshu.io/upload_images/6144185-4dbeaf79f9ca1c3a?imageMogr2/ auto-orient/strip%7cimageview2/2/w/1240 "style=" Border:0px;vertical-align:middle;height:auto; "alt=" 1240 "/>


Enable Command: Execute this command to enable command commands
Enable-n Command: Execute this command to disable command commands
enable-n: View all commands that are disabled (such as)

650) this.width=650; "Src=" http://upload-images.jianshu.io/upload_images/6144185-3d3c7114472d251d?imageMogr2/ auto-orient/strip%7cimageview2/2/w/1240 "style=" Border:0px;vertical-align:middle;height:auto; "alt=" 1240 "/>


External command execution
There is a corresponding executable line file view path under the file system path: Which-a|--skip-alias; Wheris

which Command: View external commands
which-a COMMAND: View all paths
which The difference between command and which--skip-alias command:
Which command can list aliases and paths and which--skip-alias can ignore aliases to show only the path

Whereis Command: You can view all paths to external commands as well as display help documents
Type Command: Specifies whether an internal command or an external command

650) this.width=650; "Src=" http://upload-images.jianshu.io/upload_images/6144185-126e64de651d6f20?imageMogr2/ auto-orient/strip%7cimageview2/2/w/1240 "style=" Border:0px;vertical-align:middle;height:auto; "alt=" 1240 "/>


For example, those with builtin are internal commands.

650) this.width=650; "Src=" http://upload-images.jianshu.io/upload_images/6144185-7a26b771540235d4?imageMogr2/ auto-orient/strip%7cimageview2/2/w/1240 "style=" Border:0px;vertical-align:middle;height:auto; "alt=" 1240 "/>


For example, an external command with a file path
External command execution is sequential:

650) this.width=650; "Src=" http://upload-images.jianshu.io/upload_images/6144185-8436c44031d157f9?imageMogr2/ auto-orient/strip%7cimageview2/2/w/1240 "style=" Border:0px;vertical-align:middle;height:auto; "alt=" 1240 "/>


The external command executes in the above path sequentially
MESG: Execute this command to change Y to N to disable broadcast
Hash: You can view the external command path cached to memory
-L: The details can be displayed, including aliases-p:path aliases: Aliases to Paths-D: Aliases: Delete command aliases-r: Clear cache for all external commands-T: Show alias Path

Alias how to name an order

For example: Alias ' cd/etc/sysconfig/network-scripts/' to cdnet

650) this.width=650; "Src=" http://upload-images.jianshu.io/upload_images/6144185-fc0be4a36482c307?imageMogr2/ auto-orient/strip%7cimageview2/2/w/1240 "style=" Border:0px;vertical-align:middle;height:auto; "alt=" 1240 "/>


Alias ' grep--color=auto ' to grep, execute the command as follows

650) this.width=650; "Src=" http://upload-images.jianshu.io/upload_images/6144185-22c851e7430c5eff?imageMogr2/ auto-orient/strip%7cimageview2/2/w/1240 "style=" Border:0px;vertical-align:middle;height:auto; "alt=" 1240 "/>


Then execute the command grep result can show you want to check the color of the command is red

650) this.width=650; "Src=" http://upload-images.jianshu.io/upload_images/6144185-b594d9910c2a5f9b?imageMogr2/ auto-orient/strip%7cimageview2/2/w/1240 "style=" Border:0px;vertical-align:middle;height:auto; "alt=" 1240 "/>


Note: centos6.9 does not have grep in the alias (need to alias) and centos7.3/inside.
Unalias: canceling aliases
Because everyone likes different aliases that want to give commands, different users can start their favorite aliases in their home directory < need to be in:. BASHRC alias > (examples are as follows:)
Perform the nano edit command first:

650) this.width=650; "Src=" http://upload-images.jianshu.io/upload_images/6144185-c99e373133129987?imageMogr2/ auto-orient/strip%7cimageview2/2/w/1240 "style=" Border:0px;vertical-align:middle;height:auto; "alt=" 1240 "/>


The result of executing the above command is:

650) this.width=650; "Src=" http://upload-images.jianshu.io/upload_images/6144185-515359c5e4f44e85?imageMogr2/ auto-orient/strip%7cimageview2/2/w/1240 "style=" Border:0px;vertical-align:middle;height:auto; "alt=" 1240 "/>


Then you need to fill in the aliases you want to add (I'm adding the white ones here):

650) this.width=650; "Src=" http://upload-images.jianshu.io/upload_images/6144185-e53cddb19115eb80?imageMogr2/ auto-orient/strip%7cimageview2/2/w/1240 "style=" Border:0px;vertical-align:middle;height:auto; "alt=" 1240 "/>


Then press CTRL+X to force exit input Y agree to note that the alias you added above has not yet taken effect, you need to execute the source. BASHRC or. BASHRC to take effect (as shown)

650) this.width=650; "Src=" http://upload-images.jianshu.io/upload_images/6144185-0e1cc1c26998a133?imageMogr2/ auto-orient/strip%7cimageview2/2/w/1240 "style=" Border:0px;vertical-align:middle;height:auto; "alt=" 1240 "/>


A few commands for shutting down the machine:
init 0,halt,poweroff: All can be turned off


This article is from the "12922045" blog, please be sure to keep this source http://12932045.blog.51cto.com/12922045/1930719

Linux Getting Started Basics command (i)

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.