Skip to content
Advertisement

Tag: sorting

list file key-pair sorted by time

I need to sort a filename pair sorted by time. Every file starts with AUSZUG or UMSATZ (and some numbers after). But the problem is that I cannot sort it by just time because some files can be uploaded (created) not as pair. For example, default sort: You can see, UMSATZ pair for AUSZUG_5785745789.TXT.GPG are in last line I can

How to find newest files with a certain name?

Suppose I have a directory with many files of the same name in subdirectories (for example, comes up when keeping BibTeX files for multiple academic papers). What’s the best way to find the newest version of a file with a given name? I’ve come up with the following command which lists all the files named someFile along with their dates,

Sort files numerically in bash

I need to sort .flv files numerically and i was able to do it with the following command: but with many files(hundreds) it’s not sorting correctly. but the strange this is, if i’m ruining the command without “*.flv” it’s working. i could use just ls but i have other file types in the folder. what i’ve tried so far: Answer

Sorting a tab delimited file

I have a data with the following format: Now I tried to sort the file based on the last field decreasingly. I tried the following commands but it wasn’t sorted as we expected. What’s the right way to do it? Here is the sample data. Answer Using bash, this will do the trick: Notice the dollar sign in front of

Advertisement