Linux Basic Commands

In this tutorial, we are going to cover the few basic commands that will help you to understand through Linux as a newbie. These commands and examples are frequently used with the command line.

To become an expert in Linux first step for a beginner would be to start learning the basic commands.

1. Shell

What is the shell ? To learn basic commands we need to be understood the "Shell". A shell is a program that receives commands from the user from the keyboard and sends them to the Operating System to process. In GUI, you’ve probably seen programs such as “Terminal” or “Console” these are just programs that launch a shell.

In this tutorial, we will use the shell program bash (Bourne Again shell), almost all Linux distributions will default to the bash shell. There are other shells available such as ksh, zsh, tsch, but we won’t get into any of those.

user@linuxyogi:current_directory
user@linuxyogi:/home/user $

Different shells will have different prompts, in our case the $ is for a normal user using Bash, Bourne or Korn shell.

2. pwd (Print Working Directory)

The Linux directory structure is just like a tree. The first directory in the filesystem is aptly named the "root" directory or you can say the base of the filesystem hierarchy begins at the root. The root directory has many folders and files in which you can store more folders and files, etc. Here is an example of what the directory tree looks like.

In below example working directory of the user is /home/yogi

[yogi@linuxyogi ~]$ pwd
/home/yogi

3. Hostname

In below example hostname is "linuxyogi".

[yogi@linuxyogi ~]$ hostname
linuxyogi