Rapha_ wrote: ↑14 Nov 2023, 01:59
^
I created a 'recent' alias in the .
bashrc file placed in '
/rootcopy/home/guest/' :
Code: Select all
alias recent="find . -not -path './.cache*' -type f -mmin -120 -printf '%Td-%Tm-%TY %.8TT %p\n' |sort |egrep -v mozilla "
And after, all I have just to do is to type
recent to get the latest files created (or modified) in /home/guest
it works great !
Not for me, since you not search in folder
~/ but in
folder . which is always the current directory aka what $PWD shows you, and guest as most users can move around in the file system as he pleases.
Example: (used as one-liner)
Code: Select all
guest@rava:/mnt/sda8/tmp$ find . -not -path './.cache*' -type f -mmin -120 -printf '%Td-%Tm-%TY %.8TT %p\n' |sort |egrep -v mozilla
guest@rava:/mnt/sda8/tmp$
No hits… since there is nothing changed in that time span in /mnt/sda8/tmp
Fixed the one-liner, exchanged path "." with "~/" … this gives me tons of entries from /home/guest/.cache/moonchild productions/pale moon/
Seems at least for me the
is not working?
My fix is this one-liner:
Code: Select all
find ~ -type f -mmin -120 -printf '%TY-%Tm-%Td %.8TT %p\n' |sort |egrep -v "[Cc]ache"
since I don't have a browser called mozilla.
But it could be you prefer the initial search folder be "." after all: then you can move into whatever folder you desire and it is up to you to move wherever you want to perform the test. A simple
gets you to your home folder, after all, and a simple
gets you back to the last folder you have been in prior the very last "cd".
When I want to exclude my palemoon and add exclusion for firefox and chrom[ei] based browsers I use this:
Code: Select all
find ~ -type f -mmin -120 -printf '%TY-%Tm-%Td %.8TT %p\n' |sort |egrep -v "[Cc]ache|mozilla|pale moon|basilisk|chrom[ei]"
For now not tested in a browser that uses a setup folder containing "mozilla" or "chrom[ei]" but it
should work. (Only tested for basilisk and pale moon)
Thanks for the pointers Rapha_ .
Added in 10 minutes 40 seconds:
And here is another variant: it uses a the very end a search pattern to be even more flexible:
Code: Select all
find ~ -type f -printf '%TY-%Tm-%Td %.8TT %p\n' |sort |egrep -v "[Cc]ache|mozilla|pale moon|basilisk|chrom[ei]"|grep "2023-11-14 05:0"
Cave! In this case you have to manually adjust the very last part to suit your needs, meaning put in the correct date and the correct time span, but you can use regex like so:
|grep "2023-11-14 05:0" -> no regex
|grep "2023-11-14 05:[01]" -> regex, meaning 05:0* and 05:1* times are displayed, but nothing like 05:2* 05:3* 05:4* or 05:5*.
And of course Rapha_'s alias and my one-liner can be adjusted. The "-mmin -120" means from the present up to 120 minutes into the past; you can change that into double the time span: "-mmin -240" or half the time span "-mmin -60" or whatever time span floats your boat.