Table of Contents

Linux - ls (List directory content)

About

ls is a Linux Command utility that lists the contents of a directory

Example

Basic

ls -alt

How to monitor a directory for file changes?

cd /your/Directory/Path
while :; do ls -A1; sleep 1; clear; done;

This script will:

Syntax

ls [option] [file}

Options

long format (l)

The -l option lists files and directories as a table with the following structure:

order (t)

The -t option orders files and directories by the time they were last modified.

hidden files and directory (a)

include hidden files and directories

Only file name

ls -A1