April 2015 |
|
June 2015 |
grep -v "unwanted_word" file | grep XXXXXXXX
grep XXXXXXXX -r --include="*.{cpp,h}" rootdir
The syntax for --exclude is identical.
grep -B 3 -A 2 XXXXXXXX README.txt
To show the same amount of lines before and after the match, use -C num:
grep -C 3 XXXXXXXX README.txt
grep -c "Error" logfile.txt
grep -n "Error" logfile.txt
grep "import" test.py | sed '/$/ a\Line to be added'
grep -nrsI "query"
git reset
git checkout .
I can also revert uncommitted changes only to particular file or directory:
git checkout [some_dir|file.txt]
This will remove all local untracked files, so only git tracked files remain:
git clean -fdx
git commit -m "my changes"
git pull --rebase
git push
sudo kextunload -b com.apple.iokit.BroadcomBluetoothHostControllerUSBTransport
sudo kextload -b com.apple.iokit.BroadcomBluetoothHostControllerUSBTransport