What does ls > list Mean

Asked by Nathan

hi

 i need to find out what ls > list means &
ls >> list

thanks

nathan

Question information

Language:
English Edit question
Status:
Solved
For:
Ubuntu Edit question
Assignee:
No assignee Edit question
Solved by:
actionparsnip
Solved:
Last query:
Last reply:
Revision history for this message
Best actionparsnip (andrew-woodhead666) said :
#1

This is exactly the same as in Windows.

The first command will make the file if it doesn't exist then put the text in the file. If it does exist then the file will be overwritten.

The second will make a new file as before but if the file exists then it will be appended to.

sudo does not traverse the redirected text and so you will need to pipe to sudo tee if the file is not owned by your user.

Revision history for this message
Manfred Hampl (m-hampl) said :
#2

I recommend you read
http://en.flossmanuals.net/_booki/command-line/command-line.pdf
Redirecting and piping is covered in chapter 7

A long list of guides and help documents is available on
https://help.ubuntu.com/community/ExternalGuides

Revision history for this message
Nathan (meldrumn11) said :
#3

Thanks actionparsnip, that solved my question.