Unix - List all files in all directories without displaying full path? -
is possible?
find /home/me/subdir -type f
the code above alright, dont want display full path , hidden files.
try this:
find /home/me/subdir -type f ! -name ".*" -exec basename {} \;
or find
may allow this:
find /home/me/subdir -type f ! -name ".*" -printf "%f\n"
added afterwards
to list largest files, first need find size, maybe this:
stat --printf "%n:%s\n" somefilename
where %n
size , %s
name.
then if want sizes of all files, need run find
:
find /home/me/subdir -type f -exec stat --printf "%n:%s\n" {} \;
then if want them sorted, , 10 biggest, need add sort
, head
:
find /home/me/subdir -type f -exec stat --printf "%n:%s\n" {} \; | sort -rn | head -n 10
Comments
Post a Comment