TestingDocs.com
Software Testing website
  • Automation
    • Selenium
    • JBehave Framework
  • Tutorials
    • MySQL Tutorials
    • Testlink
    • Maven
    • Git
  • IDEs
    • IntelliJ IDEA
    • Eclipse
  • Flowcharts
    • Flowgorithm
    • Raptor
  • About

Linux commands

echo Linux Command

Overview

Linux echo command with examples. echo command is used to display information to the computer screen. We can use this command to display strings or values of the variables. This command is widely used in shell scripts to display information to the screen.

echo command Examples

A simple example of the echo command to display Hello world string to the screen.

$ echo Hello World

Hit Enter button to execute the command.

echo Hello World

To use escape sequences in the strings, we can use -e command line option. For example, \n to denote new line.

Check out the output of the below command:

$ echo -e “Hello\nWorld”

Display Environment variables

We can use the echo command to display the values of the variables to the screen. For example, to display the environment variables to the screen.

echo command to know the SHELL variable on the system.

$ echo $SHELL

 

Shell Variable Echo Command

PATH

echo command to know the PATH environment variable. Type the following echo command with $PATH variable and press Enter button.

$ echo $PATH

 

echo linux command

The PATH environment variable is a list of directories that contain executable commands.

JAVA_HOME example

Let’s say we want to know the JDK install directory. We can use the echo command to display the JAVA_HOME variable. This variable points to the Java home directory. We need to set this variable during the JDK installation process.

$ echo $JAVA_HOME

echo JAVA variables

The command accepts command line switches. To know full list of the command line switches, type

$ man echo

–

Linux Basic Commands Tutorial page:

https://www.testingdocs.com/linux-basic-commands-tutorial/

More Information on Ubuntu Linux:
https://ubuntu.com/

Related Posts

sudo auth log entry

Linux commands /

sudo Linux Command with Examples

Common File Commands in Linux

Linux commands /

Common File Commands in Linux

su linux command

Linux commands /

su Linux Command

ls linux command

Linux commands /

ls Linux Command with Examples

touch create file

Linux commands /

touch Linux Command

‹ nano Linux Command› who Linux Command

Recent Posts

  • MS Access Data Types
  • Install RAPTOR Avalonia on CentOS
  • Download RAPTOR Avalonia Edition on Windows
  • npm doctor command
  • Build & Run CLion Project
  • Create New CLion C Project on Windows
  • Configure CLion Toolchains on Windows
  • Launch CLion IDE on Windows
  • Activate CLion IDE
  • CLion IDE for C/C++ Development

Back to Top

Links

  • Contact
  • Privacy Policy
  • Cookie Policy

www.TestingDocs.com

Go to mobile version