The ls command is used to list files or directories in Linux and other Unix-based operating systems. Just like you navigate in your File explorer or Finder with a GUI, the ls command allows you to list all files or directories in the current directory by default, and further interact with them via the command line.
What does Ls do in command line?
The ls command is a command-line utility for listing the contents of a directory or directories given to it via standard input. It writes results to standard output. The ls command supports showing a variety of information about files, sorting on a range of options and recursive listing.
How use ls command in Linux?
Some practical examples of ls command are shown below.
- Open Last Edited File Using ls -t. …
- Display One File Per Line Using ls -1.
- Display All Information About Files/Directories Using ls -l. …
- Display File Size in Human Readable Format Using ls -lh. …
- Display Directory Information Using ls -ld.
18 февр. 2021 г.