Linux Command line basics
Hey, guys today this blog is about the Linux command line basics | basics Linux command that everyone should know.
But before getting your hands on Linux you need a basic understanding of Linux like its history and how it's different from other systems. And then we will be looking into some of its basic commands.
Requirements:-
Nothing, just the will to learn and gain knowledge.
List of contents:-
- History about Linux.
- Some basics command of Linux
If you are following along with the blog & you need hands-on experience on Linux you can install any Linux-based operating system(we will look deeper) or you can use the phone application termux if you want to.
1) History of Linux
Linux is a family of open-source Unix-like operating systems based on the Linux kernel, an operating system kernel first released on September 17, 1991, by Linus Torvalds. Linux is typically packaged in a Linux distribution.
Linux is originally a kernel there are several operating systems based on it so technical Linux is a kernel some of the Linux-based operating systems are (Debian, Arch, Ubuntu, Kali, Manjaro), etc...
This Linux-based operating system comes with both GUI (Graphical User Interface) and CLI ( Command Line interface) But if you want to get your hands dirty on Linux or you want to learn the Linux you need to use the CLI because we can say it as the heart of the Linux. Without it, many Linux users can't even imagine Linux.
I am not going to show you how to install Linux on your system there are plenty of tutorials present on the internet you can follow along with them and install it on your system or virtual machine.
Basic Commands of Linux
Again if you are following along with me then open the terminal in your operating system..
1) ls Command
The ls command is used to print the list of the items in the directory. when no path is specified it prints the content of the current working directory.
This is not it by default it does not shows any information about the files or the permissions there are several parameters you can give to the ls command like ls --help or man ls this will show the help or the man page for the command you can check this for every command which is going to be shown in the blog.
Some parameters you can pass to the ls command are
- ls -l (for long listing format)
- ls -a to show all the hidden files in the directory also
- you can also combine both the parameter ( ls -la -- To show all the files in the long listing format) in Linux the hidden files are started with a period ( . )
As you can notice above that it has some more information just than the simple ls command and it also consists of 1 more file named user.txt we weren't able to say that in the simple ls command because it was hidden as you can see it has a period before it... There are several arguments you can pass to the ls command these are just 2 of them I would recommend exploring them by yourself.
2) mkdir Command
mkdir command is used to make a directory as its name suggests.. you just have to write the mkdir command and write the directory name you want to make.
As you can see in the above example there is a directory named test/ and also you can verify that's a directory at the start of the line ' d ' it denotes that is a directory.
3) touch Command
The touch command is similar to the mkdir command the mkdir command is used to make a directory on the other hand the touch command is used to create a file.
The syntax is also the same touch file-name
As you can see in the above example there is a new file generated named
touch-command.txt... you can also write the files using some command-line editors vim or nano or you can also use some gui-based apps. That's for another blog.
4) cat Command
The cat command stands for concatenating it gives the content inside the file or the text that is inside the file
As you can see there was a file named blog.txt by using the cat command we can get the content inside the file
5) rm Command
Last but not least the rm command is used to remove the file or directory...
As you can see in the above example first we have a file named blog.txt but after using the command rm blog.txt The file got deleted ( Note that when you delete the file or folder from the terminal the file is gone forever you can't restore them & they are not saved in the trash or something you can use the trash for the terminal but in the default case, it's not the thing. )
To remove a folder you can also use the rm command just rm -rf folder-name or you can use the other command rmdir which is especially for the directory removal
Bonus ( Some bonus commands to study on your own )
- pwd
- cp
- mv
- locate
- grep
- head
- less
- history
- sudo
- ifconfig
You have to study the above command on your own to get hands-on with it
Conclusion:- To get your hands on Linux or to master Linux you first have to use Linux...
From this blog, we have learned 5 basic Linux commands, more hands-on commands, and some other stuff related to Linux...