Common CentOS learning commands ls

Source: Internet
Author: User

Common CentOS learning commands ls

Command Format and directory Processing Command ls

Command Format: Command [-options] [parameters]

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-a: view files in the local directory (including hidden files)

# Ls-l display the detailed information of the file

1rootroot1208 August 6: 22anaconw.ks.cfg

1rootroot24772, December 6, December 30: 22install. log

1rootroot7690 August 6: 21install. log. syslog

Root owner root group 7690 File Size

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

12345[root@localhost ~]# ls -lhTotal usage 44 K-rw-------. 1 root root <spanstyle="font-size: 16px;"><strong><spanstyle="color: #800080;">1.2K</span></strong></span> December 3 06:22 anaconda-ks.cfg-Rw-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

12[root@localhost ~]# ls -lhd /etcDrwxr-xr-x. 102 root 12 K December 15 06:36/etc

Ls-lhd/etc is to viewThe size of the etc directory Instead of viewing all contents in the ect directory.

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

# Ls-I view the ID number 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.