Linux Fundamental
Linux Fundamental
Directory Description
/ The root directory. All files and directories in Linux are located under this
directory.
/bin Essential binary executables for all users (e.g., ls, cat, cp).
/boot Files required to boot the system (e.g., kernel, GRUB configuration).
/dev Device files (e.g., /dev/sda1 for a hard drive, /dev/null).
/etc Configuration files for system-wide settings (e.g., network, users,
services).
/home User-specific directories for personal files (e.g., /home/username).
/lib Essential libraries required by binaries in /bin and /sbin.
/media Temporary mount points for removable devices like USB drives.
/mnt Temporary mount point for manually mounting file systems.
/opt Optional software and third-party applications.
/proc Virtual directory containing system and process information (e.g., CPU,
memory stats).
/root The home directory for the root user (administrator).
/run Temporary runtime data (e.g., process IDs, sockets).
/sbin System administration binaries (e.g., fsck, reboot, ifconfig).
/srv Data for services provided by the system (e.g., web server files).
/sys Virtual directory for system hardware information.
/tmp Temporary files, often cleaned on reboot.
/usr User applications and utilities (e.g., /usr/bin, /usr/lib).
/var Variable files like logs, cache, and spool directories
Advanced Interactions:
Use find and grep for locating files and content, respectively.
Combine with wildcards (*, ?) for more dynamic operations.
Manipulate permissions with chmod and ownership with chown
Searching through files;;
find /path/to/search -name "filename"
-type f
-type d
find / -type f -name "*flag*" 2>/dev/null
Background execution
long_task.sh &
Command substitution
use $()
echo "Today is $(date)"
System Information:
Display system information:
uname -a
df -h
free -h
Process Management:
ps aux
Find a specific process:
kill -9 PID
Networking:
netstat -tuln
Check connectivity:
ping -c 4 hostname
ip addr
gzip file
gunzip file.gz
Package Management:
Install a package:
Remove a package:
less file
head file
tail file
TRYHACKME ROOMS;;
Linux fundamentals 1 and 2
https://overthewire.org