The Rabbit Hole of Linux Commands

Published: (January 18, 2026 at 02:07 AM EST)
2 min read
Source: Dev.to

Source: Dev.to

Introduction

When your system’s storage is completely filled, performance degrades and you need to free space. Linux provides a set of commands that let you inspect, manage, and clean up files and directories efficiently.

Basic Navigation Commands

pwd

Displays the present working directory, helping you confirm where you are before removing files.

ls

Lists the contents of the current directory. Use options such as -l for a detailed view or -a to include hidden files.

cd

Changes the current directory.

  • cd ..         Moves to the parent directory.
  • cd ~ or simply cd  Returns to the user’s home directory.
  • cd /         Moves to the root of the filesystem.
  • cd -         Returns to the previous directory.

File Manipulation Commands

touch file.txt

Creates an empty file named file.txt (or updates the timestamp if it already exists).

mkdir directory_name

Creates a new directory.

rmdir directory_name

Removes an empty directory.

rm

Deletes files or directories.

  • rm file.txt    Removes a single file.
  • rm -r directory  Recursively removes a directory and its contents.
  • rm -rf directory  Force‑removes a directory without prompting.
  • rm -rf .git    Commonly used to delete a Git repository folder.

cat file.txt

Outputs the contents of file.txt to the terminal.

Network Commands

curl

curl sends HTTP requests from the command line and displays the response.

Example: Register a test user via an API

curl -X POST http://localhost:3000/api/auth/signup \
  -H "Content-Type: application/json" \
  -d '{
    "email": "test@example.com",
    "password": "Test@123",
    "fullName": "Test User"
  }'
  • -X POST Specifies the request method (POST in this case).
  • -H "Content-Type: application/json" Sets the request header to indicate JSON payload.
  • -d '{...}' Provides the JSON data sent in the request body.

Visual Reference

Linux command illustration


This is the first entry in the Rabbit Hole series on Linux. We covered basic file‑system commands for cleaning up space and introduced curl for API testing. Future posts will explore curl in greater depth and demonstrate additional powerful Linux utilities.

Back to Blog

Related posts

Read more »

Terminal Commands 💻⚡

!Cover image for Terminal Commands 💻⚡https://media2.dev.to/dynamic/image/width=1000,height=420,fit=cover,gravity=auto,format=auto/https%3A%2F%2Fdev-to-uploads....

A Linux Tutorial: Log to CSV to JSON

Overview This tutorial walks through the process of converting raw application logs into structured JSON data. The workflow is useful for generating test data...