Questions tagged [sort]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
1 vote
0 answers
40 views

Sort two config files in the same order

I have two servers running the same set of internally developed apps. One is the "production" server, the other is the "dev/test" server. As time has gone on, the config files ...
Egyas's user avatar
  • 151
0 votes
0 answers
57 views

atop: how to sort arbitrary column like STTIME and STDATE?

Command atop -v shows start date (STDATE) and star time (STTIME) columns. How to sort them? atop man list sorting possibilities only for: -C 'CPU consumption (default) -M 'memory consumption -D '...
triopium's user avatar
4 votes
1 answer
5k views

How to output all files/folders ordered by size, including hidden ones

How can I output all files/directories, ordered by size, including hidden ones (those whose name starts with a dot), all in one go? 1 The difference to How can I sort du -h output by size is that I'm ...
Henke's user avatar
  • 285
-1 votes
1 answer
205 views

PowerShell: How to get a list of the top biggest files (of a certain type)?

Getting the biggest file list might look like gci -r|sort -descending -property length | select -first 10 name, length How can I add a specific filetype selection , like ascii or formated log/json/...
francois P's user avatar
3 votes
1 answer
4k views

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....
user5525652's user avatar
4 votes
0 answers
2k views

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 ...
GMX Rider's user avatar
  • 141
1 vote
1 answer
2k views

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 ...
cheesesticksricepuck's user avatar
0 votes
1 answer
177 views

Cron Apache Access Log Keep Certain Lines Remove Duplicates

I'm trying to create a nightly cron that keeps certain lines from the access_log (into a file), then removes (near) duplicates from that file, then empties the access log and restarts Apache. I have ...
Pear's user avatar
  • 1
3 votes
1 answer
5k views

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. ...
aveuiller's user avatar
  • 245
0 votes
1 answer
138 views

Sort the output of the "who" command

I'm trying to sort the output of the who command but I guess I'm kinda lost on this one. I want to sort it based on who just logged in. Thanks
Ulises's user avatar
  • 1
0 votes
2 answers
3k views

linux + delete duplicate IP's from file

what the best way to remove duplicate IP's from file I use the command: sort file | uniq but I am not sure if this is the best way , maybe I missed something? remark: my file contain two ...
yael's user avatar
  • 2,433
1 vote
2 answers
39k views

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 ...
barraba's user avatar
  • 35
6 votes
1 answer
1k views

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 ...
yboren's user avatar
  • 61
1 vote
2 answers
774 views

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 ...
Zulakis's user avatar
  • 4,163
6 votes
3 answers
4k views

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 ...
HughE's user avatar
  • 163
1 vote
2 answers
1k views

Continual tailing and sorting of multiple files on linux?

Is there a way to use pipes or FIFO in combination to continually monitor several (same format) log files whilst sorting on the first field and then being able to effectively do a tail -f on that ...
Jon Scobie's user avatar
0 votes
2 answers
2k views

Solaris + sort file according to date and time by sort command

I have along list that created in /var/tmp/file.txt from some script (in Solaris machine) the following list have 4 fields please advice how to sort the list according to the following TIMESTAMP ( by ...
yael's user avatar
  • 2,433
9 votes
3 answers
20k views

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 ...
timeon's user avatar
  • 193
1 vote
1 answer
1k views

Method for sorting VMWareVMs by annotation fields

Background: One of the policies of our vCenter cluster is for (almost) every VM to have an "expiration date". This is a custom field in the annotations panel that is mainly a reminder to contact the ...
Jack's user avatar
  • 209
29 votes
10 answers
10k views

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 ...
Zoredache's user avatar
  • 131k
8 votes
1 answer
19k views

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's user avatar
  • 5,358
7 votes
2 answers
972 views

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 ...
exa's user avatar
  • 571
-1 votes
3 answers
2k views

Sorting IPv4 Addresses [closed]

So I've run into a quandary on sorting IPv4 addresses, and didn't know if there was a set rule in some obscure networking document. Do I do a straight sort on the raw address only (such as converting ...
Kumba's user avatar
  • 618
3 votes
3 answers
296 views

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.) ...
uckelman's user avatar
  • 183
6 votes
4 answers
3k views

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 ...
Daniel's user avatar
  • 175
1 vote
3 answers
902 views

Perfectly reproducable select statement default ordering issue

I've recently been chasing an issue with a client's db... solution found, but impossible to recreate. Essentially, we're doing a Select * from mytable where ArbitraryColumn = 75 Where MyTable has ...
Dave's user avatar
  • 281
0 votes
3 answers
1k views

Increase the performance of sort command on a multi-processor Sun Solaris box

I have a bunch of (rather large i.e. >100MB) comma separated files which needs sorting on 4 processor box with SunOS 5.10 Sort appears to run rather slow (minutes) I am wondering if there is any way ...
Adrian's user avatar
  • 229
4 votes
1 answer
910 views

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 ...
Dennis Williamson's user avatar