Linux Gate #2 : Where to begin ?!

 

No alt text provided for this image

Hello there! This article is the third article of our Linux series we call it the Linux Gates.

In this article we are going to start learning the basic Linux commands to starts off!

If you are wondering from the previous articles how to start off in the Linux journey, and where to begin? The answer of that is that we are starting off and your are welcome aboard.

The first command you want to learn is the "ls" command. This command works like this; you call "ls" in the black screen .AKA. terminal and it will show you the content of your working directory !

What is a directory ? in simple words it's a folder ! in Linux we have two entities : folders and files ! that's all.

You would think that this is not enough to build something interesting ! wouldn't you ? you think it's just files and directories; i mean what can it do that is interesting ?

Your question is definitely authentic and e will answer this later in the next articles when the time is right ! by the way, the answer might surprise you ! so just keep that in mind.

Here is an example of the command ls :

No alt text provided for this image

In the previous example : ls shows multiples contents that are in total 3 folders, two files and one image. You can distinguish between the types of those contents by there colors.

If you are wondering is an image a file or not !? the answer is definitely yes. We will come back to this later as promised !

Now let's see another use of the command "ls" : the command ls -a where "-a" is an interesting option.

No alt text provided for this image

When the option "-a" is added, you can now that in addition to the previous content, now we have some hidden things that appear.

Hidden files and directories are the content that we don't want many people to get into. Usually, it contains important set ups that we don't want to be accessible by many hands !!

The two previous commands are exactly the same if we put the path in front of or before the option, meaning that : ls -a ./ : is looking for hidden and normal contents in the current working directory. It's exactly equivalent to just typing : ls -a.

Now let's see another interesting option of this command : ls -R.

The "-R" option now we added can allow to show the content present starting from the current working directory and deep through all the directories and there sub-directories until the end !

Here is an example :

No alt text provided for this image

Now if you only want to list specific file in your current working directory, you can use one of the most used symbols in Linux that is the asterisk *.

The asterisk in Linux allows to replace what we don't know and let Linux completes from the data it has by itself!

Here is an example that can clarify the previous philosophical explanation we came up with :

ls *pdf : allows you to list all pdf files in your current working directory. the asterisks stands from something and ls *pdf can be read as : list me all the content that has the following form : something + pdf.

The something is the asterisk again. The "where" we want to look into can then be put in front of the *pdf as in the example below :

No alt text provided for this image

And with these examples you've learned everything useful there is about the ls command.

Now let's see another simple command : the "pwd" command.

This command is the most simple command you will ever encounter when working with the terminal. "pwd" allows you to show where you currently are.

It will show you in which directory your terminal is, and how you did get in there, what directory you entered to find yourself where you are.

With Linux Language we call this location in the system from the directories as PATH. Let's see the example below :

No alt text provided for this image

So the result is that our terminal executes commands from the outofbox-GATES directory. In order to get there we entered the /home directory then users directory then outofbox-GATES.

Alright, these two commands are going to stick with us during all the next articles, and we are going to build upon them the language at the end.

Remember this is our aim ! learning to talk Linux rather than just remembering individual commands.

Hope you enjoyed this basic Linux command article !

See you with the next article.

Sheers !

Comments

Read Also

Linux Gate #0 : Is Linux terminal that scary ?

Linux Gate #5: How to increase your work efficiency by the use of programs?