search but skip some files
grep through a project without its build folders, minified files or logs.
textsearch
steps
-
grep -rn --exclude-dir={.git,node_modules,dist} 'text' .skip those folders
-
grep -rn --include='*.js' --include='*.ts' 'text' .only those kinds of files
-
grep -rn --exclude='*.min.js' 'text' .skip files by name
-
rg 'text' -g '!*.min.js'ripgrep: skips .gitignore's files already; -g adds more
commands used
greprg
Each has a page in lore: lore grep opens it.
find files containing a text
Search every file under a folder for a word or a phrase, and show where it is.
add up numbers in a file
Sum a column of numbers, from a file or a command's output.
compare two folders
Find which files differ between two folders, or are only in one of them.
count lines of code
How many lines of code a project has, in total and by language.