Coloque o seguinte alias no seu ~/.bashrc ou ~/.bash_profile (ou onde quer que você aloca essas coisas):
alias copyLastCmd='fc -ln -1 | awk '{$1=$1}1' | pbcopy '
=]Fonte
alias copyLastCmd='fc -ln -1 | awk '{$1=$1}1' | pbcopy '
=]git diff <commit_inicial> <commit_final> > arquivo_do_patch
Caso você apenas queira aplicar baseado no diff referente ao último commit, faça: (digamos que o hash desse commit seja 5fbd9)Caso queira aplicar o patch em algum lugar:git diff5fbd9 > arquivo_do_patch
git apply arquivo_do_patch
Fácil, né!?
:set paste
Isso habilitará o modo paste. Cole. Pra desabilitar o modo paste, faça: :set nopaste
if [ -f ~/.git-completion.bash ]; then
. ~/.git-completion.bash
fi
find ./ -type f -newermt 2015-01-01 ! -newermt 2015-08-01 -delete
$ find ~/ -type f -name "error.log"
$ find ~/ -type d -name NOME_PASTA
$ find ./ -type d | grep NOME_PASTA

vi +comando NomeArquivoou
vi +numerodalinha NomeArquivoou
vi +/TermoQueVoceProcura NomeArquivo
$ vim +15907 dump.sql
$ vim +/xablau views.py
$ grep "alguma coisa" -Rn ./ | grep -v essa_pasta_nao
$ ping google.com 80
usage: ping [-AaDdfnoQqRrv] [-b boundif] [-c count] [-G sweepmaxsize]
[-g sweepminsize] [-h sweepincrsize] [-i wait] [−k trafficclass]
[-l preload] [-M mask | time] [-m ttl] [-p pattern]
[-S src_addr] [-s packetsize] [-t timeout][-W waittime] [-z tos]
host
$ telnet google.com 80
Trying 74.125.226.48...
Connected to google.com.
Escape character is '^]'.
$ export VISUAL=vim
$ export EDITOR=vim
$ crontab -e
no crontab for jonatascd - using an empty one
Select an editor. To change later, run 'select-editor'.
1. /bin/ed
2. /bin/nano <---- easiest
3. /usr/bin/vim/tiny
Choose 1-3 [2]:
$ grep 'ajax' --exclude=*.js -Rn ./
$ grep 'ajax' --include=*.py -Rn ./