Security article
HTB Academy - System Information
HTB Academy - System Information: Command • HTB Academy • htb-academy, section-70
Linux System Information Commands
| Command | Description |
|---|---|
whoami | Displays the current username. |
id | Displays the current user's identity, including user and group IDs. |
hostname | Displays or sets the name of the current host system. |
uname | Displays basic information about the operating system and hardware. |
pwd | Displays the current working directory. |
ifconfig | Displays or configures network interfaces and network parameters. |
ip | Displays or manages routes, network devices, interfaces, and tunnels. |
netstat | Displays network connections, routing tables, and network statistics. |
ss | Displays information about network sockets. |
ps | Displays information about running processes. |
who | Displays users currently logged in to the system. |
env | Displays environment variables or runs a command with modified environment variables. |
lsblk | Lists block devices. |
lsusb | Lists connected USB devices. |
lsof | Lists open files and the processes using them. |
lspci | Lists connected PCI devices. |
Count Installed Packages
Use the following command to count all installed Debian packages:
dpkg-query -l | grep "^ii" | wc -lCommand Breakdown
| Command | Description |
|---|---|
dpkg-query -l | Lists packages known to the Debian package manager. |
grep "^ii" | Filters the output to include only installed packages. |
wc -l | Counts the number of matching lines. |