Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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
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

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

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.