DEV Community

UyiGodfrey
UyiGodfrey

Posted on

Linux Commands I Wish I Knew When I Started

When I first started learning DevOps, the Linux terminal felt intimidating. I didn’t know where to begin or what commands to trust. But after some trial and error, a few simple commands became my everyday tools — and they made all the difference.

Here are the Linux basics that helped me survive and thrive:

  1. ls — List files Use this to see what's in the current folder. It's like opening a folder in your file explorer.
ls
Enter fullscreen mode Exit fullscreen mode

Tip:

  • ls -l shows details (like size and date).

  • ls -a reveals hidden files.

  1. cd — Change directory Move around your file system easily. Think of it like “entering” a folder.
cd foldername
Enter fullscreen mode Exit fullscreen mode

Useful shortcuts:

  • cd .. goes back one level

  • cd / takes you to the root directory

  • cd ~ brings you to your home folder

  1. pwd — Show where you are This command tells you your exact location in the file system.
pwd
Enter fullscreen mode Exit fullscreen mode

It’s very useful when you're deep in folders and need to double-check your path.

  1. touch and mkdir — Create files and folders Quick ways to build your environment.
touch filename.txt      # creates a file
mkdir myfolder          # creates a new directory
Enter fullscreen mode Exit fullscreen mode

These are great for practice or creating test setups.

  1. sudo — Run with admin power (carefully!) Some commands need special privileges. sudo gives you those powers (like an admin mode).
sudo command
Enter fullscreen mode Exit fullscreen mode

Example:

sudo apt update
Enter fullscreen mode Exit fullscreen mode

⚠️ Be careful with sudo. It can change important system files.

Bonus: Combine them like a pro
You can chain commands to get more done in one line. For example:

sudo mkdir /opt/myfolder && cd /opt/myfolder
Enter fullscreen mode Exit fullscreen mode

This creates a folder with superuser access and instantly moves you into it.

Top comments (0)