Take the 2-minute tour ×

i want to ask if i can execute command within command ? like :- command (other command)

share|improve this question
Do you want the output of (other command) to be passed to command or are you trying to achieve something else ? –  Iain Sep 13 '10 at 10:55
yes exactly i want to use the output of command to passed it to other command –  Mohammad AL-Rawabdeh Sep 13 '10 at 11:11
Then pipes are what you want. –  Iain Sep 13 '10 at 11:57
add comment

2 Answers

up vote 5 down vote accepted

sounds like you want "piping"

as in: ls -1 | grep "txt"

share|improve this answer
Piping is definitely the answer :-) –  chunkyb2002 Sep 13 '10 at 11:11
add comment

$() can be used and for bash are preferred over backticks, but are not portable.

share|improve this answer
add comment

Your Answer


