Skip to content

What's the best way to ripgrep your entire filesystem? #2158

Answered by BurntSushi
wpcarro asked this question in General
Discussion options

You must be logged in to vote

You can use --no-messages.

But, it's generally not a great idea to just run a process that touches literally every file. Some files, for example, are virtual and are quite large. Try running, e.g., wc -c /proc/1/pagemap or something. (Well, maybe don't, because it might take quite a long time.)

What I do personally is just create a /.ignore file and ignore the directories that I know are likely uninteresting (or even counter productive):

$ cat /.ignore
/dev
/m
/media
/mnt
/proc
/root
/run
/sys

Then you can do things like rg foo /. Now, you're still quite likely to get errors, as there are probably lots of files in /var or even /etc that require root permissions to even read. That's where -…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@wpcarro
Comment options

Answer selected by wpcarro
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants