|
> operator will create a new file (if the file exists, this operation will over write the contents of the file.
>> will append to an existing file.
In both cases, if the file does not already exist, it will be created.
cat file | grep "pattern" > my_new_file
ls -a | grep "pattern" >> my_new_file
grep "pattern" file > my_new_file
|