The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Dummies Questions & Answers
.
google unix.com




Thread: grep command
View Single Post in the UNIX and Linux Forums - Click on the Thread or Permalink to View Entire Thread -->
  #2 (permalink)  
Old 06-20-2005
google's Avatar
google google is offline Forum Advisor  
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