Linux is widely used operating system in the world. Linux is actually a kernel not a operating system but other operating systems that are based on Linux are knows as Linux distributions. There are three Linux families:
- Debian
- Red Hat Linux
- Cent OS
In this tutorial, we will use Debian based linux distribution to practice linux commands. We will use these commands on debain family and distributions include Ubuntu, Kali Linux, Linux Mint etc. So, without wasting time, let's dive into linux commands.
Linux Commands on BASH
We will discuss following topics in this blog
- Booting up Linux
- Linux File System
- Basic Linux Commands
- Finding Files in Linux
- Managing Services in Linux
- Searching, Installing and Updating tools in Linux
Booting up Linux
Booting up linux includes start linux os in live mode either or full install mode. As we boot up Windows, same as we have to boot up linux. The default password for Ubuntu is root and password is either blank or toor. Booting up means waking up system from sleep state. On fresh install, you must change your linux password using command below:
Linux File System:
Linux file system is not like Windows file system. It has its own tree like structure in which root directory is the parent directory. The details of directories are given below:
- / (root) directory - parent of all directories
- / home - inside root
- /bin - contains binary files and basic programs like ls, cat
- /sbin - contains system programs (fdisk, sysctl etc.)
- /etc - configuration files
- /tmp - temporary files
- /usr/bin - contains user specific programs
- /usr/share - application support and data files
Basic Linux Commands
man
We can also perform keyword search with man command using -k option to search for specific keyword as below:
The above command is showing details in description where man ls keyword is listed. But we cannot go through this obviously one by one to find our search. We can narrow our search by using regular expressions as below:
Above,we find that now our search has shown command ls and we can read manual of it by using man 1 ls as below:
After entering this command, following manaul will be shown:
apropos
apropos is another same command that will perform same search as of man -k. Its search is based on keyword and when we supply following command apropos systemctl, it shows following result:
Listing Files
The ls command is used to list all files in a directory. We can view both hidden and unhidden files with it. The -a option lists all files including hidden and -l option will print out all files details. Sample is given below:
Navigating Directory
Linux does not use Windows like GUI. Using terminal we will use cd command to change and navigate directory and use cd ~ to return to home directory and use cd .. to return back. As a demonstration example is given below: