Grid Guides

Explore How System On Grid Can Work For You

Grid Guide Topics

An Initiation to the Linux Terminal

Table Of Contents

    ## Table of Contents

    – [Introduction](#introduction
    – [Linux Terminal Emulator](#linux-terminal-emulator
    – [The Shell](#the-shell
    – [The Command Prompt](#the-command-prompt
    – [Executing Commands](#executing-commands
    – [Linux Without Arguments or Options](#linux-without-arguments-or-options
    – [Linux with Both Options and Arguments](#linux-with-both-options-and-arguments
    – [Linux Terminal Environment Variables](#linux-terminal-environment-variables
    – [Conclusion](#conclusion

    ## Introduction

    Linux terminal is an operating system or a kernel. Which is distributed under an open source license. One of the most popular and widely used kernels is Linux, and it is the strength of popular operating systems like [Debian](, [Ubuntu](, [Fedora](, and [Knoppix]( The main plus point of Linux is that programmers were capable to utilize the Linux kernel to build their own custom operating systems and it is user-friendly.

    ## Linux Terminal Emulator

    Terminal emulator is programmed to use the terminal in a graphical environment.
    As we know most of the users work with a graphical user interface(GUI for their Computer needs, the use of a terminal emulator is necessary for most Linux server users.
    Here we show some free, frequently-used terminal emulators by operating systems:

    ### Mac OS X: terminal(default, i Term 2

    ### Windows: PuTTY

    ### Linux: Terminal, KDE Konsole, XTerm

    As we listed above each terminal is easy to use and they have own set of features.

    ## The Shell

    The shell is a command line interface which clarifies a user commands and script files at Linux system and informs to server’s operating system to accomplish with them. There have many shells widely used, they are C shell (csh and Bourne shell (sh. Every shell has its own set of feature and complexity, but they all aspect input and output redirection, variables, and condition-testing, between other things.

    ## The Command Prompt

    First login to your server, you will commonly be addressed by the message of the day(MOTD, which is commonly an informational message that carries confused data such as the version of the Linux handling that the server is executing. After the MOTD, you will be released into the command prompt, which is where you concern commands to the server.

    The data which is placed at the command prompt can be personalized by the user.

    maddy@webapp: ~$

    Here is a breakdown of the architecture of the command prompt:

    ### Maddy: username of the current user
    ### web app: hostname of the server
    ### ~: The current users home directory is expanded by this special ~ or tilde.
    ### $: It denotes the end of the command prompt it is a symbol of the prompt.

    As we show the example below the command prompt will be like this if you logged as root.


    ## Executing Commands

    Commands can be a concern at the command prompt by defining the name of an executable file, that can be a binary program or a script. The standard Linux commands and service that are installed with the OS, which allows you to operate the file system, build in the software packages, and construct the system and applications.

    An example of a running command is said as a process. Where the command is compiled in the leading edge, by the default way that commands are executed, the user wants to wait for the process to complete before being exchanged to the command prompt, at which point they can proc concerning more commands.

    At Linux, almost everything is case-sensitive, along with file and directory names,
    commands, arguments, and options. If anything is not working as normal, double-check the logographic and case of your commands.

    Here we execute a few examples that will envelop the basics of running commands.

    ## Linux Without Arguments or Options

    To run a command without any help of arguments or options, directly place the RETURN at the name of a command.

    If you did like that it will display its regular behavior, which changes from command to command. Let’s see an example if in case you execute Cd command beyond any arguments, you will get back to your present user’s home directory. The ls command with no arguments it will print a classifying of the present directory’s files. Then IP command with no arguments it displays a text that explains to you how to use IP command.

    Check out by running ls command with no arguments to list the files and directories at your present directory.


    ## Linux with Only Arguments

    Here many commands welcome arguments or parameters, that can affect the action of the command. To use cd command is to send a single argument that defines which directory to change. For example, to replace the /usr/bin directory, at here many commands are installed, you need to concern this command:

    cd /usr /bin

    Note that how your command prompt’s present path has updated:


    ## Linux with Only Options

    The most number of commands accepts options, which also known as switches or flags, that update the action of the command. Options followed by a command which are indicated with a single-character by following more than two options, which are produced by original upper-case or lower-case letters.

    To check working conditions of options use the ls command.

    ### – l: print a “long listing”, which builds additional details such as permissions, file sizes, ownership, and timestamps.

    ### -a: To print a list of all directory files, building private ones ( that start with.

    To utilize the -l flag with ls, use the below command:

    ls -l

    As we discuss before, options can generally be grouped together. If you need to use “-l” and “-a” options together, you can run all together like below command:

    ls -la

    ## Linux with Both Options and Arguments

    While running commands the options and arguments are mostly combined together.

    ls -la /home

    If you see the above command ls is the command and -la is the options, and /home is the argument which expresses file or directory to list. It will display a complete listing of /home directory.

    ## Linux Terminal Environment Variables

    The values are used to change commands and processes are executed is environment variables. By default number of environment variables will be set based on a few configuration files, when your server login for the first time.

    ## View the Value of a Variable

    The Environment variable can be brought back by adding the variable name to a $. By placing the value at the expanded term to its required variable.

    By using the echo command you can get the path value :

    echo $PATH

    Alternatively, you can use the HOME variable to change the home directory values:

    cd $HOME

    ## Setting Environment Variables

    As we seen in the above we learn that how to visit the environment variable, here we learn how to set up them:

    To arrange the environment variable, you need to begin with the name, and then click the sign and then enter the required user details.


    Export command is to export the variable, so here it is routed=through the child processes. It permits you to utilize the scripts which refer to an exported environment variable from your running page.

    While setting the variable you can refer through the actual variables. If you place an application to the /opt/app/bin here you need to add the PATH environment variable to that directory with the below command :

    export PATH=$PATH:/opt/app/bin

    Check out that whether the path variable is added to /opt/app/bin with echo:

    echo $PATH

    Note: The above environment variable setting process is fit for only the present
    Session. Nothing but if you enter into another session the setting you placed is not secure it will change.

    ## Conclusion

    At finally, you have a basic idea upon the Linux terminal commands.