Address
:
[go:
up one dir
,
main page
]
Include Form
Remove Scripts
Session Cookies
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 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)
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 now
Download
Save kali linux commands For Later
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
Nature of the Firm
PDF
No ratings yet
Nature of the Firm
207 pages
Natural Language Processing With Python Cookbook 1st Edition Krishna Bhavsar Download PDF
PDF
100% (8)
Natural Language Processing With Python Cookbook 1st Edition Krishna Bhavsar Download PDF
38 pages
Personal Voice Assistant
PDF
100% (1)
Personal Voice Assistant
118 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
Enumerating Esoteric Attack Surfaces by Jann Moon
PDF
No ratings yet
Enumerating Esoteric Attack Surfaces by Jann Moon
196 pages
Server Guide
PDF
No ratings yet
Server Guide
264 pages
Android Forensic With Autopsy
PDF
No ratings yet
Android Forensic With Autopsy
9 pages
Os Command Injections eBook
PDF
No ratings yet
Os Command Injections eBook
21 pages
Kali-Linux Presentation
PDF
No ratings yet
Kali-Linux Presentation
8 pages
كتاب تعلم لينكس للمبتدئين PDF
PDF
No ratings yet
كتاب تعلم لينكس للمبتدئين PDF
96 pages
Download full The Poverty of Critical Theory in International Relations Davide Schmid ebook all chapters
PDF
100% (1)
Download full The Poverty of Critical Theory in International Relations Davide Schmid ebook all chapters
51 pages
Brainkart_Programming in C - CS3251 - Important Questions With Answer - Unit 5 - File Processing.bin
PDF
No ratings yet
Brainkart_Programming in C - CS3251 - Important Questions With Answer - Unit 5 - File Processing.bin
7 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
OpenVPN - MikroTik Wiki PDF
PDF
0% (1)
OpenVPN - MikroTik Wiki PDF
12 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
Optiplex 3000 Thinclient Technical Guidebook
PDF
No ratings yet
Optiplex 3000 Thinclient Technical Guidebook
27 pages
Vmware Material Shiva Computers
PDF
No ratings yet
Vmware Material Shiva Computers
150 pages
Unix Tutorial (Web Version)
PDF
No ratings yet
Unix Tutorial (Web Version)
15 pages
How to Train Your Dragon
PDF
No ratings yet
How to Train Your Dragon
24 pages
Case Digest Part 2
PDF
0% (1)
Case Digest Part 2
50 pages
F
PDF
No ratings yet
F
10 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
Kernel Compile
PDF
100% (3)
Kernel Compile
30 pages
Snort 3 User Manual
PDF
100% (1)
Snort 3 User Manual
103 pages
Full Report Li-Muhammad Badrul Amin Bin Borhan (B061810062)
PDF
No ratings yet
Full Report Li-Muhammad Badrul Amin Bin Borhan (B061810062)
43 pages
Setup Authelia To Work With Nginx Proxy Manager
PDF
No ratings yet
Setup Authelia To Work With Nginx Proxy Manager
11 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
Integrate ShellGPT in Parrot Security Machine
PDF
No ratings yet
Integrate ShellGPT in Parrot Security Machine
5 pages
Kernel
PDF
100% (1)
Kernel
571 pages
Visualizing 802.11 WireShark Data
PDF
No ratings yet
Visualizing 802.11 WireShark Data
30 pages
AMS Licensure Reviewer's Guide
PDF
No ratings yet
AMS Licensure Reviewer's Guide
1 page
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
IPSec Tunnel - Mikrotik to pfSense - ODλ Zero Dispersion
PDF
No ratings yet
IPSec Tunnel - Mikrotik to pfSense - ODλ Zero Dispersion
12 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
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
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
Frida Tutorial 2 - HackTricks
PDF
No ratings yet
Frida Tutorial 2 - HackTricks
7 pages
Red Hat Enterprise Linux 8 - RHCSA Syllabus
PDF
No ratings yet
Red Hat Enterprise Linux 8 - RHCSA Syllabus
5 pages
TOPIC 1 - Overview of Financial Management
PDF
No ratings yet
TOPIC 1 - Overview of Financial Management
32 pages
Mini 4WD Setup Guide - TAMIYA
PDF
No ratings yet
Mini 4WD Setup Guide - TAMIYA
4 pages
04 The IOS Operating System - Lab Exercises
PDF
No ratings yet
04 The IOS Operating System - Lab Exercises
13 pages
10 003591 01EN FlexoFORM User PDF
PDF
No ratings yet
10 003591 01EN FlexoFORM User PDF
86 pages
MSFvenom Metasploit Unleashed Level 1
PDF
No ratings yet
MSFvenom Metasploit Unleashed Level 1
9 pages
OpenOTP QuickStart
PDF
100% (1)
OpenOTP QuickStart
19 pages
02-Common Data Service Lab Manual
PDF
No ratings yet
02-Common Data Service Lab Manual
51 pages
An Introduction To Run-Levels
PDF
100% (1)
An Introduction To Run-Levels
17 pages
4HP16
PDF
100% (4)
4HP16
241 pages
02 Linux Quick Start PDF
PDF
100% (1)
02 Linux Quick Start PDF
30 pages
Reply To Enquiry
PDF
No ratings yet
Reply To Enquiry
16 pages
PortFast and UplinkFast
PDF
No ratings yet
PortFast and UplinkFast
8 pages
Introduction To Linux: Brandon Chisham May 15, 2004
PDF
No ratings yet
Introduction To Linux: Brandon Chisham May 15, 2004
67 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
Commands For VLAN and MAC Address Configuration
PDF
No ratings yet
Commands For VLAN and MAC Address Configuration
39 pages
Future_Requirement_of_Materials__-_Deep_Drilling
PDF
No ratings yet
Future_Requirement_of_Materials__-_Deep_Drilling
7 pages
Linux Lab Exercise 12&3
PDF
No ratings yet
Linux Lab Exercise 12&3
6 pages
Advanced Nmap - NMap Script Scanning
PDF
No ratings yet
Advanced Nmap - NMap Script Scanning
5 pages
Lab Sheet 3
PDF
No ratings yet
Lab Sheet 3
8 pages
Information and Communication Technology 10: Maintaining Computer and Network System
PDF
No ratings yet
Information and Communication Technology 10: Maintaining Computer and Network System
8 pages
Snorby Installation Guide
PDF
No ratings yet
Snorby Installation Guide
7 pages
Bfi 4301 Financial Management
PDF
No ratings yet
Bfi 4301 Financial Management
3 pages
Charles Correa: Presented By: Rilarympei Marbaniang
PDF
No ratings yet
Charles Correa: Presented By: Rilarympei Marbaniang
38 pages
Brute Force Attack - OWASP
PDF
No ratings yet
Brute Force Attack - OWASP
4 pages
Solution: PS04CGEN21: Recombinant DNA Technology
PDF
No ratings yet
Solution: PS04CGEN21: Recombinant DNA Technology
8 pages
Redhat Linux Syllabus
PDF
No ratings yet
Redhat Linux Syllabus
6 pages
5-Fineness of Cement
PDF
No ratings yet
5-Fineness of Cement
3 pages
Lab Manual
PDF
No ratings yet
Lab Manual
16 pages
Civil Appeal 60 of 2019
PDF
No ratings yet
Civil Appeal 60 of 2019
7 pages
Hackthebox: Driver Machine Walkthrough: Produced by
PDF
No ratings yet
Hackthebox: Driver Machine Walkthrough: Produced by
11 pages
AS2421 Datasheet
PDF
No ratings yet
AS2421 Datasheet
2 pages
Met ASP Lo It
PDF
No ratings yet
Met ASP Lo It
16 pages
Lesson 3
PDF
No ratings yet
Lesson 3
8 pages
JNTU - Neural Network
PDF
No ratings yet
JNTU - Neural Network
5 pages
(DOC) MGA MATALINHAGANG SALITA - RIN MEIJI - Academia - Edu
PDF
No ratings yet
(DOC) MGA MATALINHAGANG SALITA - RIN MEIJI - Academia - Edu
1 page
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
Stainless Steel in The Pharmaceutical Food and Beverages Industries PDF
PDF
No ratings yet
Stainless Steel in The Pharmaceutical Food and Beverages Industries PDF
2 pages
Bluetooth Tools
PDF
100% (1)
Bluetooth Tools
3 pages
Teorema de Helmoltz
PDF
No ratings yet
Teorema de Helmoltz
4 pages
4 Motion in A Plane-PYQ
PDF
No ratings yet
4 Motion in A Plane-PYQ
3 pages
Beginners' Guide To Linux
PDF
No ratings yet
Beginners' Guide To Linux
9 pages
ENROLLMENT-FORM Blank Write
PDF
No ratings yet
ENROLLMENT-FORM Blank Write
1 page
Skeletal System Grade 4
PDF
90% (10)
Skeletal System Grade 4
3 pages
Linux Books
PDF
No ratings yet
Linux Books
2 pages
Brittany Neal Resume
PDF
No ratings yet
Brittany Neal Resume
2 pages
Basic Red Hat Linux
PDF
No ratings yet
Basic Red Hat Linux
5 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
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