shell - How can I recursively print a list of files with filenames shorter than 25 characters using a one-liner? -
i need 1 line command below requirement.
search files root directory , print files names file name length less 25.
i suppose can find command below:
find / -type f |xargs basename ....
not sure furthur command.
my gnu find supports this, unsure whether it's part of standard find.
find / -type f -regextype posix-extended -regex '.*/.{1,24}$'
alternatively, use find | grep.
find / -type f | egrep '.*/.{1,24}$'
Comments
Post a Comment