Overview: A guide to essential Linux commands for cybersecurity tasks.
Linux is the preferred operating system in cybersecurity due to its flexibility and open-source nature.
1.File and Directory Management:
Lists directory contents.
`ls`:
Changes directory.
cd <directory>
Prints current directory.
pwd
Create a new directory.
mkdir <directory>
Remove an empty directory.
rmdir <directory>
Remove a file.
rm <file>
Copy a file or directory.
cp <source> <destination>
Move or rename a file or directory.
mv <source> <destination>
Display the contents of a file.
cat <file>
2. System Information:
Display system information.
uname -a
Display running processes.
top
Show disk space usage.
df -h
Show memory usage.
free -h
Display the current logged-in user.
whoami
3. Networking:
Display network interfaces
ifconfig
Show all network interfaces.
ip a
Send ICMP echo requests to a host.
ping <host>
Trace the route packets take to a network host.
traceroute <host>
Show listening ports and network connections.
netstat -tuln
4. Package Management:
Update package lists.
apt update
Upgrade installed packages.
apt upgrade
Install a new package.
apt install <package>
Remove a package.
apt remove <package>
5. Permissions:
Change file permissions.
chmod <permissions> <file>
Change file ownership.
chown <user>:<group> <file>
6. Text Processing:
Search for a pattern in a file.
grep <pattern> <file>
Display text to the terminal.
echo <text>
Open a file in the Nano text editor.
nano <file>