The Big Data Zone is presented by Exaptive. Learn how rapid data application development can address the data science shortage.
When I hear the word “sort” my first thought is usually “Hadoop”! Yes, sorting is one thing that Hadoop does well, but if you’re working with large files in Linux the built-in sort command is often all you need.
Let’s say you have a large file on a host with 2GB or more of main memory free. The following sortcommand is a efficient way to lexicographically-order large files.
LC_COLLATE=C sort --buffer-size=1G --temporary-directory=./tmp --unique bigfile.txt
Let’s break this command down and examine each part in detail.
The Big Data Zone is presented by Exaptive. Learn about how to rapidly iterate data applications, while reusing existing code and leveraging open source technologies.
Published at DZone with permission of
, DZone MVB
Opinions expressed by DZone contributors are their own.