Find: Difference between revisions

From Anthony Pastor Wiki Notes - Verba volant, scripta manent
Jump to navigation Jump to search
(Created page with "find /var/lib/kafka/Views* -mindepth 1 -newermt "feb 02 2016" -print0 | xargs -r0 stat -c %y\ %n | sort | tail -40")
 
No edit summary
 
(3 intermediate revisions by the same user not shown)
Line 1: Line 1:
=Find 40 files newer than a specific date and list them sorted by modification time=
<syntaxhighlight lang="bash">
find /var/lib/kafka/Views* -mindepth 1 -newermt "feb 02 2016" -print0 | xargs -r0 stat -c %y\ %n | sort | tail -40
find /var/lib/kafka/Views* -mindepth 1 -newermt "feb 02 2016" -print0 | xargs -r0 stat -c %y\ %n | sort | tail -40
</syntaxhighlight>
=Find filenames greater than 10 characters=
<syntaxhighlight lang="bash">
find /tmp/ -regextype posix-egrep -regex '.{10,}'
</syntaxhighlight>
=Find files and tar them=
<syntaxhighlight lang="bash">
find / -name "*.css" -print0 | tar -cvzf wiki_css.tar.gz --null -T -
</syntaxhighlight>

Latest revision as of 14:58, 17 March 2016

Find 40 files newer than a specific date and list them sorted by modification time

find /var/lib/kafka/Views* -mindepth 1 -newermt "feb 02 2016" -print0 | xargs -r0 stat -c %y\ %n | sort | tail -40

Find filenames greater than 10 characters

find /tmp/ -regextype posix-egrep -regex '.{10,}'

Find files and tar them

find / -name "*.css" -print0 | tar -cvzf wiki_css.tar.gz --null -T -