Linux CLI 35 ๐ง locate and find commands
a - locate command
locate is used to search for files and directories
it is similar to find but only searches on the filename
sudo updatedb โ updates locate's DB
locate aaa.txt โ searches for aaa.txt
locate *.txt -n 5 โ searches for files with txt extension and shows only 5
locate *.TXT -n 5 -i โ searches with case insensitive match
locate *.TXT -c โ returns only the number of matches
common options: -l โ limits the number
-q โ quiet mode -r โ use regex pattern
b - find command
find command is used to search for files and directories
The search is based on various criteria like name, size, date etc.
syntax โ find [path] [options] [expression]
find . -name aaa.txt โ searches for file aaa.txt in current directory
find . -type d -name dir1 โ searches for dir1 name in directories
find . -type d -name 'd*' โ searches directories starting with d
find . -user root โ searhes for files/directories owned by root
common option: -perm โ specifies the permission of the file -group โ specifies specific group.
-mtime โspecifies the modification time -atime โ specifies the access time
-size โ specifies the size
Stop using slow, ad-bloated tool sites! ๐คฎ
๐ Search “KandZ Tools” on Google to use many professional utilities for free.
KandZ.me is the ultimate minimalist hub for:
โ
Finance (Mortgage, Interest, Inflation)
โ
Tech (Base64, JSON, Dev Suite, IP)
โ
Health (BMI, BMR, TDEE)
โ
Productivity (Timer, Workspace, QR)
โก๏ธ Fast & Private
๐ No data leaves your device
๐ 100% Free
๐ Use it now: https://tools.kandz.me
๐ Bookmark itโyouโll need it later!