Open navigation menu
Close suggestions
Search
Search
en
Change Language
Upload
Sign in
Sign in
Download free for days
0 ratings
0% found this document useful (0 votes)
117 views
Kali Linux Commands
Uploaded by
masterkenobi000
AI-enhanced title
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
Download now
Download
Save kali linux commands For Later
Download
Save
Save kali linux commands For Later
0%
0% found this document useful, undefined
0%
, undefined
Embed
Share
Print
Report
0 ratings
0% found this document useful (0 votes)
117 views
Kali Linux Commands
Uploaded by
masterkenobi000
AI-enhanced title
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
Download now
Download
Save kali linux commands For Later
Carousel Previous
Carousel Next
Save
Save kali linux commands For Later
0%
0% found this document useful, undefined
0%
, undefined
Embed
Share
Print
Report
Download now
Download
You are on page 1
/ 16
Search
Fullscreen
Chapter 1: Getting Started with the Basics
pwd – Print the current directory.
1. pwd → Outputs /home/kali
2. cd /etc && pwd → Outputs /etc
3. cd ~/Documents && pwd → Outputs /home/kali/Documents
ls – List files and directories.
1. ls -l → Detailed list with permissions and sizes.
2. ls -a → Lists hidden files (like .bashrc).
3. ls -lh /var → Lists with human-readable file sizes.
cd – Change directory.
1. cd /home/kali → Moves to the user directory.
2. cd .. → Moves up one directory level.
3. cd ~/Downloads → Moves to Downloads directory.
whoami – Show current user.
1. whoami → Outputs kali
2. sudo whoami → Outputs root
3. ssh user@remote && whoami → Outputs the remote user.
uname -a – Show system information.
1. uname -a → Displays kernel version and system architecture.
2. uname -r → Displays kernel version only.
3. uname -m → Displays the machine architecture (e.g., x86_64).
man / --help – Show manual or help.
1. man ls → Shows the manual for the ls command.
2. ls --help → Shows help and usage options for ls.
3. man grep → Displays the manual for grep.
Chapter 2: Text Manipulation
cat – Display file content.
1. cat file.txt → Prints entire content of file.txt.
2. cat /etc/passwd → Shows user account information.
3. cat file1.txt file2.txt → Concatenates and prints both files.
head / tail – View the beginning or end of a file.
1. head -n 10 file.txt → Displays the first 10 lines.
2. tail -n 5 file.txt → Displays the last 5 lines.
3. tail -f /var/log/syslog → Continuously shows new log entries.
grep – Search patterns in text files.
1. grep 'root' /etc/passwd → Finds lines with "root".
2. grep -i 'error' /var/log/syslog → Case-insensitive search for
"error".
3. grep -r 'main' ./src → Recursively searches in the src directory.
sed – Stream editor for replacing text.
1. sed 's/foo/bar/' file.txt → Replaces the first occurrence of "foo"
with "bar".
2. sed -i 's/hello/Hi/g' file.txt → Edits the file, replacing all
occurrences of "hello" with "Hi".
3. echo 'test' | sed 's/test/TEST/' → Outputs TEST.
awk – Pattern scanning and processing.
1. awk '{print $1}' file.txt → Prints the first column of each line.
2. awk '/error/ {print $2}' /var/log/syslog → Prints the second
column of lines containing "error".
3. echo "1 2 3" | awk '{print $2}' → Outputs 2.
Chapter 3: Analyzing and Managing Networks
ifconfig / ip – Display network interfaces.
1. ifconfig eth0 → Shows details of the eth0 interface.
2. ip addr → Displays all network interfaces.
3. ifconfig wlan0 down && ifconfig wlan0 up → Restarts the
wireless interface.
ping – Check connectivity.
1. ping google.com → Pings Google's server.
2. ping -c 4 8.8.8.8 → Sends 4 pings to Google DNS.
3. ping -i 0.5 localhost → Pings the local machine with 0.5-second
intervals.
nmap – Network scanner.
1. nmap 192.168.1.1 → Scans the IP for open ports.
2. nmap -sV 192.168.1.1 → Detects services running on ports.
3. nmap -A 192.168.1.0/24 → Scans the whole subnet.
netstat / ss – Display network connections.
1. ss -tuln → Lists open TCP and UDP ports.
2. netstat -ant → Displays active TCP connections.
3. ss -i → Shows detailed socket information.
traceroute – Trace network path.
1. traceroute google.com → Traces the route to Google.
2. traceroute -m 5 8.8.8.8 → Limits hops to 5.
3. traceroute -T github.com → Uses TCP instead of ICMP.
Chapter 4: Adding and Removing Software
apt update – Refresh package lists.
1. sudo apt update → Updates the package list.
2. apt update && apt upgrade → Updates and
upgrades packages.
3. apt update -y → Auto-answers "yes" to prompts.
apt install – Install software.
1. apt install nmap → Installs the nmap package.
2. apt install python3 → Installs Python 3.
3. apt install -y curl → Installs curl with auto-
confirmation.
apt remove – Uninstall a package.
1. apt remove apache2 → Removes Apache server.
2. apt remove --purge nmap → Completely removes
nmap.
3. apt remove python3 -y → Auto-confirms removal.
dpkg – Install or query .deb packages.
1. dpkg -i package.deb → Installs a local .deb
package.
2. dpkg -l | grep nmap → Lists installed nmap version.
3. dpkg --remove apache2 → Removes Apache2
packag
Chapter 5: Controlling File and Directory Permissions
chmod – Change file permissions.
1. chmod 755 script.sh → Sets read, write, execute
permissions for owner, and read, execute for others.
2. chmod u+w file.txt → Adds write permission for the
owner.
3. chmod -R 644 /var/www/html → Recursively sets
read-write permissions for owner and read-only for
others.
chown – Change file ownership.
1. chown user1 file.txt → Changes ownership of
file.txt to user1.
2. chown user2:group2 /var/www/html → Changes
owner to user2 and group to group2.
3. sudo chown -R root:root /etc → Recursively
changes ownership of /etc to root.
umask – Set default permissions.
1. umask 022 → Sets default permissions (files will be
755).
2. umask → Displays the current umask value.
3. umask 077 → Ensures new files are accessible only
by the owner.
Chapter 6: Process Management
ps – View active processes.
1. ps aux → Shows all running processes.
2. ps -ef | grep apache → Filters Apache
processes.
3. ps -u kali → Shows processes owned by the user
kali.
top / htop – Interactive process monitoring.
1. top → Displays active processes dynamically.
2. htop → Similar to top but more user-friendly (if
installed).
3. top -o %MEM → Sorts processes by memory
usage.
kill / pkill – Terminate processes.
1. kill 1234 → Kills process with PID 1234.
2. pkill apache2 → Kills all Apache processes.
3. kill -9 5678 → Forces termination of process
5678.
Chapter 7: Managing User Environment Variables
env – Display environment variables.
1. env → Lists all environment variables.
2. env | grep PATH → Shows the PATH variable.
3. env VAR=value ./script.sh → Runs a script with
a temporary variable.
export – Set an environment variable.
1. export PATH=$PATH:/usr/local/bin → Adds a
path to the PATH variable.
2. export EDITOR=vim → Sets vim as the default
editor.
3. export LANG=en_US.UTF-8 → Sets the system
language.
unset – Remove a variable.
1. unset VAR_NAME → Removes the variable
VAR_NAME.
2. unset PATH → Clears the PATH variable (not
recommended).
3. unset USER → Deletes the USER environment
variable.
Chapter 8: Bash Scripting
bash – Execute a script.
1. bash hello.sh → Runs the script hello.sh.
2. bash -x script.sh → Runs a script with
debugging output.
3. bash --version → Displays the Bash version.
if, for, while – Control structures.
1. if [ $USER == "root" ]; then echo "You are
root"; fi
2. for i in {1..5}; do echo $i; done → Prints
numbers 1 to 5.
3. while true; do echo "Running"; sleep 1; done
→ Infinite loop printing "Running".
Chapter 9: Compressing and Archiving
tar – Archive files.
1. tar -czf archive.tar.gz /folder → Archives and
compresses /folder.
2. tar -xzf archive.tar.gz → Extracts the archive.
3. tar -cf archive.tar file1 file2 → Archives
without compression.
gzip – Compress files.
1. gzip file.txt → Compresses file.txt to
file.txt.gz.
2. gzip -d file.txt.gz → Decompresses the file.
3. gzip -k file.txt → Keeps the original file after
compression.
zip – Create ZIP archives.
1. zip archive.zip file1 file2 → Creates a ZIP with
two files.
2. unzip archive.zip → Extracts the ZIP file.
3. zip -r archive.zip /folder → Zips the entire
folder.
Chapter 10: Filesystem and Storage Device
Management
df – Display disk space usage.
1. df -h → Displays disk usage in human-readable
format.
2. df -T → Shows filesystem type.
3. df -i → Displays inode usage.
mount / umount – Mount/Unmount devices.
1. mount /dev/sda1 /mnt → Mounts sda1 to
/mnt.
2. umount /mnt → Unmounts the device from
/mnt.
3. mount -o ro /dev/sda1 /mnt → Mounts as
read-only.
fsck – Check and repair filesystems.
1. fsck /dev/sda1 → Checks and repairs
/dev/sda1.
2. fsck -y /dev/sda1 → Auto-confirms repairs.
3. fsck -n /dev/sda1 → Checks without making
changes.
Chapter 11: The Logging System
journalctl – Query system logs.
1. journalctl -u ssh → Shows logs for SSH service.
2. journalctl --since "1 hour ago" → Logs from the
last hour.
3. journalctl -k → Displays kernel logs.
dmesg – Display kernel messages.
1. dmesg | tail → Shows the latest kernel
messages.
2. dmesg | grep usb → Filters USB-related
messages.
3. dmesg -T → Converts timestamps to human-
readable format.
Chapter 12: Using and Abusing Services
systemctl – Manage services.
1. systemctl start apache2 → Starts the Apache
service.
2. systemctl stop ssh → Stops the SSH service.
3. systemctl restart nginx → Restarts the Nginx
service.
service – Legacy service management.
1. service apache2 status → Checks Apache
status.
2. service ssh restart → Restarts SSH service.
3. service --status-all → Lists all services and their
status.
Chapter 13: Becoming Secure and Anonymous
iptables – Firewall management.
1. iptables -L → Lists firewall rules.
2. iptables -A INPUT -p tcp --dport 22 -j ACCEPT →
Allows SSH connections.
3. iptables -D INPUT 1 → Deletes the first rule in the
INPUT chain.
tor – Anonymous network browsing.
1. tor → Starts the Tor network.
2. proxychains firefox → Opens Firefox through Tor.
3. tor --version → Displays the Tor version.
Chapter 14: Understanding and Inspecting
Wireless Networks
iwconfig – Configure wireless interfaces.
1. iwconfig wlan0 essid "network" → Connects to a
wireless network.
2. iwconfig wlan0 mode monitor → Sets monitor
mode.
3. iwconfig wlan0 channel 6 → Sets the wireless
channel.
airmon-ng – Enable monitor mode.
1. airmon-ng start wlan0 → Enables monitor mode
on wlan0.
2. airmon-ng stop wlan0 → Stops monitor mode.
3. airmon-ng check kill → Stops interfering
processes.
Chapter 15: Managing the Linux Kernel and
Loadable Kernel Modules
lsmod – List loaded modules.
1. lsmod | grep usb → Lists USB-related modules.
2. lsmod | wc -l → Counts loaded modules.
3. lsmod | grep nvidia → Checks if NVIDIA driver is
loaded.
modprobe / rmmod – Load/Unload modules.
1. **`modprobe vmmon
modprobe / rmmod – Load/Unload modules.
1. modprobe vmmon → Loads the vmmon kernel
module (used by VMware).
2. modprobe -r vmmon → Unloads the vmmon
module.
3. modprobe loop → Loads the loopback device
module.
You might also like
XNC-NC1000-NC500 - Office Network Connections
PDF
0% (1)
XNC-NC1000-NC500 - Office Network Connections
48 pages
Termux PDF
PDF
No ratings yet
Termux PDF
2 pages
Introduction To Linux I - Chapter 01 Exam Answers
PDF
No ratings yet
Introduction To Linux I - Chapter 01 Exam Answers
6 pages
Building A Powerful FreeBSD Firewall Based On PF and IPFW
PDF
100% (17)
Building A Powerful FreeBSD Firewall Based On PF and IPFW
13 pages
Snorby Installation Guide
PDF
No ratings yet
Snorby Installation Guide
7 pages
Cadwork Manual List en
PDF
No ratings yet
Cadwork Manual List en
46 pages
Configuration of a Simple Samba File Server, Quota and Schedule Backup
From Everand
Configuration of a Simple Samba File Server, Quota and Schedule Backup
Dr. Hidaia Mahmood Alassouli
No ratings yet
كتاب تعلم لينكس للمبتدئين PDF
PDF
No ratings yet
كتاب تعلم لينكس للمبتدئين PDF
96 pages
Install Voucherbox
PDF
No ratings yet
Install Voucherbox
3 pages
Network Programming in Java Internet Protocols (IP, UDP, TCP), B01DY9BNOA, Apr. 6, 2016, by Alan MOUHLI
PDF
No ratings yet
Network Programming in Java Internet Protocols (IP, UDP, TCP), B01DY9BNOA, Apr. 6, 2016, by Alan MOUHLI
19 pages
Endian Firewall Administrators Guide
PDF
No ratings yet
Endian Firewall Administrators Guide
296 pages
The Selinux User Guide Assists Users and Administrators in Managing and Using Security-Enhanced Linux®
PDF
No ratings yet
The Selinux User Guide Assists Users and Administrators in Managing and Using Security-Enhanced Linux®
55 pages
Nehra Classes DevOps Syllabus
PDF
No ratings yet
Nehra Classes DevOps Syllabus
6 pages
Asterisk CDR Mysql
PDF
No ratings yet
Asterisk CDR Mysql
11 pages
Android Forensic With Autopsy
PDF
No ratings yet
Android Forensic With Autopsy
9 pages
DAG Fxs-Fxo Dinstar Elastix
PDF
No ratings yet
DAG Fxs-Fxo Dinstar Elastix
6 pages
ADFS Design Considerations and Deployment Options
PDF
No ratings yet
ADFS Design Considerations and Deployment Options
12 pages
YateBTS LabKit Quick Start Guide
PDF
No ratings yet
YateBTS LabKit Quick Start Guide
6 pages
Poo
PDF
No ratings yet
Poo
8 pages
OpenOTP QuickStart
PDF
100% (1)
OpenOTP QuickStart
19 pages
FMS Deployment Guide For Linux
PDF
No ratings yet
FMS Deployment Guide For Linux
19 pages
Pipenv Documentation: Release 2018.11.27.dev0
PDF
No ratings yet
Pipenv Documentation: Release 2018.11.27.dev0
74 pages
Brute Force Attack - OWASP
PDF
No ratings yet
Brute Force Attack - OWASP
4 pages
How To Install PfSense On VMware ESXi - Step by Step Guide. - GetLabsDone
PDF
No ratings yet
How To Install PfSense On VMware ESXi - Step by Step Guide. - GetLabsDone
21 pages
IPSec Tunnel - Mikrotik to pfSense - ODλ Zero Dispersion
PDF
No ratings yet
IPSec Tunnel - Mikrotik to pfSense - ODλ Zero Dispersion
12 pages
Vulnhub
PDF
No ratings yet
Vulnhub
7 pages
PortFast and UplinkFast
PDF
No ratings yet
PortFast and UplinkFast
8 pages
Kernel
PDF
100% (1)
Kernel
571 pages
9.1.1.6 Lab - Encrypting and Decrypting Data Using OpenSSL - ILM Estudantes
PDF
No ratings yet
9.1.1.6 Lab - Encrypting and Decrypting Data Using OpenSSL - ILM Estudantes
3 pages
Red Hat System Administration I - RH124: Course Outline
PDF
No ratings yet
Red Hat System Administration I - RH124: Course Outline
2 pages
Pfsense Training - 2
PDF
No ratings yet
Pfsense Training - 2
32 pages
LINUX Practical Exam
PDF
0% (1)
LINUX Practical Exam
4 pages
Towers of Power Class 2 - 2015
PDF
100% (1)
Towers of Power Class 2 - 2015
32 pages
Networking Commands
PDF
No ratings yet
Networking Commands
7 pages
Installation Kali Linux 2023
PDF
No ratings yet
Installation Kali Linux 2023
2 pages
Installing The OCFS File System
PDF
No ratings yet
Installing The OCFS File System
5 pages
Linux KVM Virtualization: Detailed Course Outline: 1. Virtualization Basics
PDF
No ratings yet
Linux KVM Virtualization: Detailed Course Outline: 1. Virtualization Basics
2 pages
Kali Linux Installation
PDF
No ratings yet
Kali Linux Installation
12 pages
Zed Attack Proxy - Simon Bennetts
PDF
No ratings yet
Zed Attack Proxy - Simon Bennetts
28 pages
Enigma2 Telne
PDF
No ratings yet
Enigma2 Telne
7 pages
Debian Server Book
PDF
No ratings yet
Debian Server Book
147 pages
#CTFs
PDF
No ratings yet
#CTFs
6 pages
Wi-Fi 802.11 Standard Security
PDF
No ratings yet
Wi-Fi 802.11 Standard Security
22 pages
LPIC-1 and CompTIA Linux
PDF
No ratings yet
LPIC-1 and CompTIA Linux
13 pages
How To Create A SSL Certificate On Apache For Debian 7 PDF
PDF
No ratings yet
How To Create A SSL Certificate On Apache For Debian 7 PDF
4 pages
Fragmentation Attack On A Wireless Networkdoc968
PDF
No ratings yet
Fragmentation Attack On A Wireless Networkdoc968
34 pages
Objectifs LPIC2 v4.5
PDF
No ratings yet
Objectifs LPIC2 v4.5
38 pages
Android Pentest Notes
PDF
No ratings yet
Android Pentest Notes
58 pages
AlienVault Users Manual 1.0
PDF
No ratings yet
AlienVault Users Manual 1.0
225 pages
02 Linux Quick Start PDF
PDF
100% (1)
02 Linux Quick Start PDF
30 pages
Pfsense Basic Configuration
PDF
No ratings yet
Pfsense Basic Configuration
19 pages
1.2. Lab Setup Virtualbox and Kali Linux v1
PDF
No ratings yet
1.2. Lab Setup Virtualbox and Kali Linux v1
11 pages
Cyber Security
PDF
No ratings yet
Cyber Security
59 pages
Cyber Security Project
PDF
No ratings yet
Cyber Security Project
18 pages
Common Tools and Methods Used in Vulnhub CTF's
PDF
No ratings yet
Common Tools and Methods Used in Vulnhub CTF's
4 pages
Feasibility Study SaaS
PDF
No ratings yet
Feasibility Study SaaS
15 pages
Ongo S Odeways: Installing Webmin On Ubuntu Server 10.04 LTS (Lucid)
PDF
No ratings yet
Ongo S Odeways: Installing Webmin On Ubuntu Server 10.04 LTS (Lucid)
6 pages
Snort 3 User Manual
PDF
100% (1)
Snort 3 User Manual
103 pages
Install Windows From Usb
PDF
100% (1)
Install Windows From Usb
5 pages
Practical: 5
PDF
No ratings yet
Practical: 5
19 pages
Kali Linux Commands PDF
PDF
No ratings yet
Kali Linux Commands PDF
10 pages
Installing and Configuring Suricata On Centos 7
PDF
No ratings yet
Installing and Configuring Suricata On Centos 7
28 pages
serverDZ CFG
PDF
No ratings yet
serverDZ CFG
2 pages
File Allocation
PDF
No ratings yet
File Allocation
37 pages
EasyFile MANUAL
PDF
No ratings yet
EasyFile MANUAL
29 pages
Create A HID USB Device
PDF
100% (1)
Create A HID USB Device
6 pages
Fox Pro Command
PDF
100% (3)
Fox Pro Command
11 pages
FOC Chapter 1 (Introducing todays technologies)
PDF
No ratings yet
FOC Chapter 1 (Introducing todays technologies)
12 pages
Setting Raspberry Pi
PDF
100% (1)
Setting Raspberry Pi
20 pages
Cisco IP Phone 8841, 8851, and 8861 Release Notes For Firmware Release 10.2
PDF
No ratings yet
Cisco IP Phone 8841, 8851, and 8861 Release Notes For Firmware Release 10.2
18 pages
Ufgs 01 33 16.00 10 Design Data (Design After Award)
PDF
No ratings yet
Ufgs 01 33 16.00 10 Design Data (Design After Award)
58 pages
Understanding Data Deletion and Data Recovery in Windows
PDF
No ratings yet
Understanding Data Deletion and Data Recovery in Windows
29 pages
StuffIt Deluxe Users Guide
PDF
No ratings yet
StuffIt Deluxe Users Guide
100 pages
Dream Report User Manual PDF
PDF
No ratings yet
Dream Report User Manual PDF
496 pages
PrimoPDF Setup Log
PDF
No ratings yet
PrimoPDF Setup Log
6 pages
Authorization
PDF
No ratings yet
Authorization
16 pages
User Manual For HMI-PLC 201801
PDF
No ratings yet
User Manual For HMI-PLC 201801
53 pages
Splunk Admin42 Ver1.1
PDF
100% (1)
Splunk Admin42 Ver1.1
310 pages
H100S Help - en
PDF
No ratings yet
H100S Help - en
14 pages
Render Pal V2
PDF
No ratings yet
Render Pal V2
105 pages
Partner Success Story_Cloud 9 Infosystems
PDF
No ratings yet
Partner Success Story_Cloud 9 Infosystems
2 pages
Oracle Dba
PDF
50% (2)
Oracle Dba
15 pages
Gcse (9-1) English Language: Specification
PDF
No ratings yet
Gcse (9-1) English Language: Specification
48 pages
Getting Started: Warranty
PDF
No ratings yet
Getting Started: Warranty
56 pages
Oracle Important Notes
PDF
No ratings yet
Oracle Important Notes
129 pages
Command Prompt
PDF
100% (1)
Command Prompt
6 pages
Simatic Engineering Tools S7-PLCSIM Installation Notes
PDF
No ratings yet
Simatic Engineering Tools S7-PLCSIM Installation Notes
3 pages
List of FTP Commands For The Microsoft Command-Line FTP Client
PDF
No ratings yet
List of FTP Commands For The Microsoft Command-Line FTP Client
11 pages
s3
PDF
No ratings yet
s3
70 pages
Aquarius Quick Guide
PDF
No ratings yet
Aquarius Quick Guide
8 pages