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 -printf '%s %f\n' | sort -nk1 | cut -d' ' -f2- This command should accomplish the task.
I extracted the following code from that output:
1 2 3 | #!/bin/bash find foo -printf '%s %f\n' | sort -nk1 | cut -d' ' -f2- |
Running the following program:
1 2 3 | #!/bin/bash find foo -printf '%s %f\n' | sort -nk1 | cut -d' ' -f2- |
8
2
9
6
4
7
3
5
1
0
foo
Resulting in output: 8 2 9 6 4 7 3 5 1 0 foo
Testing if the previous output matches the regex 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/ -printf '%s %f\n' | sort -n | cut -d' ' -f2 This command should accomplish the task.
I extracted the following code from that output:
1 2 3 | #!/bin/bash find foo/ -printf '%s %f\n' | sort -n | cut -d' ' -f2 |
Running the following program:
1 2 3 | #!/bin/bash find foo/ -printf '%s %f\n' | sort -n | cut -d' ' -f2 |
8
2
9
6
4
7
3
5
1
0
foo/
Resulting in output: 8 2 9 6 4 7 3 5 1 0 foo/
Testing if the previous output matches the regex 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/ | xargs ls -l | sort -nk7 | cut -d' ' -f9
I extracted the following code from that output:
1 2 3 | #!/bin/bash find foo/ | xargs ls -l | sort -nk7 | cut -d' ' -f9 |
Running the following program:
1 2 3 | #!/bin/bash find foo/ | xargs ls -l | sort -nk7 | cut -d' ' -f9 |
foo/:
23
01:29
01:29
01:29
01:29
01:29
01:29
01:29
01:29
01:29
01:29
2
9
6
4
7
3
5
1
0
Resulting in output: foo/: 23 01:29 01:29 01:29 01:29 01:29 01:29 01:29 01:29 01:29 01:29 2 9 6 4 7 3 5 1 0
Testing if the previous output matches the regex 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/ -printf '%s:%p\n' | sort -t: -nk1 | cut -d: -f2-
I extracted the following code from that output:
1 2 3 | #!/bin/bash find foo/ -printf '%s:%p\n' | sort -t: -nk1 | cut -d: -f2- |
Running the following program:
1 2 3 | #!/bin/bash find foo/ -printf '%s:%p\n' | sort -t: -nk1 | cut -d: -f2- |
foo/8
foo/2
foo/9
foo/6
foo/4
foo/7
foo/3
foo/5
foo/1
foo/0
foo/
Resulting in output: foo/8 foo/2 foo/9 foo/6 foo/4 foo/7 foo/3 foo/5 foo/1 foo/0 foo/
Testing if the previous output matches the regex 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 "%P %s\n" | sort -t ' ' -k 2 -n | cut -d' ' -f1
I extracted the following code from that output:
1 2 3 | #!/bin/bash find ./foo -type f -printf "%P %s\n" | sort -t ' ' -k 2 -n | cut -d' ' -f1 |
Running the following program:
1 2 3 | #!/bin/bash find ./foo -type f -printf "%P %s\n" | sort -t ' ' -k 2 -n | cut -d' ' -f1 |
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 matches the regex 2.*0.*5.*7.*1.*6.*4.*3.*9.*8: False