"Linux learning is not difficult" file/directory Management (5): LS command lists directory and file information

Source: Internet
Author: User

7.5 "Linux learning is not difficult" file/directory Management (5): LS command lists directory and file information


With the LS command, all subdirectories and file information will be listed for the directory, and the file name and other information requested will be exported.
Command syntax:

ls [options] [directory | file]

The meanings of the options in the command are as shown in the table.

Options

option meaning

-A

displays all subdirectories and files in the specified directory, including hidden files

-C

mate -lt: Sort by CTime and show CTime

-D

If the parameter is a directory, only its name is displayed and the files and subdirectories below it are not displayed

-F

Show file Types

-I.

Displays the Inode number of the file in the first column of the output

-L

to display the details of a file in a long format

-R

reverse Order

-T

Sort by modified time

-S

Sort by file size


Example: Displays simple information about files and subdirectories in the directory/var.

[Email protected] ~]# Ls/var

Example: Displays details of all files and subdirectories in the/root directory, including hidden files.

[Email protected] ~]# Ls-al/root

Example: Sort the files and subdirectories in the/root directory with the last access time (last time) of the file.

[Email protected] ~]# Ls-ltr/root

This article extracts from "Linux Learning is not difficult" textbook, which is one of the most practical, theoretical and practical Linux Introductory materials. To read the entire book, visit the Linux ops (www.linuxywz.com) website .



"Linux learning is not difficult" file/directory Management (5): LS command lists directory and file information

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.