List of Popular Kali Linux Commands [Download PDF]

Kali Linux Commands list

List of Popular Kali Linux Commands [Download PDF]

Welcome to the world of Kali Linux, the premier Debian-derived Linux distribution tailored for digital forensics and penetration testing. Created and maintained by Offensive Security Ltd., with Mati Aharoni, Devon Kearns, and Raphaël Hertzog as its core developers, Kali Linux stands out as the go-to operating system for hackers and security experts worldwide. Unlike any other Linux distribution, Kali Linux boasts over 600 pre-installed penetration-testing programs, making it a powerhouse for anyone in the field of cybersecurity.
Whether you are taking your first steps into the cybersecurity realm or you’re a seasoned expert, understanding the fundamentals of the Linux kernel and Terminal is crucial. This guide aims to provide a comprehensive Kali Linux commands cheat sheet, designed to be your go-to reference and help ease your journey through the Terminal. From basic file management to advanced penetration testing tools, this list encompasses essential commands for users at all levels.
Kali Linux offers unparalleled flexibility in deployment, running natively on a computer, from live CDs or USBs, in a virtual machine, or even dual-booted with Windows 10. For those eager to dive in, let’s embark on this journey together, unlocking the vast capabilities of Kali Linux with each command.

Basic Linux Commands

ls

Description: Lists directory contents.
Syntax:

ls [options] [file|dir]...

Example:


ls -lah

Lists all files and directories, including hidden ones, with detailed information in a human-readable format.

cd

Description: Changes the current directory.
Syntax:

cd [directory]

Example:


cd /var/www/html

Changes the current working directory to /var/www/html.

cat

Description: Concatenates and displays file contents.
Syntax:

cat [options] [file...]

Example:

cat file.txt

Displays the content of file.txt.

echo

Description: Displays a line of text.
Syntax:

echo [option] [string]

Example:

 echo "Hello World"

Prints Hello World to the terminal.

grep

Description: Searches for patterns in files.
Syntax:

grep [options] pattern [file...]

Example:

grep "search term" file.txt

Searches for search term within file.txt.

apropos

Description: Search the manual page names and descriptions.
Example:

 apropos search_keyword

Finds commands related to a keyword.

aspell

Description: Interactive spell checker.
Example:

aspell check filename

Checks spelling in a file.
awk
Description: Pattern scanning and processing language.
Example:

awk '{print $1}' filename

Prints the first column of a file.

System Information Commands

Kali-linux-terminal-Uname-a command

uname -a

Description: Displays all system information.
Syntax:

uname -a

Example:

uname -a

Shows the kernel name, hostname, kernel release, kernel version, machine, processor, hardware platform, and operating system.

hostname

Description: Shows the system's network name.
Syntax:

hostname

Example:

hostname

Displays the name of the current host system.

top

Description: Displays an ongoing look at processor activity in real-time.
Syntax:

top

Example:

 top

Provides a dynamic real-time view of a running system.

lscpu

Description: Displays information about the CPU architecture.
Syntax:

lscpu

Example:

 lscpu

Lists detailed information about the CPU(s), including architecture, number of CPUs, cores, threads, and more.

df

Description: Reports file system disk space usage.
Syntax:

df [options]

Example:

 df -h

Shows the amount of disk space used and available on all mounted filesystems with human-readable formats.

free

Description: Displays the amount of free and used memory in the system.
Syntax:

free [options]

Example:

 free -h

Provides information about total, used, free, shared, buffer/cache, and available memory.

vmstat

Description: Reports information about processes, memory, paging, block IO, traps, and CPU activity.
Syntax:

vmstat [options] [interval [count]]

Example:

 vmstat 2 5

Shows system processes, memory, paging, block IO, traps, and CPU activity, updating every 2 seconds for a total of 5 times.

iostat

Description: Provides statistics about CPU utilization and input/output statistics for devices and partitions.
Syntax:

iostat [options] [interval [count]]

Example:

 iostat -xz 5 2

Displays CPU and I/O statistics for devices and partitions, providing extended statistics every 5 seconds, repeated 2 times.

dmesg

Description: Displays the kernel ring buffer messages.
Syntax:

dmesg [options]

Example:

 dmesg | grep sda

Filters the kernel messages for entries related to the sda disk.

lsblk

Description: Lists information about all available or the specified block devices.
Syntax:

lsblk [options]

Example:

 lsblk -f

Displays block devices in a tree format, including their mountpoint, filesystem type, and size.
lsusb
Description: Lists USB devices.
Syntax:

lsusb [options]

Example:

 lsusb -t

Shows the USB devices' tree, including all hubs and devices connected to them.

lspci

Description: Lists all PCI devices.
Syntax:

lspci [options]

Example:

 lspci -v

Provides verbose information about all PCI buses and the devices connected to them.

who

Description: Displays who is logged on.
Syntax:

who [options]

Example:

 who

Shows information about users currently logged into the system.

uptime

Description: Tells how long the system has been running.
Syntax:

uptime [options]

Example:

 uptime

Displays the current time, how long the system has been running, how many users are currently logged on, and the system load averages for the past 1, 5, and 15 minutes.

sar

Description: Collects, reports, or saves system activity information.
Syntax:

sar [options] [interval [count]]

Example:

 sar -u 1 3

Displays CPU usage for every 1 second, 3 times in a row. Requires the sysstat package to be installed.

Network Operations Commands

ifconfig

Description: Displays the network configuration for all interfaces.
Syntax:

ifconfig [interface]

Example:

 ifconfig eth0

Shows the configuration of the eth0 network interface.

ping

Description: Sends ICMP ECHO_REQUEST packets to network hosts.
Syntax:

ping [options] destination

Example:

 ping google.com

Checks the connectivity to google.com.

traceroute

Description: Traces the route packets take to a network host.
Syntax:

traceroute [options] destination

Example:

 traceroute google.com

Shows the path packets take to reach google.com.

nmap

Description: Network discovery and security auditing tool.
Syntax:

nmap [options] target

Example:

 nmap -sV -p 1-65535 localhost

Scans all ports on localhost and attempts to determine service/version information.

netstat

Description: Displays network connections, routing tables, interface statistics, masquerade connections, and multicast memberships.
Syntax:

netstat [options]

Example:

 netstat -tuln

Lists all listening ports with TCP and UDP protocols and numeric addresses.

nmap

Description: Network exploration tool and security / port scanner.
Syntax:

nmap [options] target

Example:

 nmap -A -T4 scanme.nmap.org

Scans scanme.nmap.org with OS detection, version detection, script scanning, and traceroute.

tcpdump

Description: Command-line packet analyzer.
Syntax:

tcpdump [options]

Example:

 tcpdump -i eth0

Captures all packets flowing through the eth0 interface.

ip

Description: Show / manipulate routing, devices, policy routing, and tunnels.
Syntax:

ip [options] OBJECT {COMMAND | help}

Example:

 ip addr show

Lists all IP addresses associated with all network interfaces.

ss

Description: Utility to investigate sockets.
Syntax:

ss [options] [FILTER]

Example:

 ss -tuln

Displays all listening sockets with TCP and UDP protocols and numeric addresses.

dig

Description: DNS lookup utility.
Syntax:

dig [@server] name [type] [options]

Example:

 dig google.com

Performs a DNS lookup for google.com.

host

Description: DNS lookup utility, simpler than dig.
Syntax:

host [options] hostname [server]

Example:

 host google.com

Finds the IP address of google.com.

nslookup

Description: Queries Internet domain name servers.
Syntax:

nslookup [option]

Example:

 nslookup google.com

Queries the DNS for information about google.com.

route

Description: Show / manipulate the IP routing table.
Syntax:

route [-nNvee] [-FC] [] List kernel routing tables

Example:

 route -n

Displays the kernel routing table with numeric addresses.

arp

Description: Manipulate the system ARP cache.
Syntax:

arp [options]

Example:

 arp -a

Shows all entries in the ARP table.

iwconfig

Description: Configure wireless network interfaces.
Syntax:

iwconfig [interface]

Example:

 iwconfig wlan0

Displays the configuration of the wlan0 wireless interface.

ethtool

Description: Display or change Ethernet device settings.
Syntax:

ethtool [options] interface

Example:

 ethtool eth0

Shows Ethernet settings for eth0.

mtr

Description: Network diagnostic tool.
Syntax:

mtr [options] target

Example:

 mtr google.com

Combines the functionality of traceroute and ping.

whois

Description: Client for the whois directory service.
Syntax:

whois [options] domain

Example:

 whois google.com

Retrieves whois information for google.com.

curl

Description: Tool to transfer data from or to a server.
Syntax:

curl [options] [URL...]

Example:

 curl http://example.com

Fetches the content of example.com.

wget

Description: Non-interactive network downloader.
Syntax:

wget [options]... [URL]...

Example:

 wget http://example.com

Downloads the content from example.com.

telnet

Description: User interface to the TELNET protocol.
Syntax:

telnet [options] [host [port]]

Example:

 telnet example.com 80

Connects to example.com on port 80.

Share this post

Comment (1)

  • Felix Reply

    Thank you for listing all the useful Kali commands. This is a useful guide.

    March 31, 2024 at 4:36 pm

Leave a Reply

Your email address will not be published. Required fields are marked *