LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 10-05-2006, 12:59 AM   #1
pradeepkoodvalli
LQ Newbie
 
Registered: Oct 2006
Posts: 3

Rep: Reputation: 0
Vi editor


I have 2 questions :
1) How to search a particaular file (say test.txt) from any directory in vi?
2) Is there a command to release ip address in vi?
 
Old 10-05-2006, 02:24 AM   #2
jlliagre
Moderator
 
Registered: Feb 2004
Location: Outside Paris
Distribution: Solaris 11.4, Oracle Linux, Mint, Debian/WSL
Posts: 9,789

Rep: Reputation: 492Reputation: 492Reputation: 492Reputation: 492Reputation: 492
These aren't editing commands.
You can run any shell command by using the ":!" prefix.

e.g.
Code:
:!locate test.txt
 
Old 10-05-2006, 02:26 AM   #3
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405
Hi,

I do assume that you are using vim, not vi (most modern distro's use vim):

Question 1:

In command mode do the following:

:! find /path -name "*whatever*" -print This uses find, to use locate:
:! locate whatever

Question 2:

I really don't know what 'releasing an ip address' is supposed to do.
But most commands can be executed from vi(m) using the ! before the command.

Another example: Uniquely sorting lines 31 to 55:
:31,55 ! sort -n

Hope this helps
 
Old 10-05-2006, 05:41 AM   #4
Wim Sturkenboom
Senior Member
 
Registered: Jan 2005
Location: Roodepoort, South Africa
Distribution: Ubuntu 12.04, Antix19.3
Posts: 3,794

Rep: Reputation: 282Reputation: 282Reputation: 282
Maybe TS confuses vi and bash? If so, leave the :! out of the above commands.
 
Old 10-27-2006, 03:54 AM   #5
pradeepkoodvalli
LQ Newbie
 
Registered: Oct 2006
Posts: 3

Original Poster
Rep: Reputation: 0
Thanks a lot for the first answer.

Releasing the ip address in windows needs to issue a command ipconfig/release in command prompt. This command is used when we go for clean install of new OS (Say installing Win XP over Win 2K ). Is there a command similar to it in Linux?

Thanks
Pradeep


Quote:
Originally Posted by druuna
Hi,

I do assume that you are using vim, not vi (most modern distro's use vim):

Question 1:

In command mode do the following:

:! find /path -name "*whatever*" -print This uses find, to use locate:
:! locate whatever

Question 2:

I really don't know what 'releasing an ip address' is supposed to do.
But most commands can be executed from vi(m) using the ! before the command.

Another example: Uniquely sorting lines 31 to 55:
:31,55 ! sort -n

Hope this helps
 
Old 10-27-2006, 04:54 PM   #6
jlliagre
Moderator
 
Registered: Feb 2004
Location: Outside Paris
Distribution: Solaris 11.4, Oracle Linux, Mint, Debian/WSL
Posts: 9,789

Rep: Reputation: 492Reputation: 492Reputation: 492Reputation: 492Reputation: 492
Quote:
Originally Posted by pradeepkoodvalli
Releasing the ip address in windows needs to issue a command ipconfig/release in command prompt. This command is used when we go for clean install of new OS (Say installing Win XP over Win 2K ). Is there a command similar to it in Linux?
This having nothing to do with vi, please start a new thread with this question in the linux networking forum.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
about the vi editor zwylinux Programming 12 05-28-2006 12:35 PM
C++ editor onelung02 Programming 12 05-11-2005 01:51 AM
what about your editor ? black General 16 12-03-2003 08:16 PM
Vi Editor BittaBrotha Linux - Software 1 02-09-2003 12:35 PM
Which editor? keymoo Linux - Newbie 26 11-10-2002 11:46 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 03:15 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration