Back to Blog

Linux Terminal Basics - Master Essential Commands in 2 Minutes | ls, cd, pwd, chmod

Sandy LaneSandy Lane

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

  • ls lists files; ls -la shows all files including hidden ones with details.
  • pwd displays your current directory, and whoami shows your user name.
  • cd changes directories; use cd .. to go up, cd ~ or cd to go home.
  • File permissions are shown as rwx for owner, group, and others, controlling read, write, and execute rights.
  • chmod changes permissions using numeric codes like 644 (read/write) and 755 (executable).