Originally published on: blog.theenthusiast.dev
Imagine this: You’ve been using your computer for a while, and your Documents folder has become a catch-all for every file you’ve saved. You want to bring some order to this chaos, create a structure for your projects, and set up a system for personal files. Doing this with a mouse seems tedious. There must be a faster, more efficient way, right?
Enter the terminal –> your new friend for doing things faster. Before we start organizing, we need to learn how to navigate our digital space efficiently. This is where the power of the terminal really shines.
Think of the terminal as a way to chat with the computer.
Instead of painfully clicking through folders, we can just ask the computer through the terminal to do exactly what we want.
The advantages are huge:
- Its often faster than using a mouse for many tasks
- It allows you to perform powerful operations not possible with normal clicking and dragging.
Let’s start our organizational journey by opening the terminal:
- On Ubuntu: Press Ctrl + Alt + T
- On Mac: Press Cmd + Space, type “Terminal”, press Enter
- On other Linux systems: Look for “Terminal” in your applications menu
When you open it, you’ll see something like this:
There are 2 lines:
- First one is printing my last login time or using time
- The second line is important, it prints my username and my system’s name in this format :
username@computername:~$
This is your computer’s way of saying, “I’m ready. What would you like me to do?”
Where am I? (pwd
)
Before doing anything let’s check where we are right now:
pwd
pwd
stands for “Print Working Directory”. This command shows you the full path of the directory (folder) you’re currently in.
For me, it’s looking like this:
It’ll print something similar to this. Instead of my username, you’ll see your username.
This is your home directory, where we’ll start our organization.
What’s here? (ls
)
Ok, we’ve understood where we are, but now let’s find out what’s in this directory (folder)
Think of it like relocating a new place, first you understood where you are, now you need to see what’s the place has.
Type:
ls
This will list all the files and folders in your current location.
For me, it shows something like this:
Damn, I have too much garbage in here, you might see less things or you might have a lot of garbage like me.
You should see several folders, including Documents. We’ll be working with this folder.
Moving into a folder (cd
)
Let’s move into the Documents folder:
cd Documents
cd
stands for “change directory”. This command moves you into the specified folder.
This is how it looks for me:
Checking our new location (pwd)
Let’s confirm where we are now:
pwd
For me, its showing something like this:
I have moved from my home directory to Documents directory, if you have followed along then you’ll see the same thing.
What’s in Documents? (ls
)
Let’s see what’s in the Documents folder:
ls
This will show you all the files and folders that have been piling up in your Documents folder.
For me, its something like this:
Now that we’re in the Documents folder and can see its contents, let’s start creating some order.
Creating new folders (mkdir
)
Let’s create two new folders to separate our projects and personal files:
mkdir Projects
mkdir Personal
mkdir
stands for “make directory”. This command creates a new folder with the name you specify.
Verifying our new folders (ls
)
Let’s check if our new folders were created:
ls
You should now see Projects and Personal listed, along with your existing files and folders.
For me, its something like this:
I have too many folders but you can see we have successfully created “Personal” and “Projects” folder.
Now that we have our basic structure, let’s practice moving around.
Moving into a subfolder (cd
)
Let’s move into the Projects folder:
cd Projects
Checking our location (pwd
)
Confirm where we are:
pwd
This is how it looks for me:
Going back up (cd ..
)
To get back to the parent folder (Documents in this case):
cd ..
cd ..
moves you up one level in the directory structure.
Returning home (cd
)
To go back to your home directory from anywhere:
cd
cd
without any arguments takes you back to your home directory.
Try this short mission to practice what you’ve learned:
- Open the terminal
- Navigate to your Documents folder
- Create a new folder called “Hobbies”
- Move into the Hobbies folder
- Check your current location
- Move back to the Documents folder
- List the contents to verify your new folder is there
- Return to your home directory
Remember, every master was once a beginner. Don’t be afraid to experiment – that’s how you learn and grow your skills!
You’ve just taken your first steps into a larger world. How about we celebrate this milestone together?
If you’ve completed the practice mission (and even if you’re still working on it), why not share your progress? It’s a great way to track your learning journey and might even inspire others to start their own terminal adventure!
Here’s what you can do:
- Take a screenshot of your terminal showing off your new skills
- Post it on Twitter or LinkedIn
- Tag me (@introvertedbot on Twitter)
I’ll be keeping an eye out to give you a well-deserved shoutout. Plus, who knows? Your post might just encourage another future terminal wizard to take the plunge!
Remember, every command you type is a step towards mastering the terminal. Let’s celebrate each step together!
In our next lesson, we’ll learn how to move your existing files into this new organizational structure we’ve created. We’ll bring order to that digital chaos, all from the command line! Stay tuned, and keep practicing those navigation skills!
Source link
lol