i am trying to put ls -lRt command to run in the background but it fails.
i continue to get output on screen and didnt get the command prompt right after i put the command in background.
command i am using is
That will redirect all output (of stdout) to the file $HOME/fetched-ls.txt, and doing so in background.
Just be sure the process is done before using the outputfile.
thanks 'sea'...is it possible to put the output of command (stdout) in the background without redirecting.
in a nutshell after i fire command ls -lRt & , command prompt should return so that i can execute another command. and once the execution of the ls -lRt is over in the background it should display the stdout on the screen.
AFAIK:
You can either redirect the output somewhere else or not.
But you cannot 'buffer' it, unless you use a file, variable or reduce the output by using pipes.
In case of a variable you could try: DATA=$(ls -1Rt) & then continue your work, and when its done, type: echo "$DATA"
Otherwise, please explain what you are trying to achieve.