Are you ready to take your Linux skills to the next level?
In this newsletter post, we’re going to go over the Linux command line (CLI).
The benefits of learning this tool are countless.
The Linux CLI or terminal, is a powerful tool that allows you to interact with your computer in a more direct way than using a graphical user interface (GUI). It may seem intimidating at first, but with a little bit of practice you will see why it is so powerful.
Think of it like driving stick shift vs automatic. With stick shift manual transmission, you are doing all the driving of the car, and the car won’t do anything you don’t make it do. Similarly, at the terminal, the computer won’t do any task unless you explicitly tell it what to do.
Here is an overview of commands you should get to know.
Command Help
ls list directory. Use to view what files are present
cd Change directory to [directory] you specify
hostname prints hostname of machine to standard out
pwd Print working directory to std input
mv Move a file from one location to another
whoami user name associated with the current effective user ID
One of the main tools I recommend to people to learn more is the man pages.
The command itself is "man" which brings up the manual for a given command. Almost like a built-in google search. For example, if you want to learn more about the "ls" command, you can type "man ls" and it will give you an explanation of all the options and arguments you can use with the command.
I go over this in my free Linux course.
If you’re more of an intermediate user:
Learn how to use redirection operators (">" and ">>") to redirect output, and append output to a file respectively.
Learn how to use pipes "|" which connects multiple commands together and uses the output of one command as the input of another.
Learn how to use basic regular expressions with grep to search for patterns in text. (For more on this, I have a post series on regex)
Final Thoughts
We learned some of the main commands to get going at the CLI and how to self navigate for help.
Hope this gives you a good introduction to the Linux command line. Remember to take it one step at a time and don't be afraid to experiment. With enough practice, you'll be a command line power user in no time.
Feel free to reach out with any questions or feedback.