E-mail : support@tech2now.in

ls Linux command

Linux Linux command ls pwd cp mv more grep tail

The ls command is used in Unix/Linux operating systems. ls use to list the files and directories in a given directory.

Below are the example

List files and directories in the current directory

$ls

List files and directories in a specific directory

$ls /path/to/directory

List files and directories with additional details (permissions, size, owner, etc.)

$ls -l

List files and directories in a human-readable format (with file sizes in kilobytes, megabytes, etc.)

$ls -lh

List all files and directories, including hidden ones (starting with a dot)

$ls -a

Sort files and directories by modification time, with the most recent first

$ls -lt

Reverse the order of the sorted list (oldest first)

$ls -ltr

List only directories

$ls -d */

O/P
cloud/ kicklinux/

List files and directories recursively (including subdirectories)

$ls -R

list files and directories in a specific directory, sorted by modification time, with additional details

ls -lt /path/to/directory