Introduction to basic Linux commands

Introduction to basic Linux commands

What happens when you start a computer?

When the computer is turned on, it first performs the power-on-self-test, also known as POST. If the POST is successful and no issues are found, the bootstrap loader will load the operating system for the computer into memory.

Operating System:

An Operating System is an interface between a computer user and computer hardware. It is a software which performs all the basic tasks like:

  • file management,
  • memory management,
  • process management,
  • handling input and output

Linux OS

First of all, Linux is not an OS. It's is a kernel. So, when we say Linux OS this means that the OS has Linux as it's kernel.

Why use Linux?

  • Linux Is Free
  • Open source
  • Can Run in Almost Anywhere
  • Developer Friendly

Some of the famous Linux distros are:

  • Fedora
  • Ubuntu
  • Arch Linux
  • Debian

Terminal (or Console)

It is basically a text input-output environment.

Shell

The shell is the Linux command line interpreter. It provides an interface between the user and the kernel and executes programs called commands.

Shell format

shell format.png

Meaning of some symbols:

  • ‘/’ → Root directory
  • ‘.’ → means that it is your current directory.
  • ‘..’ → means parent directory of your current directory
  • ‘~’ → home directory
  • ‘-’ → previous directory

Linux commands studied so far

1- pwd command :

  SYNTAX : pwd

-stands for present working directory.
-shows the path where you are from the root directory

2- cd command :

SYNTAX : cd My_Directory

Navigates to / changes to the directory mentioned which in this case is My_Directory
  • cd / → navigte to root directory
  • cd .. → navigate to parent directory of your current directory

3- ls command :

SYNTAX : ls

Is command is used for listing files or directories
  • ls -a’ → prints all files (including hidden ones)
  • `ls -l’→ prints in long listing format

4- cp command :

SYNTAX : cp source file destination file

-cp is used to copy  files
-cp command is used to create a copy of the contents of the file or directory.

5- mv command :

 SYNTAX : mv source file destination file

 mv command is used to move files or directories from its source to destination file or to rename a file. mv commands stands for move.

6- rm command :

SYNTAX : rm filename

rm command is used to remove any file or directory you no longer need. rm command stands for remove.

7- mkdir command :

SYNTAX : mkdir new_directory

Creates a new directory. In this case, it created a new directory named new_directory

8- rmdir command :

SYNTAX : rmdir directory name 

rmdir command allows you to remove directories you no longer need. rmdir command stands for remove directory.

9- clear command :

SYNTAX : clear

clear command is used to bring the command-line on the top of the terminal.

These Top Linux commands are great to help you with the Linux learning environment. I've used some of them and find them helpful. I hope you liked the post, wish you luck in your upcoming learnings. If you have any queries feel free to contact me on Twitter: Jamelah_1420