PentOpsVault @syztem4our666

PentOpsVault
Linux

Search and Find

Linux

Find a file by name

find / -iname "[query]"

Find a file by name (alternative)

fd [query]

Find all path names containing a phrase

locate [query]

Find the path of an executable

which [command]

Find location of binary/source/man files for a command

whereis [command]

Search for pattern in output of command

history | grep [phrase]

Find files whose content was modified less than 60 minutes ago

find / -mmin -60

Find files whose status was changed less than 60 minutes ago

find / -cmin -60

Find all files which were accessed 7 days back

find / -atime 7

Search for pattern in file

grep [query] [file]

Find all files which are greater than 10MB and less than 100MB

find / -size +10M -size -100M

Find files by extension

fd -e [extension]

Find files by extension (alternative)

find . -type f -name "*.[extension]"

Find files by extension (another alternative)

locate "*.[extension]"

On this page

Edit on GitHub