░░░░░░░░░░▒▒▒▒▒▒▒▒▒▒▒▒░░░░░░░░░░
░░░░░░████▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒░░░░░░
░░░░██████▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒░░░░
░░██████████▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒░░
░░██████████▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒░░
▒▒▒▒▒▒████████▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒
▒▒▒▒▒▒▒▒▒▒████████▒▒▒▒▒▒▒▒▒▒▒▒▒▒
▒▒▒▒▒▒▒▒▒▒▒▒██▒▒▒▒██▒▒▒▒▒▒▒▒▒▒▒▒
▒▒▒▒▒▒▒▒▒▒▒▒██▒▒▒▒██▒▒▒▒▒▒▒▒▒▒▒▒
▒▒▒▒▒▒▒▒▒▒▒▒▒▒████████▒▒▒▒▒▒▒▒▒▒
▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒████████▒▒▒▒▒▒
░░▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒██████████░░
░░▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒██████████░░
░░░░▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒██████░░░░
░░░░░░▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒████░░░░░░
░░░░░░░░░░▒▒▒▒▒▒▒▒▒▒▒▒░░░░░░░░░░

ls

ls shows the files and directories in the current or specified directory.

Usage

Type ls in a terminal and it will print the names of the files and directories in the current directory.

bash $ ls Desktop Music Templates Documents Pictures Videos Downloads Public

To see the files and directories of a specific folder, use ls with a folder as a parameter.

bash $ ls Pictures background.png test.png

If perhaps you want to see everything in a directory (even hidden folders) you can use the -a parameter.

bash $ ls -a . .bashrc Downloads Public .. Desktop Music Templates .bash_profile Documents Pictures Videos

Long listing will show you more information about the files in a directory.

bash $ ls -l drwxr-xr-x 2 user user 4096 12 feb 12:14 Desktop drwxr-xr-x 6 user user 4096 4 apr 09:58 Documents drwxr-xr-x 13 user user 20480 18 apr 13:40 Downloads drwxr-xr-x 7 user user 4096 16 apr 11:24 Music drwxr-xr-x 7 user user 4096 20 mrt 15:59 Pictures drwxr-xr-x 2 user user 4096 26 aug 2018 Public drwxr-xr-x 2 user user 4096 26 aug 2018 Templates drwxr-xr-x 3 user user 4096 20 mrt 16:43 Videos

CC BY-SA 4.0