$ ls -a
. .. .preferences action drama comedy genres.xt
ls command lists all files and directories in the working directory.
-a modifies the behavior of the
ls command to also list the files and directories starting with a dot (
.). Files started with a dot are hidden, and don't appear when using
-a is called an option. Options modify the behavior of commands. Here we used
ls -a to display the contents of the working directory in more detail.
In addition to
ls command has several more options. Here are three common options:
-a - lists all contents, including hidden files and directories
-l - lists all contents of a directory in long format
-t - order files and directories by the time they were last modified.
Let's practice using these options below.