Linux Command Line: The Complete Cheat Sheet

If you work in tech, you will use the Linux command line. It's not optional. Whether you're SSH-ing into a server, debugging a Docker container, or just trying to find that one log file buried thre...

By · · 1 min read
Linux Command Line: The Complete Cheat Sheet

Source: DEV Community

If you work in tech, you will use the Linux command line. It's not optional. Whether you're SSH-ing into a server, debugging a Docker container, or just trying to find that one log file buried three directories deep, these commands are the bedrock of your workflow. I've distilled 100+ essential commands into this single reference. Print it, tape it to your monitor, and watch your Stack Overflow searches drop by half. Navigation & Directory Management pwd # Print working directory cd ~ # Go to home directory cd - # Go to previous directory cd ../.. # Go up two levels ls # List files ls -la # List all files (including hidden) with details ls -lh # Human-readable file sizes ls -lt # Sort by modification time (newest first) tree # Visual directory tree tree -L 2 # Tree limited to 2 levels deep pushd /var/log # Push directory onto stack & cd into it popd # Pop directory off stack & return File & Directory Operations touch file.txt # Create empty file / update timesta