Linked Questions
13 questions linked to/from List files sorted numerically
2
votes
2
answers
1k
views
Sorting ls output where files end in numbers [duplicate]
Here is the output of my normal ls command:
f1 f10 f11 f12 f13 f14 f15 f16 f17 f18 f19 f2 f20 f3 f4 f5 f6 f7 f8 f9
So I have 20 files. I need them displayed as :
f1 f2 f3 f4 f5 ...
0
votes
1
answer
6k
views
How to create a list file of some files? [duplicate]
i have a bunch of files from log1 to log164,
how can i create a file like below ordering...
please help me...
log1.gz
log10.gz
log100.gz
log101.gz
log102.gz
log103.gz
log104.gz
log105.gz
log106.gz
......
-1
votes
2
answers
1k
views
sorting numerically in unix [duplicate]
I have question about sorting files,and my question is different from other questions about sorting
I have a folder including hundereds of files looks like this
anacovaux_1052_summary_betai.out
...
1
vote
3
answers
1k
views
Numerically sorting files [duplicate]
Possible Duplicate:
List files sorted numerically
How can I sort this according to the number of last field? I tried with sort -t ' ' -k9,10n:
-rw-r--r-- 1 root root 440 May 14 08:52 test....
0
votes
1
answer
427
views
Why does mkdir dir{1..10} create dir10 before dir2? [duplicate]
[xxx]$ mkdir dir{1..10}
[xxx]$ ls
dir1 dir10 dir2 dir3 dir4 dir5 dir6 dir7 dir8 dir9
When I make 10 directories like this, why does dir10 appear right after dir1? Shouldn't it be the last ...
44
votes
5
answers
15k
views
Glob with Numerical Order
I have this list of pdf files in a directory:
c0.pdf c12.pdf c15.pdf c18.pdf c20.pdf c4.pdf c7.pdf
c10.pdf c13.pdf c16.pdf c19.pdf c2.pdf c5.pdf c8.pdf
c11.pdf c14.pdf c17.pdf c1.pdf ...
7
votes
2
answers
2k
views
How to sort lines that contain "_" numerically?
Here's a subset of the file names in my file:
profile_10_1_1
profile_10_1_2
profile_1_1_1
I'm trying to sort them numerically in ascending order, that is starting from 1 onwards. I used the following ...
1
vote
2
answers
2k
views
How can I sort filename in correct numerical order
How can I fix problems with Filename order?
For example,
ls
yields files as follows:
basename1
basename11
basename12
basename13
[omitted]
basename2
basename20
basename21
....
basename3
PROBLEM
11-...
2
votes
1
answer
4k
views
splitting a file to smaller files with numeric suffix
I have a file with 20000 lines and I want to split it into smaller files with a numeric suffix, each with 2 lines. So, very simply I am using
split -l 2 -d my_file my_file_new
The output files with ...
2
votes
4
answers
771
views
problem with quoting ls output
I want to join some png files into a pdf. The command
convert *png out.pdf
works, but gets the ordering wrong. It turns out that
ls -v *png
gives the ordering that I want, therefore I want to pass ...
2
votes
2
answers
315
views
Remove files except latest one by numeric order
I am trying to remove files within a bash script.
I can list the latest file with:
ls | grep core | tail -n 1
and rename it like keep-core-2994-xyz.bin, then remove the rest with:
rm -f core-*
and ...
0
votes
2
answers
445
views
Bash ls not sorting correctly?
I have a collection of pdfs in a folder. If I do a simple ls it returns this:
'The Amazing Spider Man 2018 - Ch Issue - 10.pdf' 'The Amazing Spider Man 2018 - Ch Issue - 32.pdf' 'The ...
1
vote
1
answer
203
views
FreeBSD natural sort with ls and recurssion
In Ubuntu I can do a recursive search with a natural sort quite easily. A simple ls -1Rv will list file names only in a natural sort with all sub directories. An example output would be:
.:
test4
tmp2
...