Leon Chaewon Kong's dev blog

Linux - Linux Command for finding files

Working with Linux commands is not easy for front-end developers. For me, it always been pain in the ass, since I haven’t learned Linux before.

But sometimes, you really need to know some commands, for they will significantly reduce your time and effort.

Today, We will gonna find some files through our terminal using Linux commands.

Find

find / -iname "FILENAME"

In order to ignore case use “-iname”, for case-sensitive search, use ‘-name’ instead.

grep

sudo grep -r -i 'FILENAME' /

-r: find recursively.

-i: not case-sensitive.

/: within the directory given.

locate

First, you need to install locate functionality.

Ubuntu

sudo apt-get install mlocate

Update locate database.

sudo updatedb

Find your file.

locate -i "FILENAME"