Linux Terminal Basics - Master Essential Commands in 2 Minutes | ls, cd, pwd, chmod
Video: Linux Terminal Basics - Master Essential Commands in 2 Minutes | ls, cd, pwd, chmod by Taught by Celeste AI - AI Coding Coach
Watch full page →Linux Terminal Basics - Master Essential Commands in 2 Minutes
Learn the foundational Linux terminal commands to navigate the file system, list files, and manage file permissions. This guide covers essential commands like ls, cd, pwd, and chmod to help you work efficiently in the terminal.
Code
# List files and directories in current folder
ls
# List all files including hidden ones, with detailed info
ls -la
# Show current directory path
pwd
# Display current logged-in user
whoami
# Change directory to /usr/local
cd /usr/local
# Move up one directory level (parent directory)
cd ..
# Go to your home directory
cd ~
# or simply
cd
# Switch back to previous directory
cd -
# View detailed file permissions for files
ls -l
# Change file permissions using numeric mode:
# 644 = owner read/write, group read, others read
chmod 644 filename.txt
# 755 = owner read/write/execute, group and others read/execute
chmod 755 script.sh
Key Points
lslists files;ls -lashows all files including hidden ones with details.pwddisplays your current directory, andwhoamishows your user name.cdchanges directories; usecd ..to go up,cd ~orcdto go home.- File permissions are shown as
rwxfor owner, group, and others, controlling read, write, and execute rights. chmodchanges permissions using numeric codes like 644 (read/write) and 755 (executable).