Tuesday, July 29, 2008

Some Basic Command(Shortcut) for terminal

Some of these are specific to the bash shell. I have not experimented enough with other shells to know which are common to all shells. See also the ``Bash Reference Card'', SSC (2000), available online.

  • / - root directory

  • ./ - current directory

  • ./command_name - run a command in the current directory when the current directory is not on the path

  • ../ - parent directory

  • ~ - home directory

  • $ - typical prompt when logged in as ordinary user

  • # - typical prompt when logged in as root or superuser

  • ! - repeat specified command

  • !! - repeat previous command

  • & - run a program in background mode

  • [Tab][Tab] - prints a list of all available commands. This is just an example of autocomplete with no restriction on the first letter.

  • x[Tab][Tab] - prints a list of all available completions for a command, where the beginning is ``x''

  • [Alt][Ctrl][F1] to [Alt][Ctrl][F7] - switch to the first virtual text console

  • [Alt][Ctrl][F7] - switch to the first GUI console, if there is one running. If the graphical console freezes, one can switch to a nongraphical console, kill the process that is giving problems, and switch back to the graphical console using this shortcut.

  • [ArrowUp] - scroll through the command history (in bash)

  • [Ctrl][Alt][+] - switch to next X server resolution (if the server is set up for more than one resolution)

  • [Ctrl][Alt][-] - change to previous X server resolution

  • [Ctrl][Alt][BkSpc] - kill the current X server. Used when normal exit is not possible.

  • [Ctrl]c - kill the current process

  • [Ctrl]d - logout from the current terminal

  • [Ctrl]s - stop transfer to current terminal

  • [Ctrl]q - resume transfer to current terminal. This should be tried if the terminal stops responding.

  • [Ctrl]z - send current process to the background

  • reset - restore a terminal to its default settings

No comments: