Learn basic commands of Linux

Learn basic commands of Linux
Learn basic commands of Linux, a free and open-source operating system that you can make changes to and redistribute.
What Is Linux?
Linux is an operating system’s kernel. You might have heard of UNIX. Well, Linux is a UNIX clone. But it was actually created by Linus Torvalds from Scratch the Linux kernel and distributed its first version, 0.01, in 1991. Linux is free and open-source, that means that you can simply change anything in Linux and redistribute it in your own name! There are several Linux Distributions, commonly called “distros”.
- Ubuntu Linux
- Red Hat Enterprise Linux
- Linux Mint
- Debian
- Fedora
Linux is Mainly used in servers. About 90% of the internet is powered by Linux servers. This is because Linux is fast, secure, and free (open source). The main problem of using Windows servers are their cost. The OS that runs in about 80% of the smartphones in the world, Android, is also made from the Linux kernel. Most of the viruses in the world run on Windows, but not on Linux!
Linux features
- Open source
- Secure
- Simplified updates for all installed software
- Light weight
- Multiuser – multi task
- Multiple distribution like: Red Hat, Debian, Fedora etc.
Linux Shell or “Terminal”
A shell is a program that receives commands from the user and gives it to the Operating system to process, and it shows the output. Linux’s shell is its main part. Its distros come in GUI (graphical user interface), but Linux has a CLI (command line interface). In this article, we are going to cover the basic commands that we use in the shell of Linux.
- To open the terminal, press Ctrl+Alt+T in Ubuntu or Kali
Basic Commands of Linux
-
Command_name –help
Most commands have a –help
option, which prints a short message about how to use the command and other mandatory arguments. Like: ls –help
-
The man command
Almost all Linux commands are distributed together with man pages. A man or manual page is a form of documentation that explains what the command does, examples of how you run the command, and what arguments it accepts. The man command is used to display the manual page of a given command. Example man ls
To navigate the man pages, use the Arrow, Page Up, and Page Down keys or scroll the mouse . You can also press the Enter key to move one line at a time, the Space bar to move to the next screen, and the b key to go one screen back. To exit the man page, press the q key.
Current Working Directory pwd command
-
pwd
:
This command displays the path of your current working directory.
When you first open the terminal, you are in the home directory of your user. To know which directory you are in, you can use the pwd
command. It gives us the absolute path, which means the path that starts from the root. The root is the base of the Linux file system. It is denoted by a forward slash( / ). The user directory is usually something like "/home/username"
.
-
Listing Contents of Directory
ls command
The ls
command lists information about files and directories of the current working directory. It displays a list in alphabetical order of the names of all files in the current directory. You can list files in a specific directory, pass the path to the directory as an argument. Like: ls /usr
- Use
ls --help
command will list all commands related to ls command. - Use
ls -a
command to display all files including hidden files. - Use
ls -R
command will list all the files in the sub-directories as well - Use
ls -al
command will list the files and directories with detailed information like the permissions, size, owner, etc.
Working with directory
5. Changing directory cd command
cd
command: Use the cd command to go to a directory. For example, if you are in the home directory, and you want to go to the downloads directory, then use cd Downloads. Remember, this command is case sensitive, and you have to type in the name of the folder exactly as it is. But there is a problem with these commands. Imagine you have a folder named “yam guru”
. In this case, use cd 'yam guru'
.
cd
go to the home directorycd Downloads
go to the Downloads directorycd Downloads/Music
“absolute path” to go to the specific directoryd ..
back to home directory
6. Creating a directory mkdir command
Use the mkdir
command to create a directory. For example, if you want to make a directory called files, then use mkdir files
. Remember, as told before, if you want to create a directory named "my files”
, then use mkdir 'my files'
. You can create multiple directories at once. Use mkdir apple ball cat
.
mkdir files
to create normal directorymkdir .kitcat
to create hidden directory
7. Rename a directory mv command
Use the mv
command to rename and move a directory. For example, if you want to rename a directory called apple to fruit, then use mv apple fruit
it will be renamed to fruit. If you want to move directory one path to another then use mv files myfiles
.
mv apple fruit
rename apple directory to fruitmv files myfiles move
files inside myfiles
8. Delete a directory rmdir
command
Use rmdir directory_name
to delete a directory. Remember rmdir
can only be used to delete an empty directory. For example you want to delete a directory called cat, then use rmdir cat
. To delete a directory containing files and other directory, use rm -r directory_name
.
Appreciating the hard work you put into your website and detailed information you offer.
It’s good to come across a blog every once in a while that isn’t the same out of date rehashed information. Great read!
I’ve saved your site and I’m including your RSS feeds to
my Google account.
This text is invaluable. When can I find out more?
My website – Online casino korean
If you are going for best contents like myself, only go to see this website daily because it presents quality contents, thanks
Here is my website … Augustus
Hi! I could have sworn I’ve visited this web site before but after looking at a few
of the posts I realized it’s new to me. Anyways,
I’m definitely happy I came across it and I’ll be book-marking it and checking back frequently!
Wow that was unusual. I just wrote an really long
comment but after I clicked submit my comment didn’t show up.
Grrrr… well I’m not writing all that over again.
Regardless, just wanted to say superb blog!
You really make it seem so easy with your presentation but I find this topic to be really something
that I think I would never understand. It seems too complicated and extremely broad for me.
I am looking forward for your next post, I’ll try to get the hang of it!
Hey I know this is off topic but I was wondering if you knew of any widgets I could
add to my blog that automatically tweet my newest twitter
updates. I’ve been looking for a plug-in like this for quite some time and was hoping maybe you would have
some experience with something like this.
Please let me know if you run into anything. I truly enjoy reading your blog and I look forward to your
new updates.
There is certainly a lot to learn about this issue. I love all the
points you’ve made.
My spouse and I stumbled over here from a different website and thought I might check things out.
I like what I see so now i’m following you.
Look forward to finding out about your web page again.
I don’t even know how I ended up here, but I thought this post was good.
I do not know who you are but definitely you are going to a famous blogger if you are not already 😉 Cheers!
Visit my homepage :: 먹튀검증
What’s up, for all time i used to check weblog posts here in the early hours in the
break of day, because i enjoy to gain knowledge of more and more.
Wow, wonderful weblog format! How lengthy have you ever been running a blog for?
you made running a blog look easy. The entire look of your
website is magnificent, as smartly as the content
material!
Heya i’m for the first time here. I found this board
and I find It really useful & it helped me out much.
I hope to give something back and aid others like you aided me.
Thanks designed for sharing such a good thinking, paragraph is nice, thats why i have read it completely