[GUFSC] dicas Bash

Ricardo Grützmacher grutz em terra.com.br
Segunda Fevereiro 17 18:49:45 BRT 2003


Apesar de eu usar o zsh que é mais inteligente que o bash lá vão algumas 
dicas úteis de bash:
(Algumas são comuns a todos os shells e às vezes não se restringem 
apenas aos shells)

Bash Key Combinations

Alt+B   // Go back one word
Alt+F   // Go forth one word
Ctrl+K  // Delete everything from the cursor to the end of the line
Ctrl+U  // Delete everything from the cursor to the beginning of the line
Ctrl+Y  // Paste deleted characters at the current position
Ctrl+H  // Delete one character
Ctrl+L  // Clean screen
Ctrl+P  // Go to the previous history entry
Ctrl+N  // Go to the next history entry

Also you can use !word to re-execute the last command beginning with "word".

Using !word

$ gcc -o test test.c
$ !gcc
gcc -o test test.c
$

Ever get tired of typing long directory names? Try using the directory 
stack with the commands pushd, popd, and dirs. THe directory stack 
allows you to keep a list of directories and navigate between them.

The directory stack

// pushd adds a directory
~:$ pushd /usr/portage
// dirs lists all directories on the stack
~:$ dirs
/usr/portage ~
// And popd removes the top entry and cd's to that directory
~:$ popd
/usr/portage:$



Mais detalhes sobre a lista de discussão GUFSC