ls: Lists directory contents
August 7th, 2024 10:04 PM Mr. Q Categories: Command
Lists directory contents
Command: ls
This is one of the first commands new users learn.
Sample Command and Output:
$ ls -l
total 8
drwxr-xr-x 2 user user 4096 Aug 7 12:34 folder1
drwxr-xr-x 3 user user 4096 Aug 7 12:34 folder2
Lists directory contents
Command: ls -a
This option lists all entries, including those starting with a dot.
Sample Command and Output:
$ ls -a
. .. .hiddenfile folder1 folder2
Lists directory contents
Command: ls -lh
This option lists files in long format with human-readable file sizes.
Sample Command and Output:
$ ls -lh
total 8.0K
drwxr-xr-x 2 user user 4.0K Aug 7 12:34 folder1
drwxr-xr-x 3 user user 4.0K Aug 7 12:34 folder2