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)
171 views
16 pages
Kali Linux Commands
Uploaded by
masterkenobi000
AI-enhanced title
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content,
claim it here
.
Available Formats
Download as PDF, TXT or read online on Scribd
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)
171 views
16 pages
Kali Linux Commands
Uploaded by
masterkenobi000
AI-enhanced title
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content,
claim it here
.
Available Formats
Download as PDF, TXT or read online on Scribd
Carousel Previous
Carousel Next
Download
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
Ethical Hacking With Termux Course E-Book -- Ranjeet Kumar -- RKC Security Solutions -- 579fa47cacea3313fd33f52775160cd0 -- Anna’s Archive
PDF
0% (1)
Ethical Hacking With Termux Course E-Book -- Ranjeet Kumar -- RKC Security Solutions -- 579fa47cacea3313fd33f52775160cd0 -- Anna’s Archive
78 pages
Questions Modules 1-7
PDF
67% (6)
Questions Modules 1-7
46 pages
Ansys Minerva Users Guide
PDF
No ratings yet
Ansys Minerva Users Guide
276 pages
Natural Language Processing With Python Cookbook 1st Edition Krishna Bhavsar Download PDF
PDF
100% (9)
Natural Language Processing With Python Cookbook 1st Edition Krishna Bhavsar Download PDF
38 pages
Introduction To Microsoft Word 2007: What Is A Word Processor?
PDF
No ratings yet
Introduction To Microsoft Word 2007: What Is A Word Processor?
9 pages
CSI Linux - Levels of Data Recovery and Imaging
PDF
No ratings yet
CSI Linux - Levels of Data Recovery and Imaging
22 pages
Basic Pentesting - 1 Walkthrough - Vulnhub - by Dinidhu Jayasinghe - InfoSec Write-Ups
PDF
No ratings yet
Basic Pentesting - 1 Walkthrough - Vulnhub - by Dinidhu Jayasinghe - InfoSec Write-Ups
6 pages
Android Forensic With Autopsy
PDF
No ratings yet
Android Forensic With Autopsy
9 pages
Personal Voice Assistant
PDF
100% (1)
Personal Voice Assistant
118 pages
Os Command Injections eBook
PDF
No ratings yet
Os Command Injections eBook
21 pages
Integrate ShellGPT in Parrot Security Machine
PDF
No ratings yet
Integrate ShellGPT in Parrot Security Machine
5 pages
SVN Tausief 03 08 2015
PDF
No ratings yet
SVN Tausief 03 08 2015
37 pages
Excel File Format
PDF
No ratings yet
Excel File Format
250 pages
Snort 3 User Manual
PDF
100% (1)
Snort 3 User Manual
103 pages
Enumerating Esoteric Attack Surfaces by Jann Moon
PDF
No ratings yet
Enumerating Esoteric Attack Surfaces by Jann Moon
196 pages
manual-customer_transfer-license
PDF
No ratings yet
manual-customer_transfer-license
40 pages
Step-By-Step Install Guide OpenEMR On Linux Debian 5 Server
PDF
100% (1)
Step-By-Step Install Guide OpenEMR On Linux Debian 5 Server
24 pages
IT8761 Security Laboratory Manual P and OP
PDF
No ratings yet
IT8761 Security Laboratory Manual P and OP
54 pages
Practical No: 03 Use Step by Step Procedure For I.E. File Sharing & Printer Sharing
PDF
75% (4)
Practical No: 03 Use Step by Step Procedure For I.E. File Sharing & Printer Sharing
17 pages
Pega Foundation Financial Services
PDF
No ratings yet
Pega Foundation Financial Services
29 pages
IPSec Tunnel - Mikrotik to pfSense - ODλ Zero Dispersion
PDF
No ratings yet
IPSec Tunnel - Mikrotik to pfSense - ODλ Zero Dispersion
12 pages
Unix Tutorial (Web Version)
PDF
No ratings yet
Unix Tutorial (Web Version)
15 pages
S300, S500, S2700, S5700, and S6700 V200R023C00 Configuration Guide - Interface Management
PDF
No ratings yet
S300, S500, S2700, S5700, and S6700 V200R023C00 Configuration Guide - Interface Management
123 pages
F
PDF
No ratings yet
F
10 pages
OpenVPN - MikroTik Wiki PDF
PDF
0% (1)
OpenVPN - MikroTik Wiki PDF
12 pages
Kernel Compile
PDF
100% (3)
Kernel Compile
30 pages
IOKit Lib
PDF
No ratings yet
IOKit Lib
30 pages
Volvo
PDF
50% (4)
Volvo
128 pages
Kali-Linux Presentation
PDF
No ratings yet
Kali-Linux Presentation
8 pages
L-1.4 PALM Overview
PDF
No ratings yet
L-1.4 PALM Overview
13 pages
Object Conversion
PDF
No ratings yet
Object Conversion
17 pages
Vmware Material Shiva Computers
PDF
No ratings yet
Vmware Material Shiva Computers
150 pages
Visualizing 802.11 WireShark Data
PDF
No ratings yet
Visualizing 802.11 WireShark Data
30 pages
Kernel
PDF
100% (1)
Kernel
571 pages
READ ME FIRST - The eDW SupraSonic TD-17
PDF
No ratings yet
READ ME FIRST - The eDW SupraSonic TD-17
9 pages
كتاب تعلم لينكس للمبتدئين PDF
PDF
No ratings yet
كتاب تعلم لينكس للمبتدئين PDF
96 pages
2d Animation NC III
PDF
No ratings yet
2d Animation NC III
63 pages
SAP GUI - Understanding SAP GUI Historical Data - SAP Zero To Hero
PDF
No ratings yet
SAP GUI - Understanding SAP GUI Historical Data - SAP Zero To Hero
8 pages
PYTHON PROGRAMMING (M.Tech)
PDF
No ratings yet
PYTHON PROGRAMMING (M.Tech)
2 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
Advanced Nmap - NMap Script Scanning
PDF
No ratings yet
Advanced Nmap - NMap Script Scanning
5 pages
4.GE3171_SET5
PDF
No ratings yet
4.GE3171_SET5
4 pages
Bluetooth Tools
PDF
100% (1)
Bluetooth Tools
3 pages
Setup Authelia To Work With Nginx Proxy Manager
PDF
No ratings yet
Setup Authelia To Work With Nginx Proxy Manager
11 pages
IRIS Programmers Manual
PDF
No ratings yet
IRIS Programmers Manual
144 pages
Create Theme For Seamonkey
PDF
No ratings yet
Create Theme For Seamonkey
7 pages
POWERPOINT LECTURE NOTE FOR WEEK ONE and TWO
PDF
No ratings yet
POWERPOINT LECTURE NOTE FOR WEEK ONE and TWO
15 pages
6.5.1.2 Packet Tracer - Layer 2 Security - Instructor - Compressed
PDF
100% (1)
6.5.1.2 Packet Tracer - Layer 2 Security - Instructor - Compressed
10 pages
Commands For VLAN and MAC Address Configuration
PDF
No ratings yet
Commands For VLAN and MAC Address Configuration
39 pages
02 Linux Quick Start PDF
PDF
100% (1)
02 Linux Quick Start PDF
30 pages
DocFetcher Manual
PDF
No ratings yet
DocFetcher Manual
5 pages
Optiplex 3000 Thinclient Technical Guidebook
PDF
No ratings yet
Optiplex 3000 Thinclient Technical Guidebook
27 pages
FactoryTalk - Deleting The RNL Files PDF
PDF
No ratings yet
FactoryTalk - Deleting The RNL Files PDF
5 pages
Brute Force Attack - OWASP
PDF
No ratings yet
Brute Force Attack - OWASP
4 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
Frida Tutorial 2 - HackTricks
PDF
No ratings yet
Frida Tutorial 2 - HackTricks
7 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
Scanning Windows Deeper With The Nmap Scanning Engine: by Ron Bowes
PDF
No ratings yet
Scanning Windows Deeper With The Nmap Scanning Engine: by Ron Bowes
27 pages
Archiving
PDF
100% (1)
Archiving
13 pages
Trace Fry Sight Words 1
PDF
No ratings yet
Trace Fry Sight Words 1
24 pages
Redhat Linux Syllabus
PDF
No ratings yet
Redhat Linux Syllabus
6 pages
How To Integrate JasperReport With Oracle Apex 5.1 - v2
PDF
No ratings yet
How To Integrate JasperReport With Oracle Apex 5.1 - v2
44 pages
OpenOTP QuickStart
PDF
100% (1)
OpenOTP QuickStart
19 pages
Troubleshooting Nvivo: Windows 7 & Windows Vista
PDF
No ratings yet
Troubleshooting Nvivo: Windows 7 & Windows Vista
2 pages
Forensics and Incident Response-Question BANK - Fair For Students MCQQ
PDF
No ratings yet
Forensics and Incident Response-Question BANK - Fair For Students MCQQ
43 pages
Met ASP Lo It
PDF
No ratings yet
Met ASP Lo It
16 pages
An Introduction To Run-Levels
PDF
100% (1)
An Introduction To Run-Levels
17 pages
Lab01 Worksheet LM
PDF
No ratings yet
Lab01 Worksheet LM
5 pages
Hackthebox: Driver Machine Walkthrough: Produced by
PDF
No ratings yet
Hackthebox: Driver Machine Walkthrough: Produced by
11 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
Endian Firewall Administrators Guide
PDF
No ratings yet
Endian Firewall Administrators Guide
296 pages
Installation Kali Linux 2023
PDF
No ratings yet
Installation Kali Linux 2023
2 pages
EVE Images Credentials
PDF
No ratings yet
EVE Images Credentials
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
The Perfect Server - Debian 9 (Stretch) With Apache, BIND, Dovecot, PureFTPD and ISPConfig 3.1
PDF
No ratings yet
The Perfect Server - Debian 9 (Stretch) With Apache, BIND, Dovecot, PureFTPD and ISPConfig 3.1
20 pages
Lab Manual
PDF
No ratings yet
Lab Manual
16 pages
MSFvenom Metasploit Unleashed Level 1
PDF
No ratings yet
MSFvenom Metasploit Unleashed Level 1
9 pages
Beginners' Guide To Linux
PDF
No ratings yet
Beginners' Guide To Linux
9 pages
AS2421 Datasheet
PDF
No ratings yet
AS2421 Datasheet
2 pages
Red Hat Enterprise Linux 8 - RHCSA Syllabus
PDF
No ratings yet
Red Hat Enterprise Linux 8 - RHCSA Syllabus
5 pages
04 The IOS Operating System - Lab Exercises
PDF
No ratings yet
04 The IOS Operating System - Lab Exercises
13 pages
Linux Lab Exercise 12&3
PDF
No ratings yet
Linux Lab Exercise 12&3
6 pages
Lab Sheet 3
PDF
No ratings yet
Lab Sheet 3
8 pages
Introduction To Linux: Brandon Chisham May 15, 2004
PDF
No ratings yet
Introduction To Linux: Brandon Chisham May 15, 2004
67 pages
PortFast and UplinkFast
PDF
No ratings yet
PortFast and UplinkFast
8 pages
Snorby Installation Guide
PDF
No ratings yet
Snorby Installation Guide
7 pages
Basic Red Hat Linux
PDF
No ratings yet
Basic Red Hat Linux
5 pages
Linux Books
PDF
No ratings yet
Linux Books
2 pages
Mastering Active Directory
From Everand
Mastering Active Directory
VICTOR P HENDERSON
No ratings yet
Trackpad Ver. 2.0 Class 4
From Everand
Trackpad Ver. 2.0 Class 4
Nidhi Arora
No ratings yet