質問

What command can I use to find the following info when a dir is provided as argument ?

  1. Size of files in (human readable format)
  2. Date an time stamp of files (human readable format)
  3. File-name without path
  4. Mime of file (Text File,Image File etc)
  5. Possible use of maxdepth option in find

I tired this one

find /home/dojo50  -name "*" -exec file {} \;

But it lacks file size and datetime info. Is it possible to combine File with ls in find .

something like but doesnot work

find /home -name "*" -maxdepth 1  -exec ls -lh {} \; -exec file {} \;
役に立ちましたか?

解決

for mime-type use file command in -exec option and for other item use -printf options. like:

find * -printf "%kK %AD %AT %p " -exec file -b {} \;

see man find for more information.

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top