Index

linux terminals

Set terminal title from the command-line in VTE enabled terminal (xterm, sakura, gnome-terminal, etc.)
echo -ne "\033]0;SOME TITLE HERE\007"
script for updating title
#!/bin/sh
printf '\033]0;%s\007' "$*"

gnome-terminal

start gnome with title
gnome-terminal --title="SOME TITLE HERE"
start gnome without menubar
gnome-terminal --hide-menubar
start sized terminal ([cols]x[lines]+[x]+[y])
gnome-terminal --geometry 100x40+20+200
start terminal with active profile
gnome-terminal --window-with-profile=logs
list all profiles
gconftool-2 --all-dirs /apps/gnome-terminal/profiles
get default profile from terminal
gconftool-2 --get /apps/gnome-terminal/global/default_profile
execute command in terminal (-e takes command as argument)
gnome-terminal -e 'ssh nospam@eriklievaart.com'
execute command in terminal (-x takes rest of line)
gnome-terminal -x ssh nospam@eriklievaart.com
execute command in terminal, but keep terminal open after command exits
gnome-terminal -x sh -c 'echo foo; echo bar; bash'
gnome-terminal -e 'bash -c "echo foo; echo bar; bash"'
script to execute in terminal, that keeps terminal open after script exits
#!/bin/sh
echo foo
echo bar
exec bash
then run
gnome-terminal -e "/pth/to/scriptmentionedabove"
discussion on keeping gnome-terminal open
https://stackoverflow.com/questions/3512055/avoid-gnome-terminal-close-after-script-execution
start gnome-terminal with 2 tabs
gnome-terminal --tab --title a --tab --title b
start gnome-terminal with 2 tabs and execute commands in them
gnome-terminal --tab --title a -e 'sh -c "echo hello a; bash"' \
               --tab --title b -e 'sh -c "echo hello b; bash"'