Finding your way | Master AI Automation in 4 hours Master AI Automation in 4 hours Course About Ayush Modules Sample chapter Toolbox The Microcap Minute Classroom / Module 03: The Command Line / Chapter 2 Finding your way Watch first, then read. Same lesson, your pace. What you will learn – The folder tree: every computer’s true shape – pwd , ls , cd , knowing where you are, seeing where you can go, moving there – Absolute vs relative paths The tree Your computer’s files form a tree : one root (on Mac/Linux, / ; on Windows, C: ), branches called folders, leaves called files. Finder and File Explorer draw this tree as pictures. The terminal lets you walk it. Wherever you are in the tree, that spot is your working directory , the room you’re standing in. Every command you run happens “here” unless you say otherwise. Three commands that end getting lost forever 1. Where am I? pwd Print Working Directory. On a Mac you might see /Users/ayush . That slash-separated address is your exact position in the tree. 2. What’s here? ls Lists the contents of the current room. Add flags (dash-options that modify commands) for more detail: ls -l # long list: sizes, dates ls -a # all, including hidden files (dots matter!) 3. Move there. cd Downloads # into the Downloads subfolder cd .. # back up one level (“..”” always means parent) cd ~ # jump home (“~”” means home directory) cd / # jump to the root of the whole tree cd + Tab is love: type cd Dow then press Tab and the terminal completes the name. Tab-completion works on commands too. Use it always; typos become extinct. Paths: addresses in the tree A path is text describing a location: Absolute path , full address from the root: /Users/ayush/Downloads/AIForDummies . Works from anywhere, like a complete postal address. Relative path , directions from where you stand: Downloads/AIForDummies . Only correct from /Users/ayush . Both point at the same place; which to use depends on where you’re standing. Pro move: drag a folder from Finder/Explorer straight into the terminal window, its absolute path pastes itself. Put it together The walk of a professional: pwd # where am I? ls # what’s here? cd ai-workspace # enter my workspace ls # confirm: projects prompts outputs learn cd projects # descend pwd # prove it Thirty seconds, zero mice, total orientation. This rhythm, look, step, look, is how you’ll navigate for the rest of your life. And when lost: pwd first, panic never. Try it yourself Open a terminal. pwd . Then walk to your Desktop, list what’s there including hidden files, go up one level, and finally build the ai-workspace folders from Module 1 Chapter 5 by hand : mkdir ai-workspace , then mkdir ai-workspace/projects ai-workspace/prompts ai-workspace/outputs ai-workspace/learn (yes, mkdir makes many rooms at once). Verify with ls ai-workspace . You just built next chapter’s playground. Key takeaways – Files form a tree; the working directory is where you stand. – pwd locates you, ls surveys the room, cd moves you ( .. up, ~ home). – Absolute paths work everywhere; relative paths depend on position. – Tab-completion eliminates typos, use it religiously. Download the exercise sheet (PDF) Module workbook (PDF) โ Prev: The magic window Next: Making and moving things โ Classroom / Module 03: The Command Line / Chapter 2 Finding your way What you will learn – The folder tree: every computer’s true shape – pwd , ls , cd , knowing where you are, seeing where you can go, moving there – Absolute vs relative paths The tree Your computer’s files form a tree : one root (on Mac/Linux, / ; on Windows, C: ), branches called folders, leaves called files. Finder and File Explorer draw this tree as pictures. The terminal lets you walk it. Wherever you are in the tree, that spot is your working directory , the room you’re standing in. Every command you run happens “here” unless you say otherwise. Three commands that end getting lost forever 1. Where am I? pwd Print Working Directory. On a Mac you might see /Us
Finding your way
Written by
in