Linux common commands (LS)

Source: Internet
Author: User

Recently the company's CactiEZ server often down, in order to find the cause and solve the problem, began to learn linux,0 Foundation Oh, a little bit every day, some of the following things have their own understanding, if you see the wrong place please criticize.

1,ls

1.1, ls

View files under the current directory and other paths

[[email protected] tmp]# ls

Inittab.1 keyring-lcsyxe pulse-ec9rleu7n2x5 VIRTUAL-123.PR3XJK

Inittab.new keyring-lledmg sort.test virtual-123.uwbe2x

INITTAB.Q KEYRING-ME6S2R Test vmware-123

Keyring-eb0yra keyring-qaxkcd virtual-123.47nrlk vmware-config0

KEYRING-EGRBSH KEYRING-U3YHKC virtual-123.5byv6p Vmwarednd

Keyring-ejyje6 orbit-123 Virtual-123.anxrfm Vmware-root

keyring-henl1l ORBIT-GDM virtual-123. AUWP5A vmware-root-4282299931

Keyring-kkuuwo Pulse-cep2gjhn6lsz virtual-123.mv0bzx Vmware.tools

1.2, ls-a

This command allows you to view all files in the current directory, excluding hidden files, hidden files are implemented through LS-A. When you can see all the files in the current root directory, including hidden files, hidden files are "." The first, for example, a. autorelabel file is a hidden file.

[Email protected] tmp]# ls-a

. keyring-henl1l pulse-ec9rleu7n2x5 vmware-123

.. Keyring-kkuuwo sort.test vmware-config0

. esd-500 keyring-lcsyxe Test VMWAREDND

. Ice-unix keyring-lledmg virtual-123.47nrlk vmware-root

Inittab.1 keyring-me6s2r virtual-123.5byv6p vmware-root-4282299931

Inittab.new keyring-qaxkcd Virtual-123.anxrfm Vmware.tools

INITTAB.Q KEYRING-U3YHKC virtual-123. AUWP5A . X0-lock

Keyring-eb0yra orbit-123 virtual-123.mv0bzx . X11-unix

KEYRING-EGRBSH ORBIT-GDM VIRTUAL-123.PR3XJK

Keyring-ejyje6 Pulse-cep2gjhn6lsz virtual-123.uwbe2x

1.3, ls-l

If you want to see the details of the file, you can check here by Ls-l.

[Email protected] tmp]# ls-l

Total 128

-rw-r--r--1 root root 884 Nov inittab.1

-rw-r--r--1 root root 884 Nov inittab.new

-rw-r--r--1 root root 884 Nov inittab.q

DRWX------. 2 123 123 4096 Oct 01:15 Keyring-eb0yra

Explain the meaning of the specific information shown here. Total 24 represents the size of the folder, there is no display units if you want to display units can be displayed by LS-LH unit is kbyte. One of the 10-bit horizontal lines in the first column represents the type of file:

1.3.1, 1th Place:

-: Represents a normal file.

d (Directory): Represents a catalog file, which is represented in blue by the directory file in Linux.

L (link): Represents a linked file.

B (block): Block device files, in the Linux device type includes block device files and character (linear) device files, such as hard disk is a block device files, because the file is stored in the hard disk is divided into a block to save, access to read the sequence of the file in no order, So it's random access. While character (linear) devices are accessed linearly, such as input to the mouse keyboard and output devices such as monitors, are performed in a linear order by some queuing mechanisms, so the character device is also called a linear device.

C: Character device file.

P: Pipeline file.

S: Socket file.

The next 9 bits represent the permissions of the file, each 3 bits of a group, the permissions include R, W, x (read, write, execute), read 4, write 2, and executable is 1.

1.3.2, number of hard links to files

-rw-r--r-- 1 root root 884 Nov inittab.1

1.3.3, owner of file (master)

-rw-r--r--1 root root 884 Nov inittab.1

1.3.4, size of file

-rw-r--r--1 root root 884 Nov inittab.1

1.3.5, last modified time for file

-rw-r--r--1 root root 884 Nov inittab.1

Here is a concept is the timestamp of the file (access, modification, change), the modification is the contents of the file is modified, the change is the properties of the file is changed.

1.4, ls of other commands

Ls-a: All files are displayed but not displayed. and.

Ls-ld: Displays the properties of the current directory itself.

Ls-i: Displays the index node number of subdirectories and files under the current directory.

Ls-r: File names are sorted in reverse order.

Ls-r: Recursive display

Linux common commands (LS)

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.