All Questions
12
questions
0
votes
1
answer
306
views
Linux shell - Sort on a numerical column
I'm using the linux shell in a jupyter notebook. I'm trying to filter rows of a .csv file to only keep those including 'Government expenditure on education, total (% of GDP)', then to only keep ...
0
votes
1
answer
214
views
Issue with sorting in Linux/Unix
I have two very long comma delimited files. Each line has around 101 columns on both the files and each file has 41705 records.
Before Sorting File A & File B both:-
01B60D9F4DEB83,FY
...
1
vote
1
answer
2k
views
Linux Shell - Sort a text file by the length of each line, then print the shortest line
I have a file, file.txt, that contains the following:
This is many letters
This is few
Hi
This is a very long sentence.
(It actually is a few thousand lines long,
but I am new to Linux, and want to ...
1
vote
2
answers
4k
views
How do I sort files by date in filename?
I have a set of filenames like this
vorlesung 02.11.15.mp4
vorlesung 04.01.16.mp4
vorlesung 07.12.15.mp4
vorlesung 09.11.15.mp4
vorlesung 09.12.15.mp4
...
The last part of the file name is a date in ...
1
vote
1
answer
195
views
Unix shell: Multi-level sort in opposite directions
I have a directory full of plain text files that have tags on the first line, and I want to get a list of the tags and their frequency. I've extracted the tags and sorted them into a big list; let's ...
5
votes
1
answer
18k
views
How to sort the output of find? [duplicate]
I'm using the find command to list files with their name containing a string:
find ~/ -type f -name "*inductive*"
I would like to use a pipe to sort the resulting list of files. I would like to be ...
8
votes
2
answers
2k
views
Is there a Unicode-aware LC_COLLATE sort order which respects punctuation?
As far as I can tell, setting the environment variable LC_COLLATE=en_US.utf8 changes four things compared to LC_COLLATE=c, regarding how programs like ls will sort files:
Unicode characters are ...
2
votes
1
answer
16k
views
Is there a way around broken pipe?
I have a directory with a large number of files.
./I_am_a_dir_with_many_subdirs/
Within a script I'd like to find all subdirs in it, to sort them and to output to a bash array. So, I do:
...
0
votes
1
answer
1k
views
Use the ascii code of a character as an input to sort
I'd like to sort a file with a specific delimiter (ascii 0xff) and the records are zero-terminated. I cannot use the following command though:
$ sort -z -t \xff -o data data
The error message is:
...
4
votes
2
answers
2k
views
Linux command line / Move files filtered by lexicographic order
I have some files in a directory that are named IMG_0001.jpg ... IMG_9999.jpg. I want to move to another directory the files that lexicographically have a name greater than IMG_9431.jpg How can I do ...
4
votes
4
answers
8k
views
Reverse order using command
Is there a way i use the ps --sort option on a linux to display the processes in reverse order based on the process ID or is there another command i can use for this?
0
votes
4
answers
374
views
need advise on using sort command in Linux
How to sort a file using sort command..
I would like to sort the file based on 2nd field which is seperated by "," as a delimiter
Ex:
filename1, 465, output_file1,
filename2, 300, output_file2,
...