ls command

The ls command lists the directory contents. Let’s look at our example to understand how it works. It is the most used command. You can see directory contents and directory attributes.

  1. Enter the ls command.
  2. These are the contents of current directories.

You can list the contents of any directory using ls command.

Now, you’ll learn some usefull ls options.

ls -a command

The option -a does not ignore the entries starting with . (dot). You can not see these .(dot) files, because they’re hidden. To list the hidden file, you must use -a option.

  1. Enter below command.

ls -a

2. These are the entities starting with . (dot) You see the hidden files.

No file can be kept from you if you use -a option.

ls -l command

The option -l lists the contents in long format. It means that you can learn the permissons of file and owner of file using ls -l command. You’ll learn the permissions and owner at later of this course.

  1. Enter below command.

ls -l

2. You can see the contents in long format.

The ls command is first command you learn. You can list all file using command line and ls command without using mouse.

That’s one small step for Linux, one giant leap for you.