×
1 Choose EITC/EITCA Certificates
2 Learn and take online exams
3 Get your IT skills certified

Confirm your IT skills and competencies under the European IT Certification framework from anywhere in the world fully online.

EITCA Academy

Digital skills attestation standard by the European IT Certification Institute aiming to support Digital Society development

LOG IN TO YOUR ACCOUNT

CREATE AN ACCOUNT FORGOT YOUR PASSWORD?

FORGOT YOUR PASSWORD?

AAH, WAIT, I REMEMBER NOW!

CREATE AN ACCOUNT

ALREADY HAVE AN ACCOUNT?
EUROPEAN INFORMATION TECHNOLOGIES CERTIFICATION ACADEMY - ATTESTING YOUR PROFESSIONAL DIGITAL SKILLS
  • SIGN UP
  • LOGIN
  • INFO

EITCA Academy

EITCA Academy

The European Information Technologies Certification Institute - EITCI ASBL

Certification Provider

EITCI Institute ASBL

Brussels, European Union

Governing European IT Certification (EITC) framework in support of the IT professionalism and Digital Society

  • CERTIFICATES
    • EITCA ACADEMIES
      • EITCA ACADEMIES CATALOGUE<
      • EITCA/CG COMPUTER GRAPHICS
      • EITCA/IS INFORMATION SECURITY
      • EITCA/BI BUSINESS INFORMATION
      • EITCA/KC KEY COMPETENCIES
      • EITCA/EG E-GOVERNMENT
      • EITCA/WD WEB DEVELOPMENT
      • EITCA/AI ARTIFICIAL INTELLIGENCE
    • EITC CERTIFICATES
      • EITC CERTIFICATES CATALOGUE<
      • COMPUTER GRAPHICS CERTIFICATES
      • WEB DESIGN CERTIFICATES
      • 3D DESIGN CERTIFICATES
      • OFFICE IT CERTIFICATES
      • BITCOIN BLOCKCHAIN CERTIFICATE
      • WORDPRESS CERTIFICATE
      • CLOUD PLATFORM CERTIFICATENEW
    • EITC CERTIFICATES
      • INTERNET CERTIFICATES
      • CRYPTOGRAPHY CERTIFICATES
      • BUSINESS IT CERTIFICATES
      • TELEWORK CERTIFICATES
      • PROGRAMMING CERTIFICATES
      • DIGITAL PORTRAIT CERTIFICATE
      • WEB DEVELOPMENT CERTIFICATES
      • DEEP LEARNING CERTIFICATESNEW
    • CERTIFICATES FOR
      • EU PUBLIC ADMINISTRATION
      • TEACHERS AND EDUCATORS
      • IT SECURITY PROFESSIONALS
      • GRAPHICS DESIGNERS & ARTISTS
      • BUSINESSMEN AND MANAGERS
      • BLOCKCHAIN DEVELOPERS
      • WEB DEVELOPERS
      • CLOUD AI EXPERTSNEW
  • FEATURED
  • SUBSIDY
  • HOW IT WORKS
  •   IT ID
  • ABOUT
  • CONTACT
  • MY ORDER
    Your current order is empty.
EITCIINSTITUTE
CERTIFIED

Which Linux commands are mostly used?

by lgashi / Wednesday, 04 September 2024 / Published in Cybersecurity, EITC/IS/LSA Linux System Administration, Introduction, Getting started

In the domain of Cybersecurity and Linux System Administration, understanding the fundamental Linux commands is pivotal for both system management and security operations. Linux commands are the building blocks for interacting with the operating system, and their proficiency is essential for effective system administration and cybersecurity tasks. Below, we consider some of the most commonly used Linux commands, providing a detailed explanation of their purposes, functionalities, and examples to illustrate their practical applications.

1. `ls` – List Directory Contents

The `ls` command is used to list the contents of a directory. It is one of the most frequently used commands as it helps users and administrators to see the files and directories within a specified directory.

Usage:
{{EJS76}}
Common Options:
- `-l`: Long listing format. Provides detailed information about files and directories. - `-a`: Lists all files, including hidden files (those starting with a dot `.`). - `-h`: Human-readable format, making file sizes easier to read.
Example:
bash
ls -lah /var/log

This command lists all files in the `/var/log` directory in a long listing format, including hidden files, with human-readable file sizes.

2. `cd` - Change Directory

The `cd` command is used to change the current working directory. It is essential for navigating the file system.

Usage:
{{EJS78}}
Example:
bash
cd /etc

This command changes the current directory to `/etc`.

3. `pwd` - Print Working Directory

The `pwd` command prints the full path of the current working directory. It is useful for confirming the directory you are currently in.

Usage:
{{EJS80}}
Example:
bash
pwd

If the current directory is `/home/user`, the command will output `/home/user`.

4. `cp` - Copy Files and Directories

The `cp` command is used to copy files and directories from one location to another.

Usage:
{{EJS82}}
Common Options:
- `-r`: Recursively copy directories and their contents. - `-i`: Prompt before overwrite. - `-v`: Verbose mode, showing files being copied.
Example:
bash
cp -r /home/user/docs /backup/docs

This command copies the `docs` directory from `/home/user` to `/backup`.

5. `mv` - Move or Rename Files and Directories

The `mv` command moves files and directories from one location to another. It is also used to rename files and directories.

Usage:
{{EJS84}}
Example:
bash
mv /home/user/file.txt /home/user/docs/file.txt

This command moves `file.txt` from `/home/user` to `/home/user/docs`.

6. `rm` - Remove Files and Directories

The `rm` command is used to remove files and directories.

Usage:
{{EJS86}}
Common Options:
- `-r`: Recursively remove directories and their contents. - `-i`: Prompt before each removal. - `-f`: Force removal without prompt.
Example:
bash
rm -rf /home/user/temp

This command forcefully removes the `temp` directory and its contents.

7. `chmod` - Change File Modes or Access Permissions

The `chmod` command is used to change the access permissions of files and directories.

Usage:
{{EJS88}}
Example:
bash
chmod 755 /home/user/script.sh

This command sets the permissions of `script.sh` to `755` (rwxr-xr-x).

8. `chown` - Change File Owner and Group

The `chown` command changes the ownership of a file or directory.

Usage:
{{EJS90}}
Example:
bash
chown root:root /var/www/html

This command changes the owner and group of `/var/www/html` to `root`.

9. `ps` - Report a Snapshot of Current Processes

The `ps` command displays information about the currently running processes.

Usage:
{{EJS92}}
Common Options:
- `-e`: Display all processes. - `-f`: Full-format listing.
Example:
bash
ps -ef

This command displays a full-format listing of all running processes.

10. `top` - Display Linux Tasks

The `top` command provides a dynamic, real-time view of the system's running processes.

Usage:
{{EJS94}}
Example:
bash
top

Running this command will show a real-time display of system processes, CPU usage, memory usage, and more.

11. `kill` - Terminate a Process

The `kill` command is used to send a signal to a process, usually to terminate it.

Usage:
{{EJS96}}
Example:
bash
kill -9 1234

This command forcefully terminates the process with PID 1234.

12. `df` - Report File System Disk Space Usage

The `df` command displays the amount of disk space used and available on file systems.

Usage:
{{EJS98}}
Common Options:
- `-h`: Human-readable format. - `-T`: Display file system type.
Example:
bash
df -h

This command shows disk space usage in a human-readable format.

13. `du` - Estimate File Space Usage

The `du` command estimates file space usage.

Usage:
{{EJS100}}
Common Options:
- `-h`: Human-readable format. - `-s`: Summarize total size.
Example:
bash
du -sh /home/user

This command shows the total size of the `/home/user` directory in a human-readable format.

14. `grep` - Print Lines Matching a Pattern

The `grep` command searches for patterns within files and outputs the matching lines.

Usage:
{{EJS102}}
Common Options:
- `-i`: Ignore case. - `-r`: Recursively search directories. - `-v`: Invert match, showing lines that do not match the pattern.
Example:
bash
grep -r "error" /var/log

This command searches for the term "error" in all files within `/var/log`.

15. `find` - Search for Files in a Directory Hierarchy

The `find` command searches for files and directories within a directory hierarchy based on specified criteria.

Usage:
{{EJS104}}
Common Expressions:
- `-name`: Search by name. - `-type`: Search by type (e.g., `f` for files, `d` for directories). - `-mtime`: Search by modification time.
Example:
bash
find /home/user -name "*.txt"

This command finds all `.txt` files within `/home/user`.

16. `tar` - Archive Files

The `tar` command is used to create, extract, and manipulate tar archives.

Usage:
{{EJS106}}
Common Options:
- `-c`: Create a new archive. - `-x`: Extract files from an archive. - `-v`: Verbose mode. - `-f`: Specify the archive file.
Example:
bash
tar -cvf backup.tar /home/user/docs

This command creates a tar archive named `backup.tar` containing the `docs` directory.

17. `ssh` - Secure Shell

The `ssh` command is used to securely connect to remote systems.

Usage:
{{EJS108}}
Common Options:
- `-p`: Specify port. - `-i`: Specify identity file for key-based authentication.
Example:
bash
ssh -i ~/.ssh/id_rsa user@192.168.1.10

This command connects to the remote system at `192.168.1.10` using the specified identity file for authentication.

18. `scp` - Secure Copy

The `scp` command is used to securely copy files between hosts.

Usage:
{{EJS110}}
Common Options:
- `-r`: Recursively copy directories. - `-P`: Specify port.
Example:
bash
scp -P 2222 /home/user/file.txt user@remote:/home/user

This command copies `file.txt` to the remote system on port `2222`.

19. `rsync` - Remote Sync

The `rsync` command is used for fast and versatile file copying and synchronization.

Usage:
{{EJS112}}
Common Options:
- `-a`: Archive mode, which preserves permissions, timestamps, and other attributes. - `-v`: Verbose mode. - `-z`: Compress file data during the transfer. - `-P`: Show progress during transfer.
Example:
bash
rsync -avz /home/user/docs user@remote:/backup/docs

This command synchronizes the `docs` directory to the remote system, preserving attributes and compressing data during the transfer.

20. `crontab` - Schedule Tasks

The `crontab` command is used to schedule tasks to run at specified intervals.

Usage:
{{EJS114}}
Common Options:
- `-e`: Edit the crontab file. - `-l`: List the crontab file. - `-r`: Remove the crontab file.
Example:
bash
crontab -e

This command opens the crontab file for editing, allowing you to schedule tasks.

21. `sudo` - Execute a Command as Another User

The `sudo` command allows a permitted user to execute a command as the superuser or another user.

Usage:
{{EJS116}}
Example:
bash
sudo apt-get update

This command runs `apt-get update` with superuser privileges, updating the package list.

22. `apt-get` - APT Package Handling Utility

The `apt-get` command is used to handle packages in Debian-based distributions.

Usage:
{{EJS118}}
Common Commands:
- `update`: Update the package list. - `upgrade`: Upgrade all packages. - `install`: Install a package. - `remove`: Remove a package.
Example:
bash
sudo apt-get install vim

This command installs the `vim` text editor.

23. `yum` - Yellowdog Updater Modified

The `yum` command is used to manage packages in RPM-based distributions.

Usage:
{{EJS120}}
Common Commands:
- `update`: Update packages. - `install`: Install a package. - `remove`: Remove a package.
Example:
bash
sudo yum install httpd

This command installs the Apache HTTP server.

24. `systemctl` - Control the Systemd System and Service Manager

The `systemctl` command is used to examine and control the systemd system and service manager.

Usage:
{{EJS122}}
Common Commands:
- `start`: Start a service. - `stop`: Stop a service. - `restart`: Restart a service. - `status`: Show the status of a service.
Example:
bash
sudo systemctl status sshd

This command shows the status of the SSH daemon.

25. `journalctl` - Query the Systemd Journal

The `journalctl` command is used to query and display messages from the systemd journal.

Usage:
{{EJS124}}
Common Options:
- `-b`: Show messages from the current boot. - `-u`: Show messages for a specific unit.
Example:
bash
journalctl -u sshd

This command displays journal entries related to the SSH daemon.

26. `netstat` - Network Statistics

The `netstat` command displays network connections, routing tables, interface statistics, masquerade connections, and multicast memberships.

Usage:
{{EJS126}}
Common Options:
- `-a`: Show all sockets. - `-t`: Show TCP connections. - `-u`: Show UDP connections. - `-n`: Show numerical addresses.
Example:
bash
netstat -tuln

This command shows all listening TCP and UDP ports with numerical addresses.

27. `ifconfig` - Configure a Network Interface

The `ifconfig` command is used to configure network interfaces.

Usage:
{{EJS128}}
Example:
bash
ifconfig eth0

This command displays the configuration of the `eth0` network interface.

28. `ping` - Send ICMP ECHO_REQUEST to Network Hosts

The `ping` command checks the network connectivity between the host and a target.

Usage:
{{EJS130}}
Example:
bash
ping google.com

This command sends ICMP echo requests to `google.com` to check connectivity.

29. `traceroute` - Print the Route Packets Take to the Network Host

The `traceroute` command shows the path packets take to reach a network host.

Usage:
{{EJS132}}
Example:
bash
traceroute google.com

This command traces the route packets take to `google.com`.

30. `curl` - Transfer Data from or to a Server

The `curl` command is used to transfer data from or to a server using various protocols.

Usage:
{{EJS134}}
Example:
bash
curl -O http://example.com/file.txt

This command downloads `file.txt` from `example.com`.

31. `wget` - The Non-Interactive Network Downloader

The `wget` command downloads files from the web.

Usage:
{{EJS136}}
Example:
bash
wget http://example.com/file.txt

This command downloads `file.txt` from `example.com`.

32. `nano` - Simple Text Editor

The `nano` command opens the Nano text editor, which is user-friendly and suitable for beginners.

Usage:
{{EJS138}}
Example:
bash
nano /home/user/file.txt

This command opens `file.txt` in the Nano text editor.

33. `vim` - Vi Improved, a Highly Configurable Text Editor

The `vim` command opens the Vim text editor, which is powerful and highly configurable.

Usage:
{{EJS140}}
Example:
bash
vim /home/user/file.txt

This command opens `file.txt` in the Vim text editor.

34. `awk` - Pattern Scanning and Processing Language

The `awk` command is used for pattern scanning and processing.

Usage:
{{EJS142}}
Example:
bash
awk '{print $1}' /etc/passwd

This command prints the first field of each line in `/etc/passwd`.

35. `sed` - Stream Editor

The `sed` command is used to perform basic text transformations on an input stream.

Usage:
{{EJS144}}
Example:
bash
sed 's/old/new/g' file.txt

This command replaces all occurrences of `old` with `new` in `file.txt`.

36. `echo` - Display a Line of Text

The `echo` command displays a line of text.

Usage:
{{EJS146}}
Example:
bash
echo "Hello, World!"

This command prints `Hello, World!` to the terminal.

37. `date` - Display or Set the System Date and Time

The `date` command displays or sets the system date and time.

Usage:
{{EJS148}}
Example:
bash
date "+%Y-%m-%d %H:%M:%S"

This command displays the current date and time in the specified format.

38. `uptime` - Tell How Long the System Has Been Running

The `uptime` command shows how long the system has been running, along with the current time, number of users, and system load averages.

Usage:
{{EJS150}}
Example:
bash
uptime

This command displays the system's uptime.

Other recent questions and answers regarding EITC/IS/LSA Linux System Administration:

  • How to mount a disk in Linux?
  • How important is Linux usage nowadays?
  • How does the "conflicts" directive in systemd prevent two units from being active simultaneously?
  • What is the purpose of the "requisite" directive in systemd and how is it different from "required by"?
  • Why is it recommended to manage dependencies on units that you are creating or managing yourself, rather than editing system units?
  • How does the "before" directive in systemd specify the execution order of units?
  • What is the difference between weak dependencies and explicit ordering in systemd?
  • What is the purpose of the "rescue.target" and how can it be used for troubleshooting without rebooting the system?
  • What command can be used to switch between targets in systemd and how is it similar to switching between run levels in sysvinit?
  • How can you ensure that necessary network configurations are completed before a specific network service starts?

View more questions and answers in EITC/IS/LSA Linux System Administration

More questions and answers:

  • Field: Cybersecurity
  • Programme: EITC/IS/LSA Linux System Administration (go to the certification programme)
  • Lesson: Introduction (go to related lesson)
  • Topic: Getting started (go to related topic)
Tagged under: Cybersecurity
Home » Cybersecurity / EITC/IS/LSA Linux System Administration / Getting started / Introduction » Which Linux commands are mostly used?

Certification Center

USER MENU

  • My Account

CERTIFICATE CATEGORY

  • EITC Certification (105)
  • EITCA Certification (9)

What are you looking for?

  • Introduction
  • How it works?
  • EITCA Academies
  • EITCI DSJC Subsidy
  • Full EITC catalogue
  • Your order
  • Featured
  •   IT ID
  • EITCA reviews (Medium publ.)
  • About
  • Contact

EITCA Academy is a part of the European IT Certification framework

The European IT Certification framework has been established in 2008 as a Europe based and vendor independent standard in widely accessible online certification of digital skills and competencies in many areas of professional digital specializations. The EITC framework is governed by the European IT Certification Institute (EITCI), a non-profit certification authority supporting information society growth and bridging the digital skills gap in the EU.

Eligibility for EITCA Academy 80% EITCI DSJC Subsidy support

80% of EITCA Academy fees subsidized in enrolment by

    EITCA Academy Secretary Office

    European IT Certification Institute ASBL
    Brussels, Belgium, European Union

    EITC / EITCA Certification Framework Operator
    Governing European IT Certification Standard
    Access contact form or call +32 25887351

    Follow EITCI on X
    Visit EITCA Academy on Facebook
    Engage with EITCA Academy on LinkedIn
    Check out EITCI and EITCA videos on YouTube

    Funded by the European Union

    Funded by the European Regional Development Fund (ERDF) and the European Social Fund (ESF) in series of projects since 2007, currently governed by the European IT Certification Institute (EITCI) since 2008

    Information Security Policy | DSRRM and GDPR Policy | Data Protection Policy | Record of Processing Activities | HSE Policy | Anti-Corruption Policy | Modern Slavery Policy

    Automatically translate to your language

    Terms and Conditions | Privacy Policy
    EITCA Academy
    • EITCA Academy on social media
    EITCA Academy


    © 2008-2025  European IT Certification Institute
    Brussels, Belgium, European Union

    TOP
    Chat with Support
    Chat with Support
    Questions, doubts, issues? We are here to help you!
    End chat
    Connecting...
    Do you have any questions?
    Do you have any questions?
    :
    :
    :
    Send
    Do you have any questions?
    :
    :
    Start Chat
    The chat session has ended. Thank you!
    Please rate the support you've received.
    Good Bad