Linux Command Learning Notes

Source: Internet
Author: User

First, command ls:

1, ls command function:

The information that is used to list the file or directory, which belongs to an external command.

2. ls command format:

ls [option] parameter (option can be multiple connected together)

3. ls command common options and examples:

- A (All): Lists all files under the directory, including "." The hidden file at the beginning . Eg:

650) this.width=650; "title=" 36020140714212429996.jpg "style=" height:100px;width:400px; "border=" 0 "hspace=" 0 "alt=" Wkiol1pd2zlhs4ltaadtl-mfd2a898.jpg "src=" http://s3.51cto.com/wyfs02/M00/3D/27/ Wkiol1pd2zlhs4ltaadtl-mfd2a898.jpg "width=" "height="/>

-A (Almost-all): Lists all files under the directory, including hidden files, but does not include "." and ".". eg

650) this.width=650; "title=" 36020140714213015258.jpg "style=" height:91px;width:400px; "border=" 0 "hspace=" 0 "alt=" Wkiol1pd3l7qervwaadnzz5ezes770.jpg "src=" http://s3.51cto.com/wyfs02/M02/3D/27/ Wkiol1pd3l7qervwaadnzz5ezes770.jpg "width=" "height="/>

-B: The non-output characters in the file name are listed in the form of a backslash and character number.

-C: Sorted by last Modified time (CTime) of the file.

-C: Grouped into multiple columns in alphabetical order.

-D: Displays the directory itself, not the files in the directory, with the-l option. eg

[email protected] etc]# ls-ld.

Drwxr-xr-x 98 root root 12288 07-14 21:15.

-F: Lists the files and their types in the current directory. Indicates the directory name by/, ending with an executable file, representing the symbolic link at the end of the @, representing the socket file at the end of the = sign, and ending with the Fif file.

-G: Similar to-l, but the owner is not listed.

-G: Do not list any information about the group, more than-L.

-H: Lists the file size in an easy-to-understand format, more than-l . eg

650) this.width=650; "title=" 36020140714220110724.jpg "style=" height:94px;width:400px; "border=" 0 "hspace=" 0 "alt=" Wkiom1pd4-7r5nhnaaduiyh9ivo751.jpg "src=" http://s3.51cto.com/wyfs02/M00/3D/2B/ Wkiom1pd4-7r5nhnaaduiyh9ivo751.jpg "width=" height= "94"/>

-L: Displays the details of the file in a long format.

-M: All files and directories are separated by commas. eg

650) this.width=650; "title=" 36020140714221043017.jpg "style=" height:29px;width:400px; "border=" 0 "hspace=" 0 "alt=" Wkiom1pd5iyhafv8aabckp1wk_m105.jpg "src=" http://s3.51cto.com/wyfs02/M02/3D/2C/wKiom1PD5iyhAFv8AABCKP1WK_ M105.jpg "width=" "height="/>

-I (Inode): Displays the I node number of the file in the first column of the output. eg

650) this.width=650; "title=" 36020140714221245936.jpg "style=" height:39px;width:400px; "border=" 0 "hspace=" 0 "alt=" Wkiom1pd5pyhnusnaabgn_itkrm251.jpg "src=" Http://s3.51cto.com/wyfs02/M01/3D/2C/wKiom1PD5pyhnUSNAABgn_ Itkrm251.jpg "width=" "height="/>

-r: Reverse display file. eg

650) this.width=650; "title=" 36020140714221245936.jpg "style=" height:39px;width:400px; "border=" 0 "hspace=" 0 "alt=" Wkiom1pd50rzzuthaabgn_itkrm190.jpg "src=" Http://s3.51cto.com/wyfs02/M01/3D/2C/wKiom1PD50rzzUthAABgn_ Itkrm190.jpg "width=" "height="/>

-R: Recursively displays files that show both the directory and all subdirectories. eg

650) this.width=650; "title=" 36020140714222043494.jpg "style=" height:120px;width:400px; "border=" 0 "hspace=" 0 "alt=" Wkiom1pd6hyxcb3_aabge7txlv4130.jpg "src=" http://s3.51cto.com/wyfs02/M02/3D/2D/wKiom1PD6HyxCb3_ Aabge7txlv4130.jpg "width=" "height="/>


Second, the command CD:

1, cd command function:

Used to switch between different directories, which is an internal command.


2. CD Command usage:

CD-: Return to the directory where you last left it. eg

650) this.width=650; "title=" 36020140714231821732.jpg "style=" HEIGHT:102PX;WIDTH:284PX; "src=" http://s3.51cto.com/ Wyfs02/m02/3d/32/wkiol1pd9d2qo7mgaaa9ha_5ksi850.jpg "width=" 218 "height=" 98 "alt=" Wkiol1pd9d2qo7mgaaa9ha_ 5ksi850.jpg "/>

Cd.. : Returns to the parent directory.

CD ~: Return to the home directory, if the root user can be CD ~ followed by any user name, and access to the user's home directory, other users can not access the other user home directory.

CD!$: Takes the parameters of the last command as input.

C. Command type:

1. Function of type command:

Used to display the type of the specified command, judging whether the specified command is an internal command or an external command. The command itself belongs to an internal command.

Note : The command type includes the following :

Alias: Aliases

Keyword: key word, shell reserved word.

Function: Functions, shell functions.

Builtin: Built-in command, Shell built-in command.

File: Files, disk files, external commands.

unfounded: not found.

2. Format of type command:

Type [Options] parameter

3. Type Common options:

-T: Outputs "file", "Alias" or "builtin", respectively, indicating that the given instruction is "external instruction", "command alias" or "Internal command".

-P: Displays its absolute path if the instruction is given an external command.

-A: Displays information for a given instruction, including command aliases, in the path specified by the environment variable "path".

650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M02/3D/35/wKiom1PEAAjRWvzdAACoO7Yhbvw167.jpg "title=" 36020140715000053690.jpg "width=" "height=" 149 "border=" 0 "hspace=" 0 "vspace=" 0 "style=" WIDTH:400PX;HEIGHT:149PX; " alt= "Wkiom1peaajrwvzdaacoo7yhbvw167.jpg"/>


Not finished .....

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.