l" and "ls >> l". I have tried them, but it seems as if they do the same thing - create a file named "l"." /> l" and "ls >> l". I have tried them, but it seems as if they do the same thing - create a file named "l"." /> l" and "ls >> l". I have tried them, but it seems as if they do the same thing - create a file named "l"."/>

What do these commands mean and do?

89 Views Asked by At

What do these commands mean and do? "ls > l" and "ls >> l". I have tried them, but it seems as if they do the same thing - create a file named "l".

3

There are 3 best solutions below

0
On BEST ANSWER
ls > l

It create the file and write the output of ls into it.

ls >> l

But this command append the data to existing file if it exist else it does same as above mentioned .

0
On

This commands list a directory.

The first creates a new file every time it runs and write the output to the file. the second appends the output of ls to the existing file.

0
On
ls > l

It redirects to file. It creates the file and overwrites whatever is written in it.

ls >> l

It redirects and append stdout to file.