LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Pipes and Redirection (https://www.linuxquestions.org/questions/linux-newbie-8/pipes-and-redirection-4175490645/)

stetas 01-09-2014 01:36 AM

Pipes and Redirection
 
Hello
I have a Questions
How I can achieve these:
1) Redirect the listing of the /usr/bin directory to a file called listing.log

2) Append the listing of the /etc directory to listing.log

sachin.davra 01-09-2014 01:39 AM

Quote:

Originally Posted by stetas (Post 5094737)
Hello
I have a Questions
How I can achieve these:
1) Redirect the listing of the /usr/bin directory to a file called listing.log

2) Append the listing of the /etc directory to listing.log

1)ls /usr/bin > listing.log
2)ls /etc/* >> listing.log

">>" this sign appends the text in the file.

descendant_command 01-09-2014 01:39 AM

Smells like homework ... :tisk:

druuna 01-09-2014 01:40 AM

Quote:

Originally Posted by stetas (Post 5094737)
Hello
I have a Questions
How I can achieve these:
1) Redirect the listing of the /usr/bin directory to a file called listing.log

2) Append the listing of the /etc directory to listing.log

These look like homework questions, which we will not do for you.

What have you tried and what are you stuck with?

Hint: search for bash redirection and/or bash pipes

evo2 01-09-2014 01:41 AM

Hi,

looks like homework, so I'll not give you the answer. Instead I'll point you in the right direction.
For 1) you need to learn about ">", and for 2) you need to learn about ">>".

Cheers,

Evo2.

JJJCR 01-09-2014 11:37 PM

if you are still learning don't take the shortcut, learn the basic and have a solid foundation.

it will help you a lot.

check and read this link below:

http://www.tldp.org/LDP/intro-linux/...#sect_05_01_02


All times are GMT -5. The time now is 09:17 AM.