I want to retrieve the list of files from a directory & including its sub-directories too, Whose file name contains "message-" or "secure". I have tried with below commands , But they could not read files from its sub-directories.
find /u01 -maxdepth 1 -name "*message-*"
find . -name "*message-*"
find /u01 -type f -printf '%s %p\n' | sort -nr | head -20 | find -maxdepth 1 -name "*message-*" -a -name "*secure*"
Can you please help on this...
Below commands worked for me.
find /u01 -type f \( -name "*message*" -o -name "*secure*" \) -type f -printf '%s %p\n'
To get top 20 largest file whose name contains those both string.
find /u01 -type f \( -name "*message*" -o -name "*secure*" \) -type f -printf '%s %p\n' | sort -nr | head -20
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments