Common LInux learning commands ls and linux Common commands ls

Source: Internet
Author: User

Common LInux learning commands ls and linux Common commands ls

Command Format and directory Processing Command ls

 

Command Format:Command [-Option] [parameter]

 

For example:Ls-la/etc

 

Note:

 

1) Some commands do not follow this format

 

2) when there are multiple options, you can write them together

 

3) Simplified options and complete options

 

-A equals to -- all

 

PS: in Linux, "." indicates a hidden file.

 

Directory processing command: ls

Command Name:

Ls

Command:

List

Command path:

/Bin/ls

Execution permission:

All users

Function Description:

Show directory files

Syntax:

Ls option [-ald] [file or directory]

 

-A: displays all files, including hidden files.

 

-L detailed information display

 

-D. view directory properties.

# Ls-View files in the current directory (including hidden files)

# Ls-lDisplays detailed information about a file.

 

1 root 1208 December 3 06:22 anaconda-ks.cfg

 

1 root 24772 December 3 06:22 install. log

 

1 root 7690 December 3 06:21 install. log. syslog

 

Root owner root group 7690 File Size

 

The followingLs-lhIs to convert the file size byte display into Windows

 

[Root @ localhost ~] # Total ls-lh usage 44K-rw -------. 1 root1.2 KDecember 3 06:22 anaconda-ks.cfg-rw-r -- r --. 1 root 25 K December 3 06:22 install. log-rw-r --. 1 root 7.6 K December 3 06:21 install. log. syslog.

 

1.2 K and 7690 represent one meaning, but when ls-lh is used, the file size will be changed to the K, M, G representation we are familiar with, rather than the byte representation.

-Rw-r --

-File type (-binary file d indicates directory l indicates soft link file)

 

Rw-r --

 

U g o

 

U owner g owner group o others

PS: r read w write x Execute

 

[Root @ localhost ~] # Ls-lhd/etcdrwxr-xr-x. 102 root 12 K 06:36/etc

 

Ls-lhd/etcYesEtcThe directory size instead of viewing all contents in the ect directory.

 

[root@localhost ~]# ls -i795111 anaconda-ks.cfg  786436 install.log  786437 install.log.syslog

 

# Ls-IView the ID of each file

 

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.