Use `ls` when you want to see what is in a folder without opening it in Finder. It stands for “list” and shows the files and folders in your current directory. For example, in your Mac home directory, you might see Documents, Downloads, and Pictures. section 1.7.2
Add options when you need a different view:
- `ls -1p` puts one item on each line and adds a slash after folder names. These options change the display, not what is in the folder. section 1.7.2
- `ls -la` combines two options: `-l` shows details such as permissions, owner, size, and date; `-a` includes hidden names that begin with a dot. section 1.7.2
total 0 drwxr-x---+ 15 yourname staff 480 Feb 10 09:32 . drwxr-xr-x 5 root wheel 160 Jan 5 14:20 .. drwx------ 4 yourname staff 128 Feb 8 11:15 .Trash drwx------+ 5 yourname staff 160 Feb 10 09:32 Desktop drwx------+ 8 yourname staff 256 Feb 9 14:22 Documents drwx------+ 3 yourname staff 96 Feb 7 10:00 Downloads ...
In this `ls -la` listing, `.Trash` is a hidden folder. The entries `.` and `..` mean the current directory and its parent; they are navigation shortcuts, not hidden files. section 1.7.2
When you press Enter after typing `ls`, the terminal passes the command to the shell. The shell finds the `ls` program through `PATH`; the program reads the current directory, and the terminal displays its result. Use `pwd` to check where you are and `cd` to change directories before listing another folder. section 1.7.5 section 1.9
