LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
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 08-29-2007, 05:46 PM   #1
carlosinfl
Senior Member
 
Registered: May 2004
Location: Orlando, FL
Distribution: Arch
Posts: 2,905

Rep: Reputation: 77
VIM Command To Replace Entries?


I recall my old boss showing me a command in VIM that I wish I had written down. I have over 200 users in /etc/passwd and they are all set to /bin/bash. I recall a command starting with "$" that would globally change all entries from /bin/bash to /bin/false.

Anyone know where I can find this or how I would execute this in VIM? I tried a Google search and was unable to find what I was looking for.
 
Old 08-29-2007, 06:05 PM   #2
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,415
Blog Entries: 55

Rep: Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600
Something like
Code:
:s/\/bin\/bash/\/bin\/false/g
? But that's global. You probably will want to add a range :-]
 
  


Reply



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
vim search and replace only one line hakmed Programming 5 11-07-2006 07:13 PM
replace a word in vim editor fssengg Linux - Newbie 3 03-10-2005 08:39 AM
Help - how to find and replace in Vim stardotstar Linux - Software 7 10-14-2004 11:31 PM
Replace word in VIM ICO Linux - Software 2 03-17-2004 01:28 AM
problem in perl replace command with slash (/) in search/replace string ramesh_ps1 Red Hat 4 09-10-2003 01:04 AM

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

All times are GMT -5. The time now is 07:09 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