- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- vi commands
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Forums
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-31-2005 08:02 AM
тАО03-31-2005 08:02 AM
How Can I delete a line containing a lot of specific word in a vi file? Is there an option in vi editor?
Thanks
Bye
Solved! Go to Solution.
- Tags:
- vi
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-31-2005 08:15 AM
тАО03-31-2005 08:15 AM
Re: vi commands
editor, I don't think so. But you could easily do this
in command like. Something like:
# cat infile | grep -v specific_word > outfile
(infile is your file name and specific_word is the specific
word and outfile is the file which would be "infile" with
all the lines containing specific_word removed).
Is this what you want?
- Biswajit
- Tags:
- grep
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-31-2005 08:51 AM
тАО03-31-2005 08:51 AM
Re: vi commands
That is, same input and output file name?
In interactive vi this this easy:
/word
dd
For a script i would select grep -v as shown before, taking care not to blow away the input.
Or I would use the special perl option for this: -i = 'in place'
Example:
# cat > x
aap
noot
mies
# perl -ni -e 'print unless /noot/' x
# cat x
aap
mies
#
fwiw,
Hein.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-31-2005 08:51 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-31-2005 09:25 AM
тАО03-31-2005 09:25 AM
Re: vi commands
Ciao
Diego