ls Command--linux command application large dictionary 729 interpretation of commands

Source: Internet
Author: User
Tags syslog disk usage

The content originates from the people's post and Telecommunications press "Linux command Application big dictionary"

tell 729 commands, 1935 examples

Learn about the Linux system's reference books, desk book, encountered the command or command not understand the options can be found

Strive to publish content every day


ls command

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.

table ls command option meaning

Options

Meaning

-A

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

-A

displays all subdirectories and files under the specified directory, including hidden files, but does not list "." and ".."

-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

Preserve order when sorting

-T

Sort by modified time

-S

Display the size of each file allocation in blocks

-S

Sort by file size

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

[[Email protected]~]# Ls/var

Account Crash db Games lib lock mail opt run TMP YP

Cache CVS empty GDM local log NIS preserve spool www

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

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

Total dosage 216

Dr-xr-x---. root root 4096 8 months 19 01:17.

dr-xr-xr-x.25 root root 4096 8 months 19 00:58..

-rw-r--r--. 2 root root 6 8 months 01:17 a

Drwxr-xr-x. 2 root root 4096 8 months 00:47. ABRT

-RW-------. 1 root root 1577 8 months 21:46 anaconda-ks.cfg

-rw-r--r--. 2 root root 6 8 months 01:17 b

-rw-r--r--. 1 root root 5 months . bash_logout

-rw-r--r--. 1 root root 176 5 months . bash_profile

-rw-r--r--. 1 root root 176 9 months 2004. BASHRC

Drwxr-xr-x. 3 root root 4096 8 months 00:47. Cache

DRWX------. 5 root root 4096 8 month 00:47. config

-rw-r--r--. 1 root root 9 months 2004. CSHRC

DRWX------. 3 root root 4096 8 months 00:47. Dbus

........................ ( omitted )

The file name is preceded by "." is the hidden file.

Example: Show file and subdirectory information in/etc directory, mark file type with tags.

[Email protected]~]# ls-f/etc

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

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

Total dosage 100

Drwxr-xr-x. 2 root root 4096 8 months 00:47 public

Drwxr-xr-x. 2 root root 4096 8 months 00:47 template

Drwxr-xr-x. 2 root root 4096 8 month 00:47 video

Drwxr-xr-x. 2 root root 4096 8 months 00:47 's photos

Drwxr-xr-x. 2 root root 4096 8 months 00:47 documentation

Drwxr-xr-x. 2 root root 4096 8 months 00:47 Download

Drwxr-xr-x. 2 root root 4096 8 months 00:47 Music

Drwxr-xr-x. 2 root root 4096 8 months 00:47 Desktop

-RW-------. 1 root root 1577 8 months 21:46 anaconda-ks.cfg

-rw-r--r--. 1 root root 45641 8 months 21:46 install.log

-rw-r--r--. 1 root root 10033 8 months 21:41 install.log.syslog

Example: sort files and subdirectories in the/root directory at the size of the file.

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

Total dosage 100

-rw-r--r--. 1 root root 45641 8 months 21:46 install.log

-rw-r--r--. 1 root root 10033 8 months 21:41 install.log.syslog

Drwxr-xr-x. 2 root root 4096 8 months 00:47 public

Drwxr-xr-x. 2 root root 4096 8 months 00:47 template

Drwxr-xr-x. 2 root root 4096 8 month 00:47 video

Drwxr-xr-x. 2 root root 4096 8 months 00:47 's photos

Drwxr-xr-x. 2 root root 4096 8 months 00:47 documentation

Drwxr-xr-x. 2 root root 4096 8 months 00:47 Download

Drwxr-xr-x. 2 root root 4096 8 months 00:47 Music

Drwxr-xr-x. 2 root root 4096 8 months 00:47 Desktop

-RW-------. 1 root root 1577 8 months 21:46 anaconda-ks.cfg

Example : View the inode for the/root/install.log file .

[Email protected]~]# ls-i/root/install.log

6029314/root/install.log

Example : View /root/install.log file disk usage.

[Email protected]~]# ls-s/root/install.log

52/root/install.log

file /root/install.log disk footprint is 52KB


This article is from the "airfish2000" blog, make sure to keep this source http://airfish2000.blog.51cto.com/10829608/1872276

ls Command--linux command application large dictionary 729 interpretation of commands

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.