Thursday 25 June 2015

Redirection symbols in Ubuntu

Redirection Symbol:
>, <, >>, |
> standard o/p
< standard i/p
>> append in the o/p
| pipe

sort < a1 > a2
This means a1 and copy to a2.

cat a | less (This will pagewise showcase of contents of file)

similarly ls | sort
Here input will come from the leftside of the pipe to the command on the right side.

sort < a1 | tail > a2
sorts a1, last ten lines - a2

cat < a1 >> a2
append contents of as at the end of a2.

t=`ls` back quotes runs the command.

No comments:

Post a Comment