Linux commands (4) LS

Source: Internet
Author: User

1. Role

View files and directories.

2. Usage

ls "parameter" "Directory Name"

Parameters:

-A: Lists all files, including hidden files (files starting with.);

-A: Lists all files, including hidden files, but not included. With the. These two directories;

-D: Lists only the directory itself, not the file data in the directory;

-F: Lists the results directly without sorting (LS is sorted by file name by default);

-F: According to files, directories and other information to give additional data structure, such as * on behalf of the executable file,/representative directory, = the socket file, | represents the FIFO file;

-L: Lists the contents of the directory as columns, listing the attributes and permissions of the file;

-H: Displays the file capacity in an easy-to-read manner (such as GB, KB, etc.) and uses the-l combination;

-I: List inode numbers;

-N: Lists UID (user ID) and GID (user group ID);

-r: Output The sorting result in reverse order;

-R: Listed along with subdirectory contents;

-S: Sort by file size (default by file name);

-T: Sort by Time (default by file name);

--color=never: Do not give color display according to the file characteristics;

--color=always: Display color;

--color=auto: The system determines the color display according to the settings;

--full-time: Display in full time mode (including date, time, and seconds);

--time={atime,ctime}: Output access time atime or change the permission attribute time CTime, combined with-l use;

3. Example

3.1 ls Dir1

3.2 Ls-a Dir1

List all files, including hidden files (files starting with.);

3.3 Ls-a Dir1

Lists all files, including hidden files, but not included. With the. These two directories;

3.4 ls-d Dir1

Lists only the directory itself, not the file data in the directory;

3.5 ls-f Dir1

List the results directly without sorting (LS default will be sorted by file name);

3.6 Ls-f Dir1

To give additional data structure according to the file, directory and other information, such as * representing executable file,/representative directory, = Socket file, | representing FIFO file;

3.7 Ls-l Dir1

The contents of the directory are listed in columns, listing the attributes and permissions of the file;

3.8 Ls-lh Dir1

Display the file capacity in an easy-to-read manner (such as GB, KB, etc.) and use it in combination with-l;

3.9 Ls-i Dir1

List inode numbers;

3.10 Ls-n Dir1

List UID (user ID) with GID (user group ID);

3.11 Ls-r Dir1

Output the sorting result in reverse order;

3.12 Ls-r Dir1

Together with sub-directory contents;

3.13 Ls-s Dir1

Sort the file size from large to small (by default, by file name);

3.14 ls-t Dir1

Sort by time (default sort by file name);

3.15 ls--color=never dir1

Do not give color display according to the file characteristics;

3.16 LS--color=always Dir1

Display color;

3.17 LS--color=auto dir1

The system determines the color display according to its settings;

3.18 ls--full-time dir1

Display in full time mode (including date and time);

3.19 Ls-l--time=atime Dir1

Output access time atime, in combination with-l;

3.20 ls-l--time=ctime Dir1

The output changes the permission attribute time CTime, and uses the-l combination;

4. Other

LL = Ls-l

Linux commands (4) LS

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.