What happens when you type ls -l in the shell ?

ls command is one of the most frequently used command in Linux. I believe ls command is the first command you may use when you get into the command prompt of Linux Box.

We use ls command daily basis and frequently even though we may not aware and never use all the ls option available.

In this article we’ll be discussing the importance of ls -l in the shell and explain every step of it with much details.

SYNOPSIS

The ls command lists the contents of your current working directory.

But there are many options that can be used with ls command to get the desired output. such as ls ~, ls /, ls ../, ls */, ls -a or ls -all, ls -rand ls -l. which is the topic of our article.

So let’s get straight to the topic ! Why do we need to use ls -l ?

We give an example to ls -l ..

this is exactly what happens when we type ls -l in the shell.

So we say that ls -l list with long format — show permissions of a working directory.

-l long format, displaying Unix file types, permissions, number of hard links, owner, group, size, last-modified date and filename.

Example: simple shell

1 Unix system calls fork( ) wait( ) exit( ). 2 How To Create New Processes? n Underlying mechanism -A process runs fork to create a child process -Parent.
  • shell is the parent process

E.g., bash

  • Parses command line

E.g.,” ls -l”

  • Invokes child process

fork, execvp

  • Waits for child

wait

Software engineer student