Handy stuff
grep -B 2 -A 3 foo bar
Show 2 lines before and 3 lines after grepping for foo in bargrep --color=always foo bar | less -r
show foo in colors also when piping to lessgrep -E "(foo|bar)" *
find files containing foo or bar (Note: file will be displayed twice)
git diff -w
ignore whitespace when comparing line
- options
-r
show "raw" control characters (colors)
- commands
g
goto topG
goto bottom/foo
search for foon
next searchN
previous search
git grep foo | cut -d : -f 1 | uniq | while read i; do sed -r -i s,foo,bar,g $i; done
cut -d
delimiter (what char divides the search)cut -f
field (what field to get from -d search)uniq
filter out duplicatessed -r
extended regular expressionssed -i
edit files in place
- firefox scroll wheel speed: about:config
mousewheel.acceleration.factor: 40
mousewheel.acceleration.start: 0
browser.backspace_action: 0