The ls program prints human-readable listings of directories. By default, with no arguments, this list is just the names of each file in the current directory, printed horizontally for readability:
$ ls books documents music
If we add the -a flag, we can include dot files in our output, files beginning with a period:
$ ls -a . .. .bashrc .profile books documents music
Note that this output includes theĀ . and .. entries, referring to the current and parent directory, respectively.
Using the -l option, which can be combined with -a, we can get a long listing of files:
$ ls -al drwxr-xr-x 91 bashuser bashuser 16384 Jul 7 19:50 . drwxr-xr-x 5 root root 4096 Jun 1 20:28 .. -rw-r--r-- 1 bashuser bashuser 3391 Jun 30 01:03 .bashrc -rw-r--r-- 1 bashuser bashuser 571 Jun 30 01:03 .profile drwxr-xr-x 54 bashuser bashuser 4096 Feb 6 14:54 books drwxr-xr-x 2 bashuser bashuser 4096 Nov 29 2014 documents drwxr-xr-x 33 bashuser bashuser 4096 Jun 4 00:06 music
Which columns are returned and the format the data takes varies depending on which options you provide, the system's configuration, your personal configuration, and which version of ls is installed.