Skip to content
-
Learn Cybersecurity & Ethical Hacking in Nepal with CyberSamir — Start Learning →
Cyber Samir Cyber Samir Cyber Samir

Learn Cybersecurity, Ethical Hacking & Bug Bounty in Nepal

Cyber Samir Cyber Samir Cyber Samir

Learn Cybersecurity, Ethical Hacking & Bug Bounty in Nepal

  • Home
  • About Us
  • Blogs
    • Ethical Hacking
    • Cybersecurity
    • Penetration testing
  • Tools
    • Phishing email Detector tool
    • Website Security Checker Tool
    • Age|Face Shape|Expression Guess
    • Text Cleaner Tool
    • Image Converter & Resizer Tool (Free Online)
  • Contact Us
  • Home
  • About Us
  • Blogs
    • Ethical Hacking
    • Cybersecurity
    • Penetration testing
  • Tools
    • Phishing email Detector tool
    • Website Security Checker Tool
    • Age|Face Shape|Expression Guess
    • Text Cleaner Tool
    • Image Converter & Resizer Tool (Free Online)
  • Contact Us
Close

Search

Subscribe
  • Facebook
  • Telegram
  • Instagram
  • Youtube
  • Linkedin
  • Whasapp
Cyber Samir Cyber Samir Cyber Samir

Learn Cybersecurity, Ethical Hacking & Bug Bounty in Nepal

Cyber Samir Cyber Samir Cyber Samir

Learn Cybersecurity, Ethical Hacking & Bug Bounty in Nepal

  • Home
  • About Us
  • Blogs
    • Ethical Hacking
    • Cybersecurity
    • Penetration testing
  • Tools
    • Phishing email Detector tool
    • Website Security Checker Tool
    • Age|Face Shape|Expression Guess
    • Text Cleaner Tool
    • Image Converter & Resizer Tool (Free Online)
  • Contact Us
  • Home
  • About Us
  • Blogs
    • Ethical Hacking
    • Cybersecurity
    • Penetration testing
  • Tools
    • Phishing email Detector tool
    • Website Security Checker Tool
    • Age|Face Shape|Expression Guess
    • Text Cleaner Tool
    • Image Converter & Resizer Tool (Free Online)
  • Contact Us
Close

Search

Subscribe
  • Facebook
  • Telegram
  • Instagram
  • Youtube
  • Linkedin
  • Whasapp
Ethical HackingPenetration testing

Linux Commands: A Complete Guide

By cybersamir
January 24, 2025 7 Min Read
Comments Off on Linux Commands: A Complete Guide

Linux commands are the backbone of interaction with the Linux operating system, allowing users to perform tasks efficiently through the command line interface (CLI). Unlike graphical user interfaces (GUIs), which can be visually appealing but sometimes cumbersome, the CLI provides a straightforward and powerful way to control the system. This blog post aims to provide a comprehensive guide to Linux commands, from the basics to more advanced functionalities, organized by categories for easier navigation.

Introduction

Linux commands are essential tools that enable users to communicate with the operating system. They allow for file management, system monitoring, user administration, and much more. The CLI is favored by many system administrators and developers due to its speed and flexibility. Unlike GUIs, where actions are often hidden behind multiple clicks, the command line exposes all functionalities directly, allowing for rapid execution of tasks.

The simplicity of typing commands and receiving instant feedback makes the CLI an invaluable skill for anyone working with Linux. Moreover, mastering these commands can significantly enhance productivity by automating repetitive tasks and streamlining workflows.

Prerequisites

Before diving into Linux commands, there are a few prerequisites:

  • Linux Installed: Ensure you have a Linux distribution installed on your machine. Popular beginner-friendly options include Ubuntu, Fedora, and Mint.
  • Terminal Access: Familiarize yourself with accessing the terminal. In most distributions, you can find it in the applications menu or use a keyboard shortcut (often Ctrl+Alt+T).
  • Basic Understanding of Command Line: While this guide will cover fundamental commands, having a basic understanding of how to navigate the terminal will be beneficial.

Categories of Linux Commands

To make this guide more digestible, we will categorize Linux commands into several sections based on their functionality.

File and Directory Management

File and directory management commands are fundamental for navigating and manipulating files within the Linux file system.

  • ls: Lists directory contents.
  ls -la  # Lists all files including hidden ones with detailed information
  • cd: Changes the current directory.
  cd /path/to/directory  # Navigate to specified directory
  • pwd: Prints the current working directory.
  pwd  # Displays the full path of your current directory
  • mkdir: Creates a new directory.
  mkdir new_directory  # Creates a directory named 'new_directory'
  • rm -r: Removes directories and their contents recursively.
  rm -r unwanted_directory  # Deletes 'unwanted_directory' and its contents
  • cp: Copies files or directories.
  cp source_file.txt target_file.txt  # Copies 'source_file.txt' to 'target_file.txt'
  • mv: Moves or renames files/directories.
  mv old_name.txt new_name.txt  # Renames 'old_name.txt' to 'new_name.txt'
  • find: Searches for files/directories.
  find /path/to/search -name "*.txt"  # Finds all .txt files in specified path
Advertisement

File Viewing and Editing

These commands allow you to view or edit the contents of files directly from the terminal.

  • cat: Displays file contents.
  cat file.txt  # Outputs the content of 'file.txt'
  • less: Views file contents with pagination.
  less large_file.txt  # Opens 'large_file.txt' for easy reading
  • nano: A simple text editor for editing files.
  nano file.txt  # Opens 'file.txt' in nano editor
  • vi/vim: Advanced text editors with powerful features.
  vim file.txt   # Opens 'file.txt' in Vim editor
  • tail: Views the last lines of a file.
  tail -n 10 log.txt   # Displays the last ten lines of 'log.txt'
  • head: Views the first lines of a file.
  head -n 10 log.txt   # Displays the first ten lines of 'log.txt'

User Management

Managing users and permissions is crucial in any multi-user environment.

  • whoami: Displays the current user.
whoami   # Outputs your username
  • adduser: Adds a new user to the system.
sudo adduser newuser   # Creates a new user named 'newuser'
  • passwd: Changes a user’s password.
passwd   # Prompts for a new password for the current user
  • su: Switches users in the terminal.
su - username   # Switches to specified user account (requires password)
  • chmod: Changes file permissions.
chmod +x script.sh   # Makes 'script.sh' executable
  • chown: Changes file ownership.
sudo chown user:user file.txt   # Changes ownership of 'file.txt' to specified user and group

Process Management

These commands help monitor and control running processes on your system.

  • ps: Displays currently running processes.
ps aux   # Shows detailed information about all running processes
  • top: Monitors system resource usage in real-time.
top   # Launches an interactive view of system processes and resource usage 
  • kill: Terminates a process by its ID (PID).
kill PID   # Replace PID with actual process ID you want to terminate 
  • bg: Resumes a process in the background.
bg %1   # Resumes job number one in background 
  • fg: Brings a background process to the foreground.
fg %1   # Brings job number one back to foreground 

Networking

Networking commands allow users to manage network connections and configurations.

  • ifconfig/ip addr show: Displays network configurations (use ip addr show, as ifconfig is deprecated).
ip addr show   # Shows network interfaces and their IP addresses 
  • ping: Tests connectivity to another host.
ping google.com   # Sends packets to google.com to check connectivity 
  • wget: Downloads files from the web.
wget http://example.com/file.zip   # Downloads specified file from URL 
  • curl: Transfers data from or to a server using various protocols.
curl -O http://example.com/file.zip   # Downloads file while preserving its name 
  • ssh: Securely connects to remote servers over SSH protocol.
ssh user@hostname   # Connects to remote server as specified user 
  • scp: Securely copies files between systems over SSH.
scp local_file user@remote_host:/path/to/destination   # Copies local_file to remote host 

System Information and Management

These commands provide insights into system performance and maintenance tasks.

  • uname -a: Displays detailed information about your system kernel version and architecture.
uname -a   # Outputs kernel version information 
  • df -h: Shows disk space usage in human-readable format.
df -h   # Displays disk space usage for all mounted filesystems 
  • free -m : Displays memory usage statistics in megabytes.

“`bash
free -m # Shows memory usage statistics in MBs

- ** `uptime `:** Shows how long your system has been running along with load averages.

bash
uptime # Displays uptime along with load average stats

- ** `reboot `:** Restarts your system.

bash
sudo reboot # Restarts your computer safely

- ** `shutdown `:** Powers off your system safely.

bash
sudo shutdown now # Immediately powers off your computer safely

## Package Management

Package management is essential for installing, updating, and managing software on your Linux distribution. Below are common package management commands specific to Debian-based systems like Ubuntu:

- ** `apt update `:** Updates package lists from repositories.

bash
sudo apt update # Fetches updates from repositories

- ** `apt upgrade `:** Upgrades installed packages to their latest versions.

bash
sudo apt upgrade # Upgrades all installed packages

- ** `apt install <pkg> `:** Installs specified software package.

bash
sudo apt install package_name # Installs specified package name

- ** `apt remove <pkg> `:** Removes specified software package.

bash
sudo apt remove package_name # Removes specified package name

### Advanced Commands

For experienced users looking for more complex functionalities:

- ** `grep `:** Searches for patterns within files or output streams.

bash
grep “search_term” file.txt # Searches for ‘search_term’ in ‘file.txt’

- ** `awk `:** A powerful programming language designed for pattern scanning and processing.

bash
awk ‘{print $1}’ file.txt # Prints first column from ‘file.txt’

- ** `sed `:** Stream editor used for modifying files on-the-fly.

bash
sed ‘s/old/new/g’ file.txt # Replaces all occurrences of ‘old’ with ‘new’ in ‘file.txt’

- ** `tar `:** Used for compressing or extracting files from archives.

bash
tar -czvf archive.tar.gz /path/to/directory # Compresses directory into tar.gz archive

- ** `crontab `:** Schedules periodic tasks using cron jobs.

bash
crontab -e # Edits crontab file for scheduling tasks
“`

Tips for Mastering Linux Commands

Mastering Linux commands requires practice and familiarity. Here are some tips:

  1. Practice frequently by using commands regularly rather than relying solely on GUIs.
  2. Refer to manual pages (man <command>) for detailed information about any command’s options and usage.
  3. Use aliases to simplify repetitive tasks: bash alias ll='ls -la' # Creates an alias 'll' that lists files in long format including hidden ones
  4. Utilize tab completion by pressing Tab after typing part of a command or filename; it saves time and reduces typing errors.
  5. Explore piping (|) which allows you to use output from one command as input into another: bash ls | grep ".txt" # Lists all .txt files in current directory
  6. Use wildcards (*, ?) effectively when dealing with multiple files; this can simplify many operations significantly: bash rm *.tmp # Deletes all temporary files ending with .tmp
  7. Keep learning! The more you use these commands, explore their options, and understand their functionalities, the more proficient you’ll become at using Linux effectively.

Conclusion

Mastering Linux commands opens up a world of possibilities for managing systems efficiently. The command line interface allows users not only greater control but also automation capabilities that graphical interfaces cannot match. By understanding these essential commands grouped into logical categories—from basic file management to advanced scripting—you will be well-equipped to navigate any task within a Linux environment confidently.

Embrace this powerful toolset; practice regularly, explore further resources, engage with community forums, and challenge yourself with real-world tasks using these commands. The journey may seem daunting at first, but each command learned is another step toward becoming proficient in Linux—an invaluable skill in today’s tech-driven world!.

Author

cybersamir

Follow Me
Other Articles
Previous

The Latest Trends and Innovations in Web Development

Next

How to Keep Your WordPress Website Safe and Secure

Your ad here

300 x 250 banner slot

Reach Nepali students, developers, and security learners reading about ethical hacking, CTFs, and cyber news.

Book on WhatsApp Or send an email

Sponsors: VPNs, courses, hosting, security tools

Recent Posts

  • How to Recover Money from Online Scam Nepal: 2026 Guide
  • How to Check If Your Data Was Leaked (Nepal 2026 Guide)
  • Is PHP Dead? A 2026 Reckoning
  • Nepal Cyber Shield CTF: Top 10 Teams Qualified for the Grand Finale
  • How to Report Cybercrime in Nepal: Step-by-Step Guide (2026)

Nepal Cyber Shield 2026

Been scammed or hacked?

Act fast: save screenshots, don't delete chats, and report it.

  • 100 Nepal Police emergency line
  • +9779851286770 Nepal Police Cyber Bureau
Report here (Nepal Police) Read the step-by-step reporting guide

Money lost? Call your bank first so they can try to freeze the transfer.

Categories

  • Awareness
  • Blog
  • Career & Learning
  • Cybersecurity
  • Ethical Hacking
  • Nepal Tech & Digital Safety
  • News
  • Penetration testing
  • Tools & Reviews

Latest security alerts

  • Foundational Doesn't Mean Easy: The Security Questions Business Leaders Should Ask About AI
  • New TZRat Android Malware Silently Hijacks Phones and Streams Victims' Screens
  • Microsoft Details AI-Assisted ISP Attack That Compromised Three Peer Servers in 13 Minutes
  • WhatsApp to Force iPhone Users to Update iOS as Website-Based Malware Attacks Spread
  • Google and Anthropic AI Found an 18-Year-Old UEFI Flaw That Can Bypass Secure Boot
  • PHP Vulnerability And Global Cybersecurity - The Rising Nepal
  • Nepal's digital vulnerability goes beyond PHP - myRepublica
  • SEBON introduces IT policy to strengthen cybersecurity in Nepal’s capital market - OnlineKhabar English News
  • SEBON steps up effort to prevent cyber attacks in stock exchange platform - myRepublica
  • From heartbleed to PHP2Shell: Is Nepal ready for the next cyber crisis? - The Annapurna Express

You May Have Missed

how to recover money from online scam Nepal
Awareness

How to Recover Money from Online Scam Nepal: 2026 Guide

cybersamir
By cybersamir
November 28, 2026
data leak check nepal
Awareness

How to Check If Your Data Was Leaked (Nepal 2026 Guide)

cybersamir
By cybersamir
November 26, 2026
Cinematic PHP programming thumbnail with the headline “Is PHP Dead? 2026 Reckoning,” a glowing blue PHP elephant, and CyberSamir branding.
Awareness

Is PHP Dead? A 2026 Reckoning

cybersamir
By cybersamir
October 25, 2026
ctf top 10 selected teams
News

Nepal Cyber Shield CTF: Top 10 Teams Qualified for the Grand Finale

cybersamir
By cybersamir
October 4, 2026
How to report cybercrime in Nepal Cyber Bureau complaint guide
Awareness

How to Report Cybercrime in Nepal: Step-by-Step Guide (2026)

cybersamir
By cybersamir
September 27, 2026
Nepal Data Breach: 462,600 Citizens' IDs Allegedly Leaked," subtext "Dark web forum post claims mass PII theft from a .gov.np portal
News

Nepal Government Portal Allegedly Breached: 462,600 Citizens’ Data Reportedly Listed for Sale on Dark Web

cybersamir
By cybersamir
September 24, 2026
Cybersecurity

Top 10 Security Mistakes Nepali Websites Still Make in 2026

cybersamir
By cybersamir
September 23, 2026
News Cybersecurity

Nepal Data Hub Ransomware Attack: NEPSE Shutdown Explained

cybersamir
By cybersamir
September 23, 2026
News

Nepal Cyber Shield 2026: Everything You Need to Know About Nepal’s National CTF Championship

cybersamir
By cybersamir
September 19, 2026
CS

CYBERSAMIR

Explore. Hack. Secure. Learn.

About Us

CyberSamir provides cutting-edge insights into ethical hacking, penetration testing, and cybersecurity defense strategies for professionals and enthusiasts alike.

500+ Articles
15K+ Members
30+ Tools

Resources

  • Tutorials
  • Our Services
  • Tools
  • CTF Walkthroughs
  • Security News

Community

  • WhatsApp Group
  • Discord Server
  • Telegram Group
  • Upcoming Events
  • Certifications

Follow Us

Cyber Security Events Worldwide

© CyberSamir. All Rights Reserved.

Copyright 2026 — Cyber Samir. All rights reserved. Blogsy WordPress Theme