Welcome to the most active Linux Forum on the web.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!


  Search this Thread
Old 09-11-2008, 04:53 AM   #1
LQ Newbie
Registered: Aug 2008
Posts: 25

Rep: Reputation: 15
vi delete empty line?

Hi! Nebie question. How can i delete an empty line vi?

I used ctrl+d but with out success
Old 09-11-2008, 05:00 AM   #2
LQ 5k Club
Registered: May 2003
Location: London, UK
Distribution: Debian "Testing"
Posts: 6,116

Rep: Reputation: 416Reputation: 416Reputation: 416Reputation: 416Reputation: 416
I used ctrl+d but with out success
Why ctrl+d ?
dd is what you want.
And read a vi tutorial.
Old 09-11-2008, 05:18 AM   #3
Registered: Jul 2006
Posts: 260

Rep: Reputation: 37
Originally Posted by Junior_DBA View Post
Hi! Nebie question. How can i delete an empty line vi?

I used ctrl+d but with out success
1. put your cursor on the empty line
2. press ESC to make sure you are in the command mode.
3. then press "dd" to delete the current line.
Old 09-11-2008, 07:50 AM   #4
LQ Guru
Registered: Oct 2005
Location: Northeast Ohio
Distribution: linuxdebian
Posts: 7,247
Blog Entries: 5

Rep: Reputation: 191Reputation: 191
You may find these cheat sheets helpful in learning vi.
Old 09-11-2008, 10:05 AM   #5
LQ Guru
Registered: Jan 2001
Posts: 24,149

Rep: Reputation: 256Reputation: 256Reputation: 256
Originally Posted by tredegar View Post
And read a vi tutorial.
Just telling someone who's fairly new to just go read a tutorial isn't very helpful. At least link to one if you're gonna tell them such things..
Old 09-11-2008, 03:21 PM   #6
Senior Member
Registered: Dec 2005
Location: Florida
Distribution: CentOS/Fedora/Pop!_OS
Posts: 2,841

Rep: Reputation: 544Reputation: 544Reputation: 544Reputation: 544Reputation: 544Reputation: 544

that is a good basic set of VI commands.


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 Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
vim how to delete until the first empty line edenCC Linux - Software 2 05-03-2007 10:26 PM
can not delete NON-EMPTY directories through samba share Sandor Linux - Software 2 02-16-2006 03:06 AM
How to delete non-empty directories? Also have a terminal question Nylex Linux - General 10 07-15-2005 11:51 PM
how to search for and delete empty directories? BrianK Programming 4 06-03-2005 07:24 AM
Delete Empty files whospeaks2me Linux - Newbie 2 07-18-2003 10:39 PM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 07:07 PM.

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