Skip to content

Latest commit

Β 

History

History
148 lines (133 loc) Β· 2.2 KB

Linux Commands.md

File metadata and controls

148 lines (133 loc) Β· 2.2 KB

Linux Commands

Overview: A guide to essential Linux commands for cybersecurity tasks.

Table of Contents


Introduction to Linux

Linux is the preferred operating system in cybersecurity due to its flexibility and open-source nature.

Basic Commands

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>

Resources