How to navigate previous files one by one.


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers How to navigate previous files one by one.
# 1  
Old 08-14-2008
How to navigate previous files one by one.

Hi
can you tell me if i have opened no of files using vi editior then how can i navigate previous files one by one.
Suppose i have opened five files using vi editor as below
vi file1 file2 file3 file4 file5

and nom i am in the last file file5 then if i want to go to previous file file 4 and then file3 and then file2

How can i go there.
using :e# and :n we can navigate only 2 files. but for more than 2 files how to navigate.
# 2  
Old 08-14-2008
Hi Ajay,

Try navigate the files using :n for next and :N for previous files in vi.

#vi file1 file2 file3 file4 file5


and you can also use vim editor for :bn for next :bp for previous with -p option.

#vim -p file1 file2 file3 file4 file5


Have a great day,
# 3  
Old 08-14-2008
Hi narasimhulu
thanks for Reply
but when i use :N in the vi editor it says
N: Not an editor command
# 4  
Old 08-14-2008
Hi,

May i know the version of vi editior you are using? or os?
# 5  
Old 08-14-2008
To switch between files in vi or vim:
:e#1 switch to first file
:e#2 switch to second file etc.
:e# switch to previous file or use Ctrl ^
# 6  
Old 08-14-2008
Hi Ajay,

You can use :n for the next file one by one ....

and :rev or :rew ...try any one of these , it should work.

Thanks...
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

Find files modified in previous minute only

Hi, How can I get files which are modified only in last minute ? it should not display 2 minutes back filels -la -rw-rw-r-- 1 stuser st 51 Dec 3 09:22 a.csv -rw-rw-r-- 1 stiser st 50 Dec 3 09:25 b.csv -rw-rw-r-- 1 stuser st 53 Dec 3 09:33 c.csv When I run command at 9:34am then I... (7 Replies)
Discussion started by: sbjv
7 Replies

2. UNIX for Dummies Questions & Answers

How to Navigate to Windows Desktop?

I want to use my Desktop for saving files of my codes. Looking for Desktop in my OS (C : ) and couldn't find it anywhere. Is it possible to navigate to your desktop? If so how? By the way, I am using Cygwin. (6 Replies)
Discussion started by: DyslexicChciken
6 Replies

3. Shell Programming and Scripting

Remove previous line if next & previous lines have same 4th character.

I want to remove commands having no output. In below text file. bash-3.2$ cat abc_do_it.txt grpg10so>show trunk group all status grpg11so>show trunk group all status grpg12so>show trunk group all status GCPKNYAIGT73IMO 1440 1345 0 0 94 0 0 INSERVICE 93% 0%... (4 Replies)
Discussion started by: Raza Ali
4 Replies

4. UNIX for Dummies Questions & Answers

List the files of previous day

I am using KSH. d=date | nawk '{ print $2,$3-1}' ls -lrt SystemOut* | nawk '/d/{print $NF}' I am trying to list the files of previous day but it doesn't seem to be working and i am also not getting an error. result is blank.Need help. (11 Replies)
Discussion started by: vagar11
11 Replies

5. UNIX for Dummies Questions & Answers

How to count previous days files

Hi i know how to get no of files in some particular folder by following command which includes today and previous days files also ls |wc -l but i needed a command in which i can list previous one or two days files only. (4 Replies)
Discussion started by: rahiljavaid
4 Replies

6. Shell Programming and Scripting

need to navigate into specified folder and delete the files

Hi all, I need to write a script to naviagate into the list of specified folder and delete the files in it. I have mentioned the list of folders in a external file so it can be reusable. The issue is am facing now is that, i am not understating on how to navigate into the folder locations... (6 Replies)
Discussion started by: Nithz
6 Replies

7. Shell Programming and Scripting

Script That Can navigate to 3 differents directory & remove files under them

Hi I am Trying to Write a script that can goto 4 different directorys on the server & remove the Files older then 30 days ?? /logs logs1 logs2 logs3 Now I need to remove files under logs1 logs2 logs3 which are older then 30 days whose name stat 'sit' , 'mig','bld' . in... (3 Replies)
Discussion started by: Beginner123
3 Replies

8. Shell Programming and Scripting

How Do I Navigate To A Directory???

I am trying to install some applications, on my linux OS and all the instructions are tell me that ill have to navigate to the directories and type the link that they provide, but i try typing 'dir' which shows me the directories but to access a particular one i can't remember how??? can anyone... (2 Replies)
Discussion started by: kprescod4158
2 Replies

9. UNIX for Dummies Questions & Answers

Can you navigate ABOVE the home directory?

Hello, How do I navigate to the level ABOVE the home directory? I have the following structure on my drive, bearing in my I'm using a cygwin port on Windows. C:\ C:\cygwin C:\cygwin\bin C:\cygwin\otherfolders C:\cygwin\home (the home directory) C:\cygwin\home\H (my user directory) ... (4 Replies)
Discussion started by: patwa
4 Replies

10. Shell Programming and Scripting

How to get previous month files

Hi, My task to to delete files which are of previous months. I have files named as follows *CCYYMMDD.xls. on a particular day i have delete previous months files i.e in Dec i have delete all nov files which look like 200511DD.XLS in Jan i have to delete all Dec files 200512DD.xls ... (7 Replies)
Discussion started by: savitha
7 Replies
Login or Register to Ask a Question