Bash and the Command Line · Lesson 1 of 5
Getting your bearings
Move around a machine without a mouse.
The terminal is not a test of memory. It is six commands you use constantly and a way of looking the rest up.
Where am I, what is here, go there. pwd prints the current directory. ls lists what is in it, and ls with the long and all flags shows permissions, sizes, dates and hidden files, which is what you usually want. cd changes directory. Three shortcuts save most of the typing: a single dot is here, two dots is the parent, and a tilde is your home directory. cd with nothing goes home.
Absolute and relative paths. A path starting with a slash is from the root of the filesystem and means the same thing from anywhere. Anything else is relative to where you are standing. Most confusion in the first week is standing somewhere other than you think, which pwd settles instantly.
Tab completion is the whole skill. Type the first few letters and press Tab. It completes, and pressing it twice shows the options. People who find the terminal slow are usually typing full paths by hand. Nobody does that.
History. The up arrow walks back through what you ran. Ctrl+R searches it, which is how you find the long command you ran last Tuesday.
Reading the manual. man followed by a command, or the command with a help flag, is faster than searching the web for the flag you half remember.
Finally, learn Ctrl+C to stop a running command and q to leave a pager. Being stuck inside something with no exit is what makes beginners nervous.
With no mouse, move to a project folder, list everything including hidden files, and return home using a shortcut. Use Tab for every path.
ماؤس کے بغیر کسی پروجیکٹ فولڈر میں جائیں، پوشیدہ فائلوں سمیت سب کچھ دیکھیں، اور شارٹ کٹ سے گھر واپس آئیں۔ ہر راستے کے لیے Tab استعمال کریں۔
Check what you learned
Create your free BvLogic ID to take the quiz and record your score.
Create your BvLogic ID