Tip: Remove Duplicate Lines in File Using Perl
Here is little nifty code I found to snip or remove duplicate lines in a file using Perl. An example of a file that has duplicate lines looks like this:
/home/index.php
/home/links.php
/home/index.php
The result we want to achieve is this:
/home/index.php
/home/links.php
And here goes the code:
$ftmp = 'file.txt';
my %match = ();
{
local @ARGV = ($ftmp);
local $^I = '.tmp';
while(<>){
$match{$_}++;
next if $match{$_} > 1;
print;
}
}
The original file, file.txt, has its duplicate lines removed.
Pinoy Tux Reaches 50k Visitors
Boo-yah!
With over a year in providing useful Linux tips and what-not to all people around the world, Pinoy Tux reaches 50,000 visits.
To those who are consistent readers of my blog, and those who use Pinoy Tux as Linux reference, I thank you for your support. ![]()
Fedora 10
I just found out that Fedora 10 is available for download.
In a nutshell, Fedora 10 has these changes from its predecessor, Fedora 9:
- Wireless connection sharing enables ad hoc network sharing
- Better setup and use of printers through improved management tools
- Virtualization storage provisioning for local and remote connections now simplified
- SecTool is a new security audit and intrusion detection system
- RPM 4.6 is a major update to the powerful, flexible software management libraries
- Glitch free audio and better performance is achieved through a rewrite of the PulseAudio sound server to use timer-based audio scheduling
- Improved webcam support
- Better support for infrared remote controls makes them easier to connect and work with many applications
- The paths
/usr/local/sbin:/usr/sbin:/sbinhave been added to thePATHfor normal users, to simplify command-line administration tasks
Just to let you know, I am still stuck with Fedora Core 6. I would *love* to upgrade to higher version, I just can’t find a server large enough to fit my backup files in.
Linux Kernel Ready for IPv6
Linux Kernel is ready for the incoming IPv6 compliance with Defense Information System Agency’s IPv6 Special Interoperability Certification, according to Linux Foundation. This means that all Linux distributions that run the updated Linux kernel should be able to pass the certification.
Although there a lot more features to work on the IPv6 of Linux kernel these past few years, which includes Internet Control Message Protocol, Internet Protocol Security, Dynamic Host Configuration Protocol and Management Information Base, engineers are working together to address the shortcomings. Engineers from HP, Nokia-Siemens, Novell and Red Hat got their hands dirty in getting the IPv6 into full swing.
Joint Interoperability Test Command (JITC) has already certified two Linux distributions: Novell’s Suse Linux Enterprise (SLES10) and Red Hat Enterprise Linux (RHEL 5.2).
Search PinoyTux
Subscribe to Email Feeds
Blog Lounge
Popular Posts
Recent Posts
Drop your Card Here
Recent Comments
- Belarus Hava Yolları, Belarus airlines, Uçak Bileti, Air tickets, Belarus uçak on Cebu Pacific Sucks
- Cezayir Hava Yolları, Cezayir airlines, Uçak Bileti, Air tickets, Cezayir uçak on Cebu Pacific Airlines is Evil!
- Lambchop on Cebu Pacific Airlines is Evil!
- rabat on Linux Comics of the Day
- Kost on Item for Sale: 1GB DDR400 Kingston Memory









