18.01.2020 Views

Working with Linux

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

As we can see, electron has a few empty files. Find will also show us empty directories, or links.

Removing empty files will keep our project clean, but when it comes to reducing size, we sometimes

want to know which files are taking up most of the space. Find can also do searches based on file

size. For example, let's find all the files larger than 1 mega:

find . -size +1M

use -1M for smaller.

As we said in the beginning, find can do much more than locating files in your project. Using the -

exec argument, it can be combined with almost any other command, which gives it almost infinite

capabilities. For example, if we want to find all javascript files that contain the text manager, we

can combine find with grep, command as follows:

find . -name "*.js" -exec grep -li 'manager' {} \;

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!