Tuesday, January 24, 2023

Linux command line

There are two user interfaces for managing Linux.

  • Graphical User Interface (GUI Graphical User Interface)
  • Command Line Interface (CLI Command Line Interface)

Graphic interface

We are all familiar with this user interface, this interface includes buttons, icons, etc. Windows Pages can be a good example for this.

Command Line Interface

There are no buttons and icons in this user interface, and the user must enter the commands he needs in an environment called shell. Shell is basically a text-based tool for communication between the user and the kernel of the operating system.

Shell types

There are many different types of shells, but the most popular shells are:

  • Bourne shell (sh)
  • Bourne Again shell (bash)
  • C shell (cso, tsh)
  • Korn shell (ksh )
  • Z shell ( zsh )
For a better understanding of Shell, the above image is very helpful, Shell is actually a layer above Kernel.


General terminal structure

username@hostname:~$

The tilde symbol ( ~ ) in the terminal means that you are in the Home Directory. In Linux, a directory is created at the following address by creating each user.

/home/username

The dollar sign ( $ ) indicates the user's access level. In such a way that if the user is root (root) instead of ($) we will see a hashtag or a hash mark (#), the root user is similar to the administrator user in Windows, I will explain more about this in the following.

You can use the following command to view your Linux shell:

echo $SHELL


The general syntax of the structure of Linux commands

command [options/parameters...] [arguments...]< p class="md-block-unstyled md-block-rtl">For example, to display the address of the current directory, we use this command, which does not have any special options or parameters.1pwd

To list the files and directories in the address you are:

ls -l

And to display the files and directories along with hidden files can be used with the following two commands:

ls -a1ls --all

Linux command line

There are two user interfaces for managing Linux. Graphical User Interface (GUI Graphical User Interface) Command Line Interface (CLI Comman...