ls
Unix basics
Commands
List files
ls, used alone, will print the contents of the current directory. If it is followed by a path to a directory, will print its contents.
Options (letters or words preceded by “-” or “–”, respectively) will change how and what is printed.
ls -aorls --all- Will print all contents of the working directory, including hidden files (which start with a dot, eg. .ssh).
ls -alhs Desktoporls --all -l --sort --human Desktop- Will print all the contents (
-aor--allincluding hidden files) in the form of a list (-l) that includes the permissions of each file, their owners, the date of the last modification and their size in human format (-hor--human; 4Kb instead of 4000b) and sort them alphabetically (-sor--sort; other options can be used to change how to sort the files).
- Will print all the contents (
To know other options for ls, run man ls or ls --help