Linux Fundamentals
Navigation
Basic Commands
pwd
: Print Working Directory. Shows the current directory path.
ls
: List directory contents.
cd
: Change Directory.
Path Types
Absolute Path: Begins from the root directory (/
).
Relative Path: Begins from the current directory.
File Operations
Creation
touch
: Create an empty file.
mkdir
: Create a new directory.
Deletion
rm
: Remove a file.
rmdir
: Remove an empty directory.
rm -r
: Remove a directory and its contents recursively.
Moving
mv
: Move or rename a file or directory.
Copying
cp
: Copy a file.
cp -r
: Copy a directory and its contents.
Logs and Permissions
Logs
- System logs are usually stored in
/var/log/
. - View logs using
cat
,less
, ortail
.
TTY and Bash Basics
Bash
- Bash is the default shell in many Linux distributions.
- Scripts are executed in the shell using
bash scriptname.sh
.
Keyboard Shortcuts
Ctrl + C
: Terminate the current running process.Tab
: Autocomplete commands and filenames.
Partitions
- Partitions divide a hard disk into separate sections.
- View partitions using
lsblk
orfdisk -l
.
SSH (Secure Shell)
ssh
: Connect to a remote machine.
curl
and wget
curl
: Transfer data from or to a server.
wget
: Retrieve files from the web.