What makes Linux different from its contemporaries is that it operates with a terminal and commands. There is no bright colorful screen, no mouse pointer on the screen, and no icons (though you can get those if you want! )
So to talk to Linux and tell it what you want, you need to know commands that Linux understands. These commands can be called the language that Linux speaks and also the language you need to know to get your task done.
Let's get going with a few basic ones-
uname
- this shows you the name of your current Linux kernel (i.e the OS)
whoami
- it is exactly what it reads as. Tells you your login name or the name of the user you are logged in as.
pwd
- show the directory (folder) you are working in.
ls
- shows you the list of files and directories inside your current directory.
There are different ways to use this ls command. A few of them are
ls -l
- shows extra info about files and directories.
ls -a
- shows you the hidden files too.
ls *.sh
- show files with .sh extension.
cd path/to/directory
- change your current directory.
A few other ways to use cd are-
cd ~
or cd
- go to the home directory.
cd -
- go to the last working directory.
cd ..
- change the directory and go back one step.
cd ../..
- change the directory and go 2 steps back.
mkdir new_directory_name
- make a new directory in the current location.
A few other ways to use mkdir are-
mkdir .newdirectory
- create a hidden directory.
mkdir /path/to/directory
- make a directory at specified location.
mkdir A B C D
- make multiple directories at the same time.
mkdir A/B/C/D
- created nested directories (i.e. make a folder inside another folder) Here B is inside A, C inside B and D inside C.
If you find any of these confusing or don't understand what to use, worry not! Linux has commands to help you out. Linux itself is a guide on how to use it!
whatis command_name
- gives you short info on the command.
command_name --help
- gives you more detailed info on the command.
man command_name
- gives you a manual for the command that you type
These commands are enough to help you navigate through Linux. Go ahead and explore it. Get to know Linux and get familiar with it! We can then take a deep dive into the Linux world! Have fun learning!