Linux/Ubuntu ls command detailed usage format and Method

Source: Internet
Author: User
Tags sorted by name

DocumentThe ls command is used in Linux/Ubuntu to view the files in the selected directory and list the sub-directories in the current directory. It is a frequently used command in Linux/Ubuntu, it is also a very basic command. This command is used in many operations, unless you can memorize all the files on the disk and know which files and folders are in the directory, in this way, you don't need to learn this command. :) For a Linux User, if the ls command is also unknown, I personally think it cannot be a Linux User.

Ls

Format: ls [parameter] [file/directory]

Parameter description:

-A indicates listing all files, including hidden files starting "."

-D if the directory is followed by a directory, only the directory name is output.

-L indicates listing the object entries, including the Object Name, permission, owner, size, and last modification time.

-T indicates that the listed entries are sorted by the last modification time. By default, folders are sorted by name.

-C: vertically sort by column by file name

-F adds a symbol after the file name to indicate the file type

Below I will give you a few examples to illustrate:

This is the difference between ls and ls-a. If ls-a is used for viewing, You can see hidden files starting ".".

We can see that the properties of the folder upload.tar.gz under the current directory are displayed by ls-l.

The subdirectory in the current directory is followed by a slash "/"

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.