The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Dummies Questions & Answers
Google UNIX.COM



Thread: grep command
View Single Post in UNIX Forums - Click on the Thread or Permalink to View Entire Thread -->
  #2 (permalink)  
Old 06-20-2005
google's Avatar
google google is offline
Moderator
 

Join Date: Jul 2002
Location: Atlanta
Posts: 740
> 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
Reply With Quote