Imagine you usually interact with your computer by pointing and clicking on icons—that’s the Graphical User Interface (GUI). The Command Line (or terminal) is like going behind the scenes to talk to the computer directly using text. It might seem intimidating, but it’s just a different way of “moving” through your digital house.
When you use a terminal, you are always “inside” a folder, which Linux calls a directory. Because there are no icons to show you where you are, you use these three basic tools:
pwd (Print Working Directory): This is the “Where am I?” command. It tells you exactly which folder you are currently standing in.ls (List): This is the “What’s in here?” command. It shows you all the files and folders in your current location.cd (Change Directory): This is the “Go there” command. You use it to move from one folder to another.To tell the computer where to go, you use a Path. Think of this as a set of directions.
/). No matter where you are, an absolute path always wos because it starts from the ground floor.~ (Tilde): A quick way to say “take me to my personal home folder”... (Dot-Dot): A way to say “go up one level” to the parent folder.Linux handles files a bit differently than Windows or Mac:
MyFile.txt and myfile.txt are two completely different things..jpg or .exe to know what a file is, Linux actually looks inside the file to figure out its type..myhiddenfile). To see these, you have to ask specifically using ls -a.Note: The following information is drawn from our conversation history and is not contained in the current Linux sources.
git add <filename> or git add * to prepare your changes to be saved.git commit -m "your message here" to save your staged changes into the project’s history.git push origin master (or the name of your branch) to upload your local saves to the online server.Analogy for Navigation:
Using the command line is like navigating a dark house with a flashlight. pwd tells you which room you’re in, ls is you shining the light around to see what’s on the floor, and cd is you walking through a door into the next room. You can’t see the whole house at once like you do with a GUI “map,” but you can move much faster once you know the layout!