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