Viewing files and directory details using ls
The ls
command is used to list files in a directory, and it is similar to the dir
command in DOS. This command can be used with various parameters to give different results.
Getting ready
Since the ls
command is a built-in command in Linux, we don't need to install anything else to use it.
How to do it…
Now, let’s take a look at how we can use ls
in different ways to get a variety of results by just following these steps:
- To take a look at the simple listing of files in a current directory, type
ls
:
- To get more information about the files and directories listed using the
ls
command, add a type identifier as shown here:
- When the preceding identifier is used, the executable files have an asterisk at the end of the name, while the directories have a slash, and so on. To check out details of files, such as the creation dates, owners, and permissions, run a command with the
l
identifier, as shown here:
- To find a listing of all the hidden files in the current...