quick redhat terminal question

Soldato
Joined
31 Oct 2005
Posts
8,844
Location
Leeds
hi there, without going into the why's and background information

I'm a very new user when it comes to linux

How would I go about taking certain information from one file and outputting it as another

E.g

File A has 20 records, 15 of these records start c35

I wish to grab these c35 records and > output them as a text file

I'm currently looking along the lines of

cat /directory/file [c35].* /myhomedirectory >stuff.txt

Or would I be better using the more / less commands

I know this to be wrong but am unable to work out where to go from here

Cheers for any pointers
 
Just to add that if you want to ensure it is only records (lines) that start with c35, you can apply patterns to grep, too.
Code:
cat /file | grep "^c35" > /otherfile
 
Back
Top Bottom