Essential Linux Commands for
Terraform Practice (Debian)
This sheet includes all the basic and necessary Linux commands you need to comfortably
practice and work with Terraform on a Debian-based system.
1. System Navigation
pwd # Show current working directory
ls # List files and folders
ls -l # Long listing format with permissions
cd <dir> # Change to a directory
cd ~ # Go to home directory
cd / # Go to root directory
cd .. # Go one directory up
2. Root Access and sudo
sudo <command> # Run a command with root privileges
sudo -i # Switch to root user (interactive shell)
exit # Exit from root or current shell session
3. File and Directory Management
mkdir <dir> # Create a new directory
mkdir -p a/b/c # Create nested directories
touch <file> # Create a new empty file
nano <file> # Open file in nano editor
cat <file> # View file content
rm <file> # Remove a file
rm -r <dir> # Remove a directory recursively
mv <src> <dest> # Move or rename a file or directory
cp <src> <dest> # Copy a file or folder
4. Permissions and Ownership
ls -l # See file permissions
chmod 755 <file> # Change file permissions (rwxr-xr-x)
chown user:user <file> # Change ownership to user
5. Networking (for installing Terraform)
sudo apt update # Update package lists
sudo apt install <pkg> # Install a package
curl -fsSL <url> # Download from URL (used in Terraform install)
6. Terraform Workflow (Basic)
terraform init # Initialize terraform in working directory
terraform validate # Validate syntax
terraform plan # See the execution plan
terraform apply # Apply changes (infrastructure create/update)
terraform destroy # Destroy created infrastructure
7. Git Basics (Optional but useful)
git init # Initialize a new git repo
git add . # Add all files to staging
git commit -m "message" # Commit with a message
git status # Check current status
git log # Show commit history
Use these commands to manage your Linux system while creating Terraform files, saving
project versions, and running cloud infrastructure experiments.