5 Bash Commands That Sometimes Even Hackers Confuse With (But You Don't Have To!)
5. !! vs. !n vs. !$
1. find
vs. locate
Both commands are used to search for a file on your computer.
find
performs real-time searches for files and directories in a specified directory and its subdirectories.
locate
is used to perform a search as well but it is extremely fast because it relies on a pre-built database or index of file names on your system. This index is typically updated periodically by a system cron job.
Since locate
relies on this index, it may not find recently created files until the index is updated.
Worry not, as you can manually update the index using the updatedb
command and then use locate
to perform the search.
Keep reading with a 7-day free trial
Subscribe to Into AI to keep reading this post and get 7 days of free access to the full post archives.