Manipulating Commands
The Unix shell can make your command time more productive in a slew of different ways. The shell can keep track of the commands you’ve run, help you fix typos you’ve made, and even let you create entirely new commands with ease.
The Master List of Commands and Programs
Want to see a list of every Unix command Terminal knows about—its master vocabulary of magic words? (Well, read on anyway.)
At the prompt, press the Tab key (you may need to press it twice). Terminal asks if you want really want to display all 983 possibilities (your number of commands may be different) and asks you to type y (for yes) or n (for no). If you type y, Terminal displays a list of every executable program on your computer—hundreds and hundreds of them, most of which explain themselves when you use the man command ( Section 15.9.1).
Create a List of All Your Files
Really, all of them. Every single one, in one list, with just one command in Terminal. This way, if you’re on the hunt for a particular file, you don’t have to search until you’re blue in the face. It’s the ultimate in one-stop viewing.
Navigate to your Home folder in Terminal (type cd and press Enter if you’re not already there), then type:
ls -RF
The -R flag drills down into all subfolders. The -F flag, meanwhile, writes a trailing slash (/) after folders, and a trailing asterisk (*) after programs, to make it easy to see what kind of files you have at a glance.
Note
This list can be very, very long. If you have lots of files, ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access