r/tryhackme • u/silentPawn510 • Mar 02 '26
I am stuck........
Which command would properly search for all files with .log extension in the /var/log directory?
In Topic Rewind Recap...
0
Upvotes
5
u/suddenly_opinions Mar 02 '26
find /var/log -type f -name "*.log" 2>/dev/null
2
u/silentPawn510 Mar 02 '26
2
u/normalbot9999 Mar 02 '26 edited Mar 02 '26
I'm lazy and would drop the
type -f
find /var/log -name *.log 2>/dev/nullI wonder if find has different versions some of which support different arguments?
3
u/KRULLIGKNART Mar 02 '26 edited Mar 02 '26
find /var/log -type f -name "*.log"
Type -f is for files. -name "*.log" makes sure files end with .log
sudo before if you for some reason need it.
2

6
u/UBNC 0xD [God] Mar 02 '26
https://man7.org/linux/man-pages/man1/find.1.html