Tuesday, May 7, 2024
9
rated 0 times [  9] [ 0]  / answers: 1 / hits: 3339  / 3 Years ago, tue, june 29, 2021, 8:23:42

I can easily find files with given string in name:



me@comp:/usr/local/hydra/hydra-7.4.2$ find -D stat -name "*hack*"
./hack881663129.txt
./hack881663129_7.txt
./hack881663129_5.txt
./hack881663129_4.txt
./hack881663129_4_7.txt
./hack881663129_6.txt
./hack881663129_1_6.txt
./hack881663129_8.txt


How can I also print file details, like size, date of creation etc.?


More From » command-line

 Answers
0

Just use -printf parameter with proper arguments:



$ find -name "*hack*" -printf '%m %p %a
'
644 ./hack881663129.txt Sat Feb 16 02:27:16.0189270840 2013
644 ./hack881663129_7.txt Sat Feb 16 05:30:12.0673185691 2013
644 ./hack881663129_5.txt Sat Feb 16 05:24:57.0441188136 2013
644 ./hack881663129_4.txt Sat Feb 16 05:22:21.0209189346 2013
664 ./hack881663129_4_7.txt Wed Feb 20 11:09:49.0786644191 2013
644 ./hack881663129_6.txt Sat Feb 16 05:26:49.0297187267 2013
664 ./hack881663129_1_6.txt Mon Feb 18 11:40:05.0991189262 2013
644 ./hack881663129_8.txt Sat Feb 16 05:31:37.0689185031 2013


See man find and search for -printf for other placeholders.


[#32273] Wednesday, June 30, 2021, 3 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
dersol

Total Points: 78
Total Questions: 100
Total Answers: 124

Location: Christmas Island
Member since Mon, Oct 19, 2020
4 Years ago
;