Learn the linux command: LS command

Source: Internet
Author: User
Tags syslog

The LS command is one of the most commonly used commands for Linux.

LS Explanation:

Ls-list Directory Contents List Contents

LS Description:

The information that lists the files smoothly by alphabetical order.

LS Syntax:

ls [OPTION] ... [FILE] ... = ls option directory name

Common parameters:

-a lists all files in the directory (including hidden files)

-l list files in long format

-D directory entry list instead of content, do not reference symbolic links

The usual parameters are above three. There are also parameters that can be queried with man LS in Linux.

Example 1: Listing directories under the root directory

[[email protected] ~]# ls
AAA anaconda-ks.cfg BBB CCC Install.log Install.log.syslog

Example 2: The directory under the root directory with long columns

[Email protected] ~]# ls-l
Drwxr-xr-x. 2 root root 4096 Apr 5 15:16 AAA
-RW-------. 1 root root 1096 Apr 5 10:08 anaconda-ks.cfg
Drwxr-xr-x. 2 root root 4096 Apr 5 15:23 BBB
Drwxr-xr-x. 3 root root 4096 APR 5 15:25 CCC
-rw-r--r--. 1 root root 23571 Apr 5 10:08 Install.log
-rw-r--r--. 1 root root 6240 Apr 5 10:04 Install.log.syslog

Example 3: All directories under the root directory with long columns

[Email protected] ~]# Ls-la
Dr-xr-x---. 5 root root 4096 Apr 6 13:34.
Dr-xr-xr-x. Root root 4096 Apr 6 13:23.
Drwxr-xr-x. 2 root root 4096 Apr 5 15:16 AAA
-RW-------. 1 root root 1096 Apr 5 10:08 anaconda-ks.cfg
-RW-------. 1 root root 1339 Apr 6 13:30. bash_history
-rw-r--r--. 1 root root. bash_logout
-rw-r--r--. 1 root root 176 May. bash_profile
-rw-r--r--. 1 root root 176 Sep 2004. BASHRC
Drwxr-xr-x. 2 root root 4096 Apr 5 15:23 BBB
Drwxr-xr-x. 3 root root 4096 APR 5 15:25 CCC
-rw-r--r--. 1 root root Sep 2004. CSHRC
-rw-r--r--. 1 root root 23571 Apr 5 10:08 Install.log
-rw-r--r--. 1 root root 6240 Apr 5 10:04 Install.log.syslog
-rw-r--r--. 1 root root 129 Dec 4 2004. TCSHRC

Example 4: Listing files in the/ETC/INIT.D directory

[Email protected] ~]# LS/ETC/INIT.D
Abrt-ccpp crond killall NFS-RDMA restorecond svnserve
ABRTD functions Lvm2-lvmetad ntpd rngd Sysstat
Abrt-oops Haldaemon lvm2-monitor ntpdate rsyslog udev-post
Acpid Halt mdmonitor postfix sandbox
ATD Ip6tables Messagebus Psacct SASLAUTHD
AUDITD iptables netconsole quota_nld Single
Blk-availability irqbalance netfs Rdisc SMARTD
Cpuspeed kdump Network RDMA sshd

Learn the linux command: LS command

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.