LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
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!

Notices


Reply
  Search this Thread
Old 09-11-2008, 04:53 AM   #1
Junior_DBA
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
tredegar
LQ 5k Club
 
Registered: May 2003
Location: London, UK
Distribution: Fedora38
Posts: 6,147

Rep: Reputation: 435Reputation: 435Reputation: 435Reputation: 435Reputation: 435
Quote:
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
RMLinux
Member
 
Registered: Jul 2006
Posts: 260

Rep: Reputation: 37
Quote:
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
farslayer
LQ Guru
 
Registered: Oct 2005
Location: Northeast Ohio
Distribution: linuxdebian
Posts: 7,249
Blog Entries: 5

Rep: Reputation: 191Reputation: 191
You may find these cheat sheets helpful in learning vi.

http://www.viemu.com/a_vi_vim_graphi..._tutorial.html
 
Old 09-11-2008, 10:05 AM   #5
trickykid
LQ Guru
 
Registered: Jan 2001
Posts: 24,149

Rep: Reputation: 269Reputation: 269Reputation: 269
Quote:
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
lleb
Senior Member
 
Registered: Dec 2005
Location: Florida
Distribution: CentOS/Fedora/Pop!_OS
Posts: 2,983

Rep: Reputation: 551Reputation: 551Reputation: 551Reputation: 551Reputation: 551Reputation: 551
http://www.cbu.edu/ietc/faq/vifaq.html

that is a good basic set of VI commands.
 
  


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 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

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

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