๐ Beyond Basics: Using Advanced Linux ๐ง Commands
Part 2

๐ Quick Intro ๐ฅ
In this blog, I will explain advanced commands related to:-
Process management
Package management
System information
Networking commands
๐ Process Management โ๏ธ
As Linux is multiuser & multitasking OS it has multiple processes running at same
To get data on all those processes we have
pscommandTo find which services are running on which ports on, you can use
netstat -tuln
Display Processes
ps--> View running processes๐ฉ FLAGS
-A--> View all running processes-e--> View all running processes-f--> View full-format listing-a--> View all processes except session leaders & not associated with terminal-x--> View all processes owned by youps -ef--> View all running processes in a detailed format. [most commonly used]
ps -aux--> View all running processes owned by you in a detailed formatFind Process
To find a particular running process you can use pipe with grep command

You can get PID in the second column
Kill Process
To kill process
killcommand is usedkill PID--> Kill process using PID
kill <signal> PID--> Kill process with some extra signal๐ฆ SIGNALS
| SIGKILL | 9 | It kills signal forcefully without any cleanup activities. | | --- | --- | --- | | SIGTERM | 15 | Before terminating the process, it does some cleanup activities. |
kill -9 PIDORkill -SIGKILL PID

kill -15 PIDORkill -SIGTERM PID
kill -l--> Display all signals
๐ Package Management ๐ฆ
Different distros have different package managers
yumfor Amazon Linux / Cent OS / Red Hataptandapt-getfor Ubuntu / Debiandeb
| apt-get | apt |
| Less user friendly | More user-friendly, like a progress bar |
| Search not available | Available |
sudo apt update -y --> Update existing packages
sudo apt search <package-name> --> Search package
sudo apt install <package-name> -y --> Install new package
sudo apt remove <package-name> -y --> Uninstall package
cat /etc/apt/sources.list --> This file has all repositories from where packages are downloaded
๐ System Information ๐ป
unamegives general information about OS, architecture & system๐ฉ FLAGS
-a--> Print all data-s--> Give kernel name-n--> Hostname-r--> Kernel release date-v--> Version of the current kernel-m--> Machine hardware name-p--> Type of processor-i--> Platform of hardware-o--> Name of OS
dfis used to get storage-related data of all mounted file systems
ducommand gives file and directory space usage๐ฉ FLAGS
-a--> Include all files and directories, including hidden ones-c--> Give total disk usage in addition to individual ones-h--> Human readable sizes--time--> Give the last modified time also
lsblkgives data of block devices and mounted storages
uptimeis used to find out how long the system is running๐ฉ FLAGS
-p--> Human readable-s--> Starting date & time
lscpugives all the details about the CPU
๐ Networking ๐
ping <URL/IP>is used to check if the server is running
ifconfiggives details about interfaces and private IP address
netstatdisplays network-related information such as network connections, routing tables, interface statistics, etc.wgetis a non-interactive network downloader that is used to download files
๐ฉ FLAGS
-b--> Download in background [this creates a logfile]-c--> Resume partially downloaded file
Happy Learning!!! ๐




