Linux Bash Input, Output and Redirect

RSS
EMAIL
FACEBOOK
FACEBOOK
GOOGLE
GOOGLE
https://www.poftut.com/linux-bash-input-output-redirect/
PINTEREST
PINTEREST
INSTAGRAM
  1. Introduction To Linux Bash Programming
  2. Linux Bash Directories and Files
  3. Linux Bash Environment Variables
  4. Linux Bash Variables
  5. Linux Bash Functions
  6. Linux Bash If Else Conditionals
  7. Linux Bash Create and Run Script Files
  8. Linux Bash Operators
  9. Linux Bash Arrays
  10. Linux Bash Input, Output and Redirection
  11. Linux Bash History
  12. Linux Bash Alias
  13. Linux Bash .bashrc File
  14. Linux Bash Debugging

Linux Bash have different ways to run command and get output of the command or redirect the output. In this tutorial we will look different ways to redirect commands output.

Writing Multiple Commands Same Line

Command line can be terminated with ; to write commands same line

In this example first clean command runs and after the execution ends what ever the command result is second command ls runs.

Redirect one command output to other command

To redirect one command output to the other command use |. | named as pipe. The standard output is redirected. In this example we run ls command which will print file and directory names in working directory. By using pipe we redirect ls output into sort command as input. sort as name suggests used to sorting alphabetically.

Check Previous Command Exit Status

When commands are chained together commands exit status which means the result of the command is important. For example copy a folder and change directory into new folder may chained together. If the the first command cannot be completed there is no need to run second command.

LEARN MORE  How Prompt for Input in Bash

  1. Introduction To Linux Bash Programming
  2. Linux Bash Directories and Files
  3. Linux Bash Environment Variables
  4. Linux Bash Variables
  5. Linux Bash Functions
  6. Linux Bash If Else Conditionals
  7. Linux Bash Create and Run Script Files
  8. Linux Bash Operators
  9. Linux Bash Arrays
  10. Linux Bash Input, Output and Redirection
  11. Linux Bash History
  12. Linux Bash Alias
  13. Linux Bash .bashrc File
  14. Linux Bash Debugging
RSS
EMAIL
FACEBOOK
FACEBOOK
GOOGLE
GOOGLE
https://www.poftut.com/linux-bash-input-output-redirect/
PINTEREST
PINTEREST
INSTAGRAM

Leave a Reply

Your email address will not be published.