answersLogoWhite

0

How do you remove blank lines from a file in linux?

Updated: 8/20/2019
User Avatar

PayamNab

Lvl 1
11y ago

Best Answer

sed -e '/^$/d'

User Avatar

Wiki User

11y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: How do you remove blank lines from a file in linux?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

HOW to Delete blank torrent file from desktop.U downloaded a torrent file off of a website and it created the actual file that you used to download the file you wanted but it also created this blank 1?

use a Linux CD like ubuntu. run it without make installation.with Linux file explorer find blank torrent files and simple delete it. peri.nic.


I have a file with 5000 lines but i need to duplicate each line 50 times to get a file with 250000 lines I'm using LINUX Any ideas?

copy and paste. easy and obviose.


What is the oldest Linux file system?

The first file system Linux supported was the MINIX file system.


What is file manager in Linux?

There is no set file manager in linux. Examples of Linux file managers include but: Nautilus (GNOME) Thunar (XFCE) Dolphin (KDE)


What is the Linux command to create a file named security?

As files can be of any number of types, there is no single command that will do this. You would use the program associated with that file type to create a file. If you wanted to create a "blank" file, that has no content and uses no space, use the command touch filename.


What option would allow the head command to display the last 5 lines in a file in Linux?

The 'head' command can only deal with the start of the file, not the end. If you want X number of lines at the end of the file then use the 'tail' command. tail -5 filename will list the last 5 lines of the contents of filename.


How do you remove write protection from a partition running Windows that's missing the hal.dll file and the rest of the partitions are running Linux?

If you are talking about accessing the partition from Linux, the kernel file system driver does not allow writing to NTFS partitions. You can write to the partition in Linux if you install the NTFS-3G file system. This is the only form of "write-protection" that should be on your system.


What Linux command displays the last part of a file without editing it?

The tail command can be used to output the last part of a text file. The default is to show the last 10 lines of a file and options are available to override this.


Explain three filter commands in UNIX?

head - list the first N lines of a file tail - list the last N lines of a file cut - remove columns in each line of a file.


Which command will display the last lines of the text file called file1in Linux?

Tail command is used to display the last lines of the file.Syntax:tail -n 3 file1-n 3 = no. of linesfile1 = filename


What is the Linux Virtual File System used for?

The Linux VFS (Virtual File System) may be thought of as a sort of interface between the Linux kernel and the mounted file systems. There can be many different file system types mounted simultaneously and VFS allows the Linux kernel to see and address them all in a similar way. This provides Linux with a great deal of flexibility. [JMH]


What file system does Red Hat Enterprise Linux use?

ext3 is the default file system for Red Hat Enterprise Linux.