The IT Professional's Linux Handbook - Commands, Concepts
The IT Professional's Linux Handbook - Commands, Concepts
Linux:
Linux is a free and open-source operating system known for its robust security, stability,
and flexibility. It is a multi-user, multitasking system primarily operated through a
command-line interface, although graphical interfaces are also available.
• Open-Source Model: The source code of Linux is freely available for use,
modification, and distribution.
• Multi-User Capability: Multiple users can access system resources such as
memory and processing power simultaneously without interfering with each
other.
• Multitasking: Linux can run multiple applications or processes concurrently.
• Enhanced Security: Built-in user permissions, encryption, and firewall features
provide a secure operating environment.
• Versatile Usage: Widely used in servers, embedded systems, supercomputers,
mobile devices, and cloud infrastructure.
Linux OS Distributions:
Many of the users taken the Linux OS and modified according to their requirements and
released into the market with different names called Linux distributions.
• RedHat
• Ubuntu
• Debian
• Centos
• Fedora
• OpenSUSE
• Kali Linux
• Amazon Linux
• Rocky Linux
History:
On Sep 17th 1991, Linus Torvalds a student at the university of Helsinki, Finland, He
released the first version of Linux Kernel, Known as Linux 0.01, as an open-source
software.
KERNEL:
It is the core or the heart of the Operating system. It is the central part that manages
and facilitates communication between the computer's hardware and software.
SHELL:
• Command Line Interface (CLI): Executes the command provided by user and
display the output in terminal.
• Executes the process provided by the user in graphical way and output is
displayed in the graphical windows.
COMMAND:
TERMINAL:
• It is a text-based interface that allows you to interact with the operating system
by typing commands.
• It is a way for you to communicate with the Linux machines
• / – Root directory
• /home – User directories
• /etc – Configuration files
• /bin – Essential binaries
• /var – Log files
• /tmp – Temporary files
• /dev – Device files
• /proc – Kernel and process info
If you are using AWS EC2 instances - By default, we are in ec2-user, but if we want to
perform any action, we should be in root user because, root is the ultimate king of
Linux, root has full permissions, so that we can run any command anywhere.
• SYSTEM COMMANDS
• HARDWARE COMMANDS
• FILE COMMANDS
• FOLDER COMMANDS
• PERMISSION COMMANDS
• USER COMMANDS
• GROUP COMMANDS
• OWNER COMMANDS
• SEARCH COMMANDS
• NETWORKING COMMANDS
System Commands:
Command Description
uptime Used to get since how long our system is in running state
uptime -p Used to get only screen up time
Command Description
lscpu Displays information about the CPU architecture
Lists the information about all the block devices attached to
lsblk -a the system
free Displays system memory(RAM) details in kb
free -m Displays system memory(RAM) details in mb
Report files system disk space usage in human readable
df -h languages
File Commands:
Command Description
Folder Commands:
Command Description
used to get list of files with full info about files/folders in order(A-
ll Z)
ls used to get list of files with only file/folder names
ll -t Used to see list of files based on modification/creation time
ll -r Used to see the files in reverse order(Z-A)
ll -a Used to see all files including hidden
Change Directory
Command Description
Copy Command:
• By using above command, the data from file1 copies into file2. But the problem
is it will overwrite the data present in file2
• To overcome this issue, we will use cat command.
Move Command:
Cat command is used to read the data from a file, it is also used to append the data in a
file.
Note: Cat command is used to append the data, but here the problem is, it is not
possible to modify the data. To avoid this issue we can use editor in Linux.
1. Vim editor
2. Nano editor
Vim editor:
It has 3 modes,
1. Command mode
2. Insert mode
3. Save & quit mode
Command Mode:
It is the default mode in vim editor, it is used to perform some actions like copy the
data, delete the data and we can undo and redo the changes as well.
Command Description
Insert mode:
This mode is used to insert the data or make any modifications to the file
• To go to insert mmode: i
• To go back to command mode: esc
• To go to the ending of the line: A
• To go to the starting of this line: I
• To create a new line above the cursor: O
• To create a new line below the cursor: o
This is used to save the data and quit from vim editor
User commands:
NOTE:
• whenever we add any user, then folder will gets created in /home directory
• Whenever we add any user, then group also created automatically
Userdel username: used to delete user
NOTE:
• Whenever we delete any user, then folder will not gets deleed in /home
directory
• Whenever we delete any user, then group will gets deleted
Group commands:
Owner Commands:
Permission Commands:
Search commands:
1. Find command
2. Locate command
Find Command:
Locate Command:
Note: If you are using locate command, we have to update the db of linux before
performing locate command.
Find vs locate: Find commands will search as per the path that we mentioned in
command, but locate command will search for a file on entire database.
Network Commands:
Command Description
Basic Network Configuration
Network Connectivity
DNS Tools
Network Monitoring