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

Popular posts from this blog

windows - Single EXE to Install Python Standalone Executable for Easy Distribution -

c# - Access objects in UserControl from MainWindow in WPF -

javascript - How to name a jQuery function to make a browser's back button work? -