List (ls)
List directory contents.
Syntax:
ls [OPTIONS][FILES]
Common Flags
-l long listing format
-a do not ignore hidden files.
-h print sizes in human readable format
Examples
Default
ls
dir1 dir2 file1 file2
Long listing format
ls -l
total 8
drwxr-xr-x 2 kali kali 4096 Aug 25 16:43 dir1
drwxr-xr-x 2 kali kali 4096 Aug 25 16:43 dir2
-rw-r--r-- 1 kali kali 0 Aug 25 16:43 file1
-rw-r--r-- 1 kali kali 0 Aug 25 16:43 file2
Long listing format & do not ignore .hidden files
ls -la
total 20
drwxr-xr-x 5 kali kali 4096 Aug 25 16:44 .
drwxrwxrwt 19 root root 4096 Aug 25 16:43 ..
drwxr-xr-x 2 kali kali 4096 Aug 25 16:43 dir1
drwxr-xr-x 2 kali kali 4096 Aug 25 16:43 dir2
-rw-r--r-- 1 kali kali 0 Aug 25 16:43 file1
-rw-r--r-- 1 kali kali 0 Aug 25 16:43 file2
drwxr-xr-x 2 kali kali 4096 Aug 25 16:43 .hiddendir
-rw-r--r-- 1 kali kali 0 Aug 25 16:43 .hiddenfile
Long listing format & do not ignore .hidden files & human readable
ls -lah
total 20K
drwxr-xr-x 5 kali kali 4.0K Aug 25 17:51 .
drwxrwxrwt 18 root root 4.0K Aug 25 17:50 ..
drwxr-xr-x 2 kali kali 4.0K Aug 25 17:50 dir1
drwxr-xr-x 2 kali kali 4.0K Aug 25 17:50 dir2
-rw-r--r-- 1 kali kali 0 Aug 25 17:49 file1
-rw-r--r-- 1 kali kali 0 Aug 25 17:49 file2
drwxr-xr-x 2 kali kali 4.0K Aug 25 17:51 .hiddendir
-rw-r--r-- 1 kali kali 0 Aug 25 17:50 .hiddenfile
You can also run ls on directories outside of your current one.
ls -l dir1
total 0
-rw-r--r-- 1 kali kali 0 Aug 25 19:44 file3
-rw-r--r-- 1 kali kali 0 Aug 25 19:44 file4
More verbosity?
man ls