ls Linux Commands
What is Linux ls Command?
Explanation
ls COMMAND:ls command lists the files and directories under current working directory.
SYNTAX :
ls [OPTIONS]... [FILE]
OPTIONS:
-l |
Lists all the files, directories and their mode, Number of links,
owner of the file, file size, Modified date and time and filename. |
-t |
Lists in order of last modification time. |
-a |
Lists all entries including hidden files. |
-d |
Lists directory files instead of contents. |
-p |
Puts slash at the end of each directories. |
-u |
List in order of last access time. |
-i |
Display inode information. |
-ltr |
List files order by date. |
-lSr |
List files order by file size. |
EXAMPLE:
- Display root directory contents:
ls /
lists the contents of root directory.
- Display hidden files and directories:
ls -a
lists all entries including hidden files and directories.
- Display inode information:
ls -i
7373073 book.gif
7373074 clock.gif
7373082 globe.gif
7373078 pencil.gif
7373080 child.gif
7373081 email.gif
7373076 indigo.gif
The above command displays filename with inode value.