Questions tagged [sort]

25 questions
26
votes
7 answers

Sort a list of domain names (FQDNs) starting from tld and working left

I am looking to sort a list of domain names (a web filter whitelist) starting from the TLD and working upwards. I am looking any *nix or windows tools that can do this easily, though a script would be fine too. So if the is the list you are…
Zoredache
  • 128,755
  • 40
  • 271
  • 413
8
votes
2 answers

How to sort top result on virtual memory on Redhat Linux?

There is an interactive key "M" to sort by memory, which seems to be sorting on resident memory. Is there a way to sort on virtual memory? I happen to be working on Redhat Linux, but the question is not specific to this distribution.
timeon
  • 183
  • 1
  • 1
  • 5
8
votes
1 answer

Find, and sort results by date created

How can I sort the results of find? I want to sort by date created asc? find /docs -type f | sort Sorts by filename not date created. Thanks.
Justin
  • 5,008
  • 19
  • 58
  • 82
7
votes
2 answers

Unix sort for partially ordered data sets

So I have an enormously large file (around 10GB) and need to sort it, just like in using 'sort' utility, but kindof more effectively. Problem is, that I don't have memory, CPU power, time, nor free swapping space to power the whole sort. The good…
exa
  • 571
  • 4
  • 14
6
votes
1 answer

File size limit exceeded in bash

I have tried this shell script on a SUSE 10 server, kernel 2.6.16.60, ext3 filesystem the script has problem like this: cat file | awk '{print $1" "$2" "$3}' | sort -n > result the file's size is about 3.2G, and I get such error message: File size…
yboren
  • 61
  • 1
6
votes
3 answers

Sorting large binary files

Is there Unix utility for sorting large files containing fixed length binary records? In other words, I'm looking for something like sort(1) but for binary files with fixed length records. I could convert the files into text, then sort using…
HughE
  • 163
  • 1
  • 4
6
votes
4 answers

need high performance /bin/sort; any suggestions?

I'm looking for a high performance /bin/sort drop in replacement. I know there is pbzip2 for using multiple cores, but is there a similar product for /bin/sort? I've found distsort.sh, but I want something less IO intensive. I'm looking to sort…
Daniel
  • 175
  • 1
  • 6
4
votes
0 answers

Fastest way to sort very large files preferably with progress

I have a 200GB flat file (one word per line) and I want to sort the file, then remove the duplicates and create one clean final TXT file out of it. I tried sort with --parallel but it ran for 3 days and I got frustrated and killed the process as I…
GMX Rider
  • 141
  • 2
4
votes
1 answer

How can I sort ls -l /dev by type and major and minor device number?

How can I sort the /dev directory by type and major and minor device number when doing ls -l? The best way I've found so far is: ls -l /dev | sort -k 1.1,1.2 -k 5n -k 6n | less Is there a better way?
Dennis Williamson
  • 60,515
  • 14
  • 113
  • 148
3
votes
1 answer

jq sort by date (iso 8601)

I try to sort json by date (field CreationTimeUTC) in iso 8601 format with jq 1.5. I found this post, but that return : 'Cannot index boolean with string "CreationTimeUTC"' jq '.Entities.BackupJobSessions.BackupJobSessions[] |…
user5525652
  • 137
  • 1
  • 4
  • 12
3
votes
1 answer

Sort installed packages version

I'm trying to get last version of installed kernel package. The main difficulty is that in my case the versions may be installed in a wrong order, so I cannot simply use the --last argument from rpm. I wanted to use the coreutils' sort command…
aveuiller
  • 245
  • 1
  • 5
  • 8
3
votes
3 answers

How to set sort(1) to use a custom collation?

I have a text file containing one record per line which I'd like to sort alphabetically, except that I want '-' to sort after '[' and ']'. (The natural sort order has '-' before the square brackets.) Is there a way to modify the collation that…
uckelman
  • 183
  • 5
1
vote
1 answer

ls -lt not working in SFTP

I log into sftp: sftp user@server Then I run: ls -lt I expect files to be sorted by date. sftp> ls -lt *.csv -rw------- 0 76547986 200 5073032 Mar 14 08:42 file1.csv -rw------- 0 76547986 200 5073032 Mar 15 08:41…
1
vote
2 answers

How to view specific interval of timestamp in huge log file?

How to view what happened to server in specific time period and specific date? For example: I want to see what happened 23.03.2013 from 6-8am i want to use command line, maybe cat+grep+sort ? log looks like "Mar 24 22:32:49 serv named[21804]"
barraba
  • 35
  • 1
  • 1
  • 7
1
vote
2 answers

postfix sort mails using a cronjob

My mailserver consists of dovecot and postfix. I am receiving alot of mails from different mailing lists. These mails should directly go into my inbox when they come in, because it is easier to maintain a single inbox for me then multiple…
Zulakis
  • 4,191
  • 14
  • 44
  • 75
1
2