ls

ls lists the contents of a directory.

By default, it prints the content of the current directory, except the files or the directories that starts with . (including . and ..).

Files starting by . are so-called hidden files.

By default, ls sort the files by alphabetical order.

# print the current directory
ls
# prin the toto directory
ls toto
ls options meaning
-a do not ignore entries starting with .
-l long listing format
-1 one column format
-t sort by date
-r reverse sorting
-S sort by file size, largest first

name expansion

ls and more generally the bash commands use special characters to extend file names.

special character for ls meaning
* any character or set of characters
? 1 character
[abc] character a, b, or c
[a-z] character between a and z
[A-Za-z0-9] alphanumerical character
{a,b} a then b