Linux Commands With Syntax, Examples (Lession- 18)

Linux Commands

The Linux operating system includes a function known as the Linux commands. Executing commands allows for the completion of all tasks, both fundamental and complicated. The Linux commands terminal executes the commands. The terminal functions as a command-line interface for system interaction, akin to the Windows operating system’s Linux Commands prompt. Case is taken into consideration while executing commands in Linux commands. Comparatively speaking, the command-line interface of Linux commands is far more powerful than that of other operating systems such as Windows and MacOS.

By using its terminal, we are able to do both fundamental and complicated tasks. Some of the fundamental operations that we are able to do include creating a file, deleting a file, relocating a file, and more. On top of that, we are also able to carry out more complex operations, such as administrative chores (which may include the installation of packages and the administration of users), networking actions (such as establishing an SSH connection), security tasks, and a great deal more.

In addition to offering a wide range of support options, a Linux commands terminal is a terminal that is simple to use. In order to launch the Linux terminal, press the “CTRL + ALT + T” keys simultaneously. After that, execute a command by pressing the ‘ENTER’ key.

We will review the top fifty most frequently used commands in this section, along with some examples of each command. Linux commands will be helpful to both novices and experienced users. To make it easier for you to recognize how to use these instructions, we have separated them into the following sections:

  1. Linux Directory Commands
  2. Linux File Commands
  3. Linux File Content Commands
  4. Linux User Commands
  5. Linux Filter Commands
  6. Linux Utility Commands
  7. Linux Networking Command

1. Linux Directory Commands :

  1. ls – List directory contents

Syntax: ‘ls [options] [directory]

Example:

2. pwd Command : We use the pwd command to display the location of the currently active working directory.

Syntax : ‘pwd

Example:

3. cd – Change directory

Syntax: cd [directory]

Example:

2. Linux File Commands :

  1. cat – Concatenate and display the content of files

Syntax: 'cat [file(s)]

Example:

2. less – View file contents one screen at a time

Syntax: ‘less [file]

Example:

3. head – Display the first few lines of a file

Syntax: ‘head [options] [file(s)]

Example:

3. Linux File Content Commands :

  1. cat – Concatenate and display the content of files

Syntax: ‘cat [file(s)]

Example:

2. less – View file contents one screen at a time

Syntax: 'less [file]'

Example:

3. head – Display the first few lines of a file

Syntax: ‘head [options] [file(s)]

Example:

4. Linux User Commands :

  1. whoami – Print the current username

Syntax: 'whoami

Example:

2. id – Print real and effective user and group IDs

Syntax: ‘id [username]

Example:

3. who – Show who is logged on

Syntax: ‘who [options]

5. Linux Filter Commands :

  1. grep – Search for patterns in files

Syntax: ‘grep [options] pattern [file(s)]

Example:

2. awk – A versatile pattern scanning and processing language

Syntax: ;awk 'pattern { action }' [file(s)]

Example:

3. sed – Stream editor for filtering and transforming text

Syntax: ‘sed [options] 'command' [file(s)]

Example:

6. Linux Utility Commands :

  1. date: Display or set the system date and time.

Syntax: ‘date [options]

Example:

2. cal: Display a calendar.

Syntax: ‘cal [options] [month] [year]

Example:

3. uptime: Show how long the system has been running.

Syntax: 'uptime

Example:

7. Linux Networking Command :

  1. ping: Send ICMP ECHO_REQUEST packets to network hosts to check connectivity.

Syntax: ‘ping [options] host

Example:

2. traceroute: Print the route packets take to network host.

Syntax: ‘traceroute [options] host

Example:

3. netstat: Display network connections, routing tables, interface statistics, masquerade connections, and multicast memberships.

Syntax: ‘netstat [options]

Example:

Read also : What is Booting, Booting Process, Types Of Booting, Boot Devices, Steps Of Booting (Lession- 17)

Leave a Comment