โฑ 5:00 remaining
Linux Command Line Basics
1 Global Definitions
- Linux: An open-source operating system widely used in servers, security, and development environments.
- Command Line Interface (CLI): A text-based interface for interacting with the operating system by typing commands.
- Shell: The program that interprets and executes commands (e.g.,
bash
,zsh
).
1.1 File & Directory Commands
Navigation
Move through the filesystem using these commands:
pwd
โ print working directoryls
โ list files and directoriescd /path
โ change directory
File Operations
Create, view, and delete files.
touch file.txt
โ create filecat file.txt
โ view contentsrm file.txt
โ remove file
Directory Operations
Manage folders within the filesystem.
mkdir folder
โ create directoryrmdir folder
โ remove empty directoryrm -r folder
โ remove directory recursively
1.2 File Permissions
Viewing Permissions
Check who can read, write, or execute files.
ls -l
โ displays file permissions- Format:
-rwxr-xr--
Changing Permissions
Modify access rights.
chmod 755 script.sh
- rwx
Changing Ownership
Assign file ownership to users or groups.
chown user file.txt
chgrp group file.txt
1.3 Process Management
Monitoring
View running processes.
ps aux
โ list processestop
orhtop
โ live monitoring
Managing Processes
Start, stop, and control processes.
kill PID
โ terminate processkill -9 PID
โ force stop processjobs
,fg
,bg
โ control jobs
1.4 Networking Basics
Network Configuration
Check and configure IP addresses.
ifconfig
orip addr
ping host
โ test connectivitynetstat -tuln
โ view open ports
File Transfer
Send and receive files over the network.
scp file user@host:/path
rsync -av file user@host:/path
1.5 Why Linux CLI Matters
The Linux command line gives users full control over the system, enabling efficient file management, process monitoring, and network configuration. For cybersecurity professionals, mastering the CLI is critical for penetration testing, digital forensics, and server administration.