Linux is an Operating System based on UNIX that was created in 1991 by Linus Torvalds. It is free, open source operating system (Open source refers to a program or software in which the source code is available for use and/or modification from its original design free of charge.) Linux commonly used as a server, but Linux is also used in desktop computers, Smartphones, gaming consoles “From wristwatches to Supercomputer”, is the popular description of Linux capabilities.
Linux is used as a leading operating system on servers and used in big systems such as mainframe computers, Super computer. Linux OS used in the TOP 500 supercomputer. Many top companies uses Linux like GOOGLE, Facebook, Amazon, NASA, IBM, Twitter, almost company they using Linux machine as there web server etc. company using Linux machines.
In this linux tutorial, we will start from the beginning and will go to the advanced level of Linux. As we know Linux is available in both interfaces GUI (Graphical User Interface) & TUI (Terminal user interface).
To learn GUI mode you have spent some time with Linux it’s easy to operate and it can be learned by self easily. But when we
Learning will be easy when we know how to use Linux commands with proper syntax. So now I am going to tell you about Basic Linux Commands.
To run commands we have to login in Linux machine
There are two modes of login
1. Graphical Mode (Alt+ctrl+F1 or F7)
2. Text Mode (Alt+Ctrl+F2….F6)
In case of Graphical Mode
Right-click on Desktop -> Open terminal (Terminal is a command prompt for Linux)
In the case of Text Mode
localhost login: root
[User @ computer name PWD ] #
# – root user powerful user account
$ – normal user account
Some of the Common Basic system commands are as follow:
# cat > filename:- The ‘cat’ command is used to create a file
Ctrl +D (for save & exit)
# cat filename: to view the file content.
#touch filename: to create empty files
# mkdir folder name: to create directory
#cd foldername : To change directory
#cd .. : To come out from the directory
#cd : to jump to root directory
#cd – : to jump to the previous directory
#cd / : to come out all directory
# Date : to display date and time
# Cal : to display the calendar
# Cal 11 2019: display the calendar of Month 11 and year 2019
# Clear : To clear the screen
# reset: to clear screen
# ls : to list directory contents
blue : Directories
White : Files
Green : Executable files
Red ; Zip files, rpm, tar file
Different switches used with “ls” command
# ls –l or ll: used for the long listing including file and directory permission
(-) : file
(d) : Directory
(l) : Symbolic link
# ls –a : shows all hidden files and directory. Any file followed by (.) is a hidden file
# ls –al : show all hidden files and directory with the long listing or whole description
# ls –d : shows all the directory
# rm filename : to remove the file
# rm –f filename : to remove file forcefully
# rmdir foldername : Only empty directory will be deleted
# rm –r foldername : to remove the folder
# rm –rf foldername : to remove folder forcefully
# pwd: Present working directory
# who am I: display the information of the current terminal
# who : display all login user in the terminal.
# w : display logged users
# history: it shows all the command you have used.
History can store the last 1000 command which you have run. If you want to change
# vim /etc/profile
HIST SIZE =100
Save and exit
# history –c ( to clear all the previous command to reside in history)
# !! : repeat last command
# !r : the last command executed with ‘r’ character
# !20 : executed that no. of command
mv: move /rename files and directory
# mv [option] file destination
# mv old name new name
multiple files can be moved at a time if the destination is a directory
# mv [option] file1 file2 file3 destination
# mv [source add] [destination add]
The command that is used to get the help are discussed as:
# What is command: Display a short description of the command, it uses a database that is updated nightly. Often not available immediately after installation.
# –help: Display usage summary and argument list
# man: for help
#info: for help
Both provide documentation for command. Almost every command has a “man” page. The collection of pages is called the Linux manual.
Viewing Text Page
#more [option] [filename]
#less [option] [filename]
# less abc.txt
scroll with arrows/PgUp /PgDown
we can also use “less” with pipe |
These are common commands of Linux to do practice of it after that we will continue to learn other Basic Linux commands like copy paste commands, process related command, networking related commands and many more.