Skip to content
Advertisement

Tag: sorting

Bash sort ignore first 5 lines

I’m having trouble ignoring the first 5 lines of my file while sorting the rest. My current command sorts the entire file by the second item, however I need to skip the first 5 “header” lines. I need read it and write it to the same file. Current Command Example Answer This sorts lines 6 and after of the file

sorting rows of a data file with Linux

I would like to sort the lines of a data file (each line idependent from each other) from the first character. For example, if I have a data file I would like to end with something like I have tried to do it using the sort command, but it sorts the columns (not the line). Transposing the data file +sort

Grouping and deleting Files

I have to come up with a solution to delete all files but the newest 2 in a directory stucture of our owncloud. The be exact – its the file versioning folder. There are files in one folder with the following structure: Filename.Ext.v[random_Number] The hard part is that there are different files in one folder I need to keep. IE:

Linux – Sort files by part of name (no delimiters)

I want to get a sorted list of files. Files have the following naming convention: DATENUMBER.txt (without spaces). E.g., file 3 on 2015-12-09 looks like: 201512093.txt The version sort option of ls doesn’t help me: sort -V, –key=1.[number] do not work too as I have different filename length. As I have no delimeter between the date and the number, sort

Sorting of data in descending order

Allow me to clarify my query: I have a database with thousand of character strings, followed by some values (based on scoring matrix) There are equal values also present. I am trying to sort the data in descending order using: But the data is still disarranged. Also tried by adding -k argument. Is it possible that i could get the

Using linux sort on multiple files

Is there a way I can run the following command with Linux for many files at once? Answer I assume you have many input files, and you want to create a sorted version of each of them. I would do this using something like Now, this has the small problem that if you run it again, if will not only

Advertisement