As a Web Developer, it doesn't matter if you are a generalist or a specialist, one way or the other you will find yourself working with a server and most of today’s servers run on Linux.
Linux can be intimidating for beginners, especially when you transition from a colorful GUI-based system where everything was, more or less, done with one click to a black screen with a blinking line staring at you. When I started working with Linux, truth be told I felt lost. Where to begin? Where am I? What to do? How to do it? These were some of the questions that popped into my mind while looking at that blinking white line.
Drawing inspiration from answering these questions and hope that this will be helpful to other developers who find themselves in the same spot, I have prepared 5 commands that in my opinion every Web Developer should know. These commands will help you navigate the Linux file system, find the right commands for your task and understand their functionalities, making your journey into Linux more manageable.
Commands
pwd - print working directory
If you are lost, the first thing you want to know is where you are. By entering pwd
into the terminal, as an output we get the full pathname of the current directory we are in.
ls - list
Okay, we now know where we are, next thing to know is what is around us. By entering ls
into the terminal we get a list of directories and files that are in the working directory.
cd - change directory
Now that we know where we are and what is around us it is useful to know how to move around. Change directory command allows us just that. By entering cd <dir-path>
we move to the desired directory. Let’s say we want to move to the Downloads directory. By entering cd Downloads
we go from /home/username to /home/username/Downloads. To double check this we can use the previously learned command pwd
.
apropos
As we said in the beginning, there are a lot of commands that you need to remember when working with Linux and as someone who just started that can look scary. This command makes that burden a little easier to bear. If you have a general idea what you want to do but don’t know the exact command, apropos
can help you search for it.
man - manual
Cool, we can find what command to use for our desired action. Now we want to learn more about it, what it does, what options does it support. By entering man <name-of-the-command>
, we get a manual for the desired command with all of the necessary information. The command I was looking for was mkdir, so I will read more about it by entering command man mkdir
.
Summary
In this blog we went over 5 Linux commands that in my opinion every Web Developer that has just started with Linux should know. We didn’t go over the options that each of the commands provides because I wanted to keep this as simple as possible but I do encourage you the reader to use the man
command and go over some of the options for these commands and try them out.
By knowing these 5 commands, the developer is able to find his way around the server, research and build upon their knowledge of existing commands without leaving the terminal. Naturally not everything can be learned from the terminal so I do advise that you learn more by browsing the web, reading more about the topic you want and most important of all, applying what you have learned.
I hope you found this article helpful, wish you all the best and until the next one.
Top comments (2)
Nice post, keep them coming!
Great read! It's always valuable to revisit the basics. Looking forward to reading more of your work.