9

What are the keyboard shortcuts to manipulate tabs (open new tab, navigate between tabs ...) in the command line of ubuntu server 12.04?

Jorge Castro
  • 70,934
  • 124
  • 466
  • 653
Nafaa Boutefer
  • 195
  • 1
  • 1
  • 6

2 Answers2

23

For doing command line work in general I would recommend using screen, tmux or other of these sort, but to get started, try out byobu:

enter image description here

Default key bindings:

  • F2 create a tab
  • F3 & F4 you can move around back and forth
  • F6 detach session. Resume later - very powerful!
  • F7 copy mode - allows you to scroll using arrow keys and search for keywords
  • F8 rename window
  • F9 Menu & help (more key bindings and features here!)
  • type exit, Ctrl+D to exit regularly one shell/window.

Byobu works regardless the type of connection to your server. This works in regular terminals (also desktops), Virtual Terminals, serial TTYs, SSH sessions, etc.

gertvdijk
  • 67,007
  • 33
  • 188
  • 283
  • And for those SSHing to a Linux terminal using Byobu on a Mac, you may need to hit `Fn` + the keybindings presented by @gertvdijik. Took me a while to figure this out... – bafromca Jan 28 '15 at 20:50
  • @bafromca Well, that's how function keys on your hardware works. I'm assuming in my answer the user is fimiliar on how to send a function keys on your keyboard. If not, then that's a totally different question imo. (If my keyboard would require me to use Fn + F1 key to send F1, I would throw it out of the window, really). – gertvdijk Jan 29 '15 at 10:08
  • The `F` keys are very rarely used on Macs, so for F-centric OSes like Linux, it's helpful for Mac users to know they are require to hit the `Fn` key to activate `F2`. It wasn't that your answer was incorrect, it was an addition for Mac users SSHing in to a Linux machine using Byobu. – bafromca Jan 29 '15 at 20:19
  • @bafromca Really? I mean, I use it all the time in Ubuntu. Or do you mean those keys are rarely used on OS X? – gertvdijk Jan 29 '15 at 20:21
  • F-keys are rarely used on OS X. Sorry, I was just adding my 2 cents as a Mac dev who SSHes into Ubuntu servers often. – bafromca Feb 01 '15 at 01:30
2

You will need GNU-Screen (sudo apt-get install screen) or you install byobu (a wrapper, that brings GNU-Screen too). From now on you have the possibility to have multiple "windows" in one virtual terminal.
CtrlA c will create another "window"
CtrlA n will switch to the next one
Of course byobu makes it more comfortable :-)

guntbert
  • 12,914
  • 37
  • 45
  • 86
  • "byobu (a wrapper, that brings GNU-Screen too)" Actually, it seems that Ubuntu 12.04 ships with Byobu using `tmux` instead. On Debian Squeeze it's still using Screen. Byobu is versatile and can be configured to use either of the two. – gertvdijk Jan 06 '13 at 22:33