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)
201 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
Share
0%
0% found this document useful, undefined
0%
, undefined
Print
Embed
Report
0 ratings
0% found this document useful (0 votes)
201 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
Share
0%
0% found this document useful, undefined
0%
, undefined
Print
Embed
Report
Download
Save kali linux commands For Later
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
Linux Basics For Hackers v2 Compress
PDF
0% (1)
Linux Basics For Hackers v2 Compress
6 pages
FreeBSD Book PDF
PDF
No ratings yet
FreeBSD Book PDF
678 pages
Stormshield - Institute - CSNA Prerequisites Test - Exercices
PDF
No ratings yet
Stormshield - Institute - CSNA Prerequisites Test - Exercices
6 pages
Xper IM Advanced System Administrator Training Course - Before 4-24-12 Class
PDF
No ratings yet
Xper IM Advanced System Administrator Training Course - Before 4-24-12 Class
676 pages
Windows Server 2012 R2 Hyper-V Network Virtualization With System Center 2012 R2 VMM Test Lab - RTM
PDF
No ratings yet
Windows Server 2012 R2 Hyper-V Network Virtualization With System Center 2012 R2 VMM Test Lab - RTM
137 pages
Online Loan Application and Verification 2016
PDF
No ratings yet
Online Loan Application and Verification 2016
34 pages
Termux PDF
PDF
No ratings yet
Termux PDF
2 pages
CNC Controller Tc55xx User Manual Ru
PDF
No ratings yet
CNC Controller Tc55xx User Manual Ru
28 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
Debian Server Book
PDF
No ratings yet
Debian Server Book
147 pages
06-Mounting and Unmounting Filesystems
PDF
No ratings yet
06-Mounting and Unmounting Filesystems
19 pages
AnSec2 0
PDF
No ratings yet
AnSec2 0
32 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
Vulnhub
PDF
No ratings yet
Vulnhub
7 pages
Integrate ShellGPT in Parrot Security Machine
PDF
No ratings yet
Integrate ShellGPT in Parrot Security Machine
5 pages
Kali Linux Installation
PDF
No ratings yet
Kali Linux Installation
12 pages
Android Forensic With Autopsy
PDF
No ratings yet
Android Forensic With Autopsy
9 pages
Objectifs LPIC2 v4.5
PDF
No ratings yet
Objectifs LPIC2 v4.5
38 pages
IPSec Tunnel - Mikrotik to pfSense - ODλ Zero Dispersion
PDF
No ratings yet
IPSec Tunnel - Mikrotik to pfSense - ODλ Zero Dispersion
12 pages
Nbte Syllabus
PDF
No ratings yet
Nbte Syllabus
8 pages
Final Project-Exploiting An Android Device
PDF
No ratings yet
Final Project-Exploiting An Android Device
7 pages
Anonguide
PDF
No ratings yet
Anonguide
437 pages
Linux Administration
PDF
No ratings yet
Linux Administration
18 pages
Term Paper Linking Words
PDF
100% (1)
Term Paper Linking Words
6 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
Host
PDF
No ratings yet
Host
48 pages
Dell Emc Networker Module For Databases and Applications: Installation Guide
PDF
No ratings yet
Dell Emc Networker Module For Databases and Applications: Installation Guide
44 pages
DEF CON Safe Mode - Cooper Quintin - Detecting Fake 4G Base Stations in Real Time
PDF
No ratings yet
DEF CON Safe Mode - Cooper Quintin - Detecting Fake 4G Base Stations in Real Time
48 pages
AJP Practicals: Practical 1
PDF
No ratings yet
AJP Practicals: Practical 1
37 pages
FMS Deployment Guide For Linux
PDF
No ratings yet
FMS Deployment Guide For Linux
19 pages
Swupd Bundle-Add Clearlinux-On-Wsl2
PDF
No ratings yet
Swupd Bundle-Add Clearlinux-On-Wsl2
6 pages
Freeradius3 0 3onubuntu14 04lts
PDF
No ratings yet
Freeradius3 0 3onubuntu14 04lts
21 pages
كتاب تعلم لينكس للمبتدئين PDF
PDF
No ratings yet
كتاب تعلم لينكس للمبتدئين PDF
96 pages
FortiAuthenticator FSSO Authentication User Guide
PDF
No ratings yet
FortiAuthenticator FSSO Authentication User Guide
53 pages
Redhat Linux Syllabus
PDF
No ratings yet
Redhat Linux Syllabus
6 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
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
MSFvenom Metasploit Unleashed Level 1
PDF
No ratings yet
MSFvenom Metasploit Unleashed Level 1
9 pages
UNOPS - Travel Management Services
PDF
No ratings yet
UNOPS - Travel Management Services
35 pages
Pfsense Basic Configuration
PDF
No ratings yet
Pfsense Basic Configuration
19 pages
Install LAMP Server (Apache, MariaDB, PHP) On CentOS, RHEL, Scientific Linux 6.5 - 6.4 - 6
PDF
No ratings yet
Install LAMP Server (Apache, MariaDB, PHP) On CentOS, RHEL, Scientific Linux 6.5 - 6.4 - 6
9 pages
Binomial Theorem and Its Applications
PDF
No ratings yet
Binomial Theorem and Its Applications
3 pages
Li - Fi Ppt-By Sampath
PDF
No ratings yet
Li - Fi Ppt-By Sampath
19 pages
Zappavigna 2016 Social Media Photography Construing Subjectivity in Instagram Images
PDF
No ratings yet
Zappavigna 2016 Social Media Photography Construing Subjectivity in Instagram Images
22 pages
PP APR-18 (Sol) (E-Next - In)
PDF
No ratings yet
PP APR-18 (Sol) (E-Next - In)
22 pages
Application of IDEF0, IDEF3 and UML Meth Odologies in The Creation of in Formation Models
PDF
No ratings yet
Application of IDEF0, IDEF3 and UML Meth Odologies in The Creation of in Formation Models
16 pages
#CTFs
PDF
No ratings yet
#CTFs
6 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
Intro To Oas
PDF
No ratings yet
Intro To Oas
31 pages
Introduction To Linux: Brandon Chisham May 15, 2004
PDF
No ratings yet
Introduction To Linux: Brandon Chisham May 15, 2004
67 pages
ECRS PROJECT Correct
PDF
No ratings yet
ECRS PROJECT Correct
11 pages
Driving Cad With Mathcad:: Engineering Calculations Made Easy and Accessible
PDF
No ratings yet
Driving Cad With Mathcad:: Engineering Calculations Made Easy and Accessible
13 pages
Lab Manual
PDF
No ratings yet
Lab Manual
16 pages
ADFS Design Considerations and Deployment Options
PDF
No ratings yet
ADFS Design Considerations and Deployment Options
12 pages
Authentication, Authorization & Accounting With Free Radius & Mysql Backend & Web Based
PDF
No ratings yet
Authentication, Authorization & Accounting With Free Radius & Mysql Backend & Web Based
10 pages
Lab - Hardening A Linux System
PDF
No ratings yet
Lab - Hardening A Linux System
5 pages
Pfsense Training - 2
PDF
No ratings yet
Pfsense Training - 2
32 pages
Logrhythm Na Alphabet Soup Making Sense of XDR Edr NDR and Siem e Book
PDF
No ratings yet
Logrhythm Na Alphabet Soup Making Sense of XDR Edr NDR and Siem e Book
12 pages
Met ASP Lo It
PDF
No ratings yet
Met ASP Lo It
16 pages
Bwapp Training
PDF
No ratings yet
Bwapp Training
27 pages
Lab 2 Part 2
PDF
No ratings yet
Lab 2 Part 2
13 pages
Top 100 Most Repeated Microsoft Word Mcqs Set-1
PDF
100% (1)
Top 100 Most Repeated Microsoft Word Mcqs Set-1
32 pages
Apks Count List
PDF
No ratings yet
Apks Count List
6 pages
FortiGate VM ESXi
PDF
No ratings yet
FortiGate VM ESXi
8 pages
Optiplex 3000 Thinclient Technical Guidebook
PDF
No ratings yet
Optiplex 3000 Thinclient Technical Guidebook
27 pages
NPS International School-2
PDF
No ratings yet
NPS International School-2
13 pages
Installation Kali Linux 2023
PDF
No ratings yet
Installation Kali Linux 2023
2 pages
What Is The Difference Between Content Based Filtering and Collaborative Filtering - Quora
PDF
No ratings yet
What Is The Difference Between Content Based Filtering and Collaborative Filtering - Quora
5 pages
Specialized Full Stack Software Developer Training Introduction Series 01
PDF
No ratings yet
Specialized Full Stack Software Developer Training Introduction Series 01
16 pages
2010 Level2 Solutions
PDF
No ratings yet
2010 Level2 Solutions
11 pages
Pipenv Documentation: Release 2018.11.27.dev0
PDF
No ratings yet
Pipenv Documentation: Release 2018.11.27.dev0
74 pages
ATHENA Project Report I
PDF
No ratings yet
ATHENA Project Report I
8 pages
PortFast and UplinkFast
PDF
No ratings yet
PortFast and UplinkFast
8 pages
ANNEX 10 Annual Implementation Plan Template
PDF
100% (1)
ANNEX 10 Annual Implementation Plan Template
13 pages
Java Hello World Example - Simple Program of Java - Javatpoint
PDF
No ratings yet
Java Hello World Example - Simple Program of Java - Javatpoint
1 page
KVM
PDF
No ratings yet
KVM
12 pages
Hardware Hacking
PDF
100% (2)
Hardware Hacking
16 pages
Networking Commands
PDF
No ratings yet
Networking Commands
7 pages
Brute Force Attack - OWASP
PDF
No ratings yet
Brute Force Attack - OWASP
4 pages
Asterisk CDR Mysql
PDF
No ratings yet
Asterisk CDR Mysql
11 pages
Raunak Resume
PDF
No ratings yet
Raunak Resume
1 page
Common Tools and Methods Used in Vulnhub CTF's
PDF
No ratings yet
Common Tools and Methods Used in Vulnhub CTF's
4 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
ONTAP 9.10.1 Performance Tech Spec
PDF
No ratings yet
ONTAP 9.10.1 Performance Tech Spec
1 page
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
Linux Lab Exercise 12&3
PDF
No ratings yet
Linux Lab Exercise 12&3
6 pages
Unix / Linux FAQ: with Tips to Face Interviews
From Everand
Unix / Linux FAQ: with Tips to Face Interviews
Prof. N.B. Venkateswarlu
No ratings yet
Mastering Netscaler VPX: Learn how to deploy and configure all the available Citrix NetScaler features with the best practices and techniques you need to know
From Everand
Mastering Netscaler VPX: Learn how to deploy and configure all the available Citrix NetScaler features with the best practices and techniques you need to know
Marius Sandbu
No ratings yet
Trackpad Ver. 2.0 Class 4
From Everand
Trackpad Ver. 2.0 Class 4
Nidhi Arora
No ratings yet