I have setup the docker container to run the model evaluation.
In bash how do I list all files in foo/ but sort the files by the least significant digit of their size so 2820 comes first and then 281771 and finally 2279. I want just the file names e.g., file1 otherfile lastfile.
In bash how do I list all files in foo/ but sort the files by the least significant digit of their size so 2820 comes first and then 281771 and finally 2279. I want just the file names e.g., file1 otherfile lastfile.
find foo/ -type f -printf '%s %p\n' | sort -nk1 | cut -d' ' -f2-
I extracted the following code from that output:
1 2 3 | #!/bin/bash find foo/ -type f -printf '%s %p\n' | sort -nk1 | cut -d' ' -f2- |
Running the following program:
1 2 3 | #!/bin/bash find foo/ -type f -printf '%s %p\n' | sort -nk1 | cut -d' ' -f2- |
foo/8
foo/2
foo/9
foo/6
foo/4
foo/7
foo/3
foo/5
foo/1
foo/0
Resulting in output: foo/8 foo/2 foo/9 foo/6 foo/4 foo/7 foo/3 foo/5 foo/1 foo/0
Testing if the previous output equals the string 2 0 5 7 1 6 4 3 9 8
: False
I have setup the docker container to run the model evaluation.
In bash how do I list all files in foo/ but sort the files by the least significant digit of their size so 2820 comes first and then 281771 and finally 2279. I want just the file names e.g., file1 otherfile lastfile.
In bash how do I list all files in foo/ but sort the files by the least significant digit of their size so 2820 comes first and then 281771 and finally 2279. I want just the file names e.g., file1 otherfile lastfile.
find foo/ -type f -printf "%s %f\n" | sort -n -k1,1 | cut -d' ' -f2 This command should accomplish the task.
I extracted the following code from that output:
1 2 3 | #!/bin/bash find foo/ -type f -printf "%s %f\n" | sort -n -k1,1 | cut -d' ' -f2 |
Running the following program:
1 2 3 | #!/bin/bash find foo/ -type f -printf "%s %f\n" | sort -n -k1,1 | cut -d' ' -f2 |
8
2
9
6
4
7
3
5
1
0
Resulting in output: 8 2 9 6 4 7 3 5 1 0
Testing if the previous output equals the string 2 0 5 7 1 6 4 3 9 8
: False
I have setup the docker container to run the model evaluation.
In bash how do I list all files in foo/ but sort the files by the least significant digit of their size so 2820 comes first and then 281771 and finally 2279. I want just the file names e.g., file1 otherfile lastfile.
In bash how do I list all files in foo/ but sort the files by the least significant digit of their size so 2820 comes first and then 281771 and finally 2279. I want just the file names e.g., file1 otherfile lastfile.
find foo/ -print0 | xargs -0 ls -S | sort -V -t - | cut -d/ -f2-
I extracted the following code from that output:
1 2 3 | #!/bin/bash find foo/ -print0 | xargs -0 ls -S | sort -V -t - | cut -d/ -f2- |
Running the following program:
1 2 3 | #!/bin/bash find foo/ -print0 | xargs -0 ls -S | sort -V -t - | cut -d/ -f2- |
0
1
2
3
4
5
6
7
8
9
0
1
2
3
4
5
6
7
8
9
:
Resulting in output: 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 :
Testing if the previous output equals the string 2 0 5 7 1 6 4 3 9 8
: False
I have setup the docker container to run the model evaluation.
In bash how do I list all files in foo/ but sort the files by the least significant digit of their size so 2820 comes first and then 281771 and finally 2279. I want just the file names e.g., file1 otherfile lastfile.
In bash how do I list all files in foo/ but sort the files by the least significant digit of their size so 2820 comes first and then 281771 and finally 2279. I want just the file names e.g., file1 otherfile lastfile.
find foo -type f -printf '%s\n' | sort -n -t '' -k 1 -l
I extracted the following code from that output:
1 2 3 | #!/bin/bash find foo -type f -printf '%s\n' | sort -n -t '' -k 1 -l |
Running the following program:
1 2 3 | #!/bin/bash find foo -type f -printf '%s\n' | sort -n -t '' -k 1 -l |
sort: empty tab
Resulting in output: sort: empty tab
Testing if the previous output equals the string 2 0 5 7 1 6 4 3 9 8
: False
I have setup the docker container to run the model evaluation.
In bash how do I list all files in foo/ but sort the files by the least significant digit of their size so 2820 comes first and then 281771 and finally 2279. I want just the file names e.g., file1 otherfile lastfile.
In bash how do I list all files in foo/ but sort the files by the least significant digit of their size so 2820 comes first and then 281771 and finally 2279. I want just the file names e.g., file1 otherfile lastfile.
ls -l foo/ | sort -n -k5,5 | awk '{print $9}'
I extracted the following code from that output:
1 2 3 | #!/bin/bash ls -l foo/ | sort -n -k5,5 | awk '{print $9}' |
Running the following program:
1 2 3 | #!/bin/bash ls -l foo/ | sort -n -k5,5 | awk '{print $9}' |
8
2
9
6
4
7
3
5
1
0
Resulting in output: 8 2 9 6 4 7 3 5 1 0
Testing if the previous output equals the string 2 0 5 7 1 6 4 3 9 8
: False