Files search in vi editor


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers Files search in vi editor
# 1  
Old 07-14-2009
Files search in vi editor

Hi All,

Apologise if I am in the wrong forum,

I am trying to view all files one by one in the vi editor that contain a pattern.

This command work but not sure where to pipe it to use vi editor

find . -name "pattern" -print | xargs -ltr


tnx in advance
# 2  
Old 07-14-2009
Please use CODE-tags when posting code, data or logs for better readability. This is not much code but just a good habbit next time Smilie

Code:
vi `find . -name "pattern" -print`

When you are done with one, do a :w to write it and a :n to load the next file.
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Solaris

Editor for working with large files

Hi, We have file which is about 756 MB of size and vi/vim do not work when we try to edit this file. I'm looking for any editor ( ok if its NOT free ) which has the ability to open/edit a file of 1+GB seamlessly. The OS is SUN Solaris 10 ( Sparc ) Thanks in Advance Maverick (13 Replies)
Discussion started by: maverick_here
13 Replies

2. Shell Programming and Scripting

How to search number of occurrences of a particular string in a file through vi editor?

i have one file, i am doing 'vi Filename' now i want to search for particular string and i want to know how many times that string occurs in whole file (5 Replies)
Discussion started by: sheelsadan
5 Replies

3. Shell Programming and Scripting

copying the files in vi editor

Hi, For a particular file i used Vi editor to view the content and i have to copy the same , But in the files if have 1000 lines and i have to copy the file contents from 700th to 900th lines But while copying i'm dragging the mouse from top to bottom but i supposed to copy the lines... (8 Replies)
Discussion started by: thelakbe
8 Replies

4. SuSE

Search all files based on first and in all listed files search the second patterns

Hello Linux Masters, I am not a linux expert therefore i need help from linux gurus. Well i have a requirement where i need to search all files based on first patterns and after seraching all files then serach second pattern in all files which i have extracted based on first pattern.... (1 Reply)
Discussion started by: Black-Linux
1 Replies

5. Shell Programming and Scripting

How to check binary files in VI editor?

Hi, i have a file that contain both text and binary inside the file.. i want to see the binary part.. how can i check that ? (2 Replies)
Discussion started by: mail2sant
2 Replies

6. Shell Programming and Scripting

set EDITOR=vi -> default editor not setting for cron tab

Hi All, I am running a script , working very fine on cmd prompt. The problem is that when I open do crontab -e even after setting editor to vi by set EDITOR=vi it does not open a vi editor , rather it do as below..... ///////////////////////////////////////////////////// $ set... (6 Replies)
Discussion started by: aarora_98
6 Replies

7. UNIX for Advanced & Expert Users

Search files with specfic extention and later search content

Hi, I would appriciate if somebody can help me figure out how to search for all the *.xml file under a specific directory and subdirectroies (/home/username) and later search of content "<start>" inside the xml file returned by search. -Lovin.V (2 Replies)
Discussion started by: lovi_v
2 Replies

8. UNIX for Dummies Questions & Answers

Syntax coloring for .pc files in VIM editor

Hi, i am using VIM editor through Putty. By the option of Syntax on in .vimrc file i am able to see syntax colors in .c and .cpp files but not in the files with .pc extension. How can this be done? :confused: (2 Replies)
Discussion started by: RuchK
2 Replies

9. UNIX for Advanced & Expert Users

Unable to open files in VI editor

Hi, I unable to open any file using Vi editor,constantly getting the following error, vi log.log *** glibc detected *** malloc(): memory corruption: 0x081af510 ** uname -a Linux sekac092 2.6.5-7.244-bigsmp #1 SMP Mon Dec 12 18:32:25 UTC 2005 i686 athlon i386 GNU/Linux Also Note ls... (8 Replies)
Discussion started by: ennstate
8 Replies

10. UNIX for Dummies Questions & Answers

Search command on vi editor

Hi all, Here is an example, I would wan to search for all string consists of IMP but not IMP-00015. Values other than 00015 is fine, is there anyone knows how to do that? Thanks. (2 Replies)
Discussion started by: *Jess*
2 Replies
Login or Register to Ask a Question