| maqiv's blog | some stuff going on.

discovered tmux (alternative to session)

tmux is an awesome tool for having multiple commandline-sessions in one window. you can decide if you wanna have multiple windows (tmux sessions) open (which can contain multiple panes, which is kinda like spilt-screen in one session window) but have them running in the background while you're working in another tmux-window, and call them as your needs require them.

in tmux you work with sessions. it gives you the ability to detach and reattach sessions. for example if you're working on something in a session and you're going for a whiskey at Sichtwerk (yes tobi, there're still some to come ;) ), you can detach the current session as it is, and come back later, reattach it and continue working. i prefer using it for example to copy a huge amount of files on my fileserver over night. so i'll start the copy-process from my workstation in a tmux session, detach it, turn off the workstation, and reattach the tmux session the next day to check the (hopefully successful) copy-process, so i don't have to leave the workstation running all night long.

tmux comes with a little command mode, that is quite mighty to use. the command mode allows you to operate on tmux itself and control it as you need it. to tell tmux that the following character is dedicated to set/control a parameter in tmux, you have to press CTRL-b before every command.

 

Basics

to start using it, the following commands are basic to get into it:

tmux new -s #session-name#

first of all we're starting a tmux session. this can be done by typing tmux new -s #session-name#. replace #session-name# with a name of your choice for the session. this is used to recall the session if you have detached it and keep it in the background. for example if you're copying file in this session you could name it 'copy0' (this would be tmux new -s copy0).

 

the following commands are executed in tmux itself:

CTRL-b ? (in tmux)

the next one gives you the command overview. you'll get it with '?' (press CTRL-b ?). here you get a list with all commands available in tmux.

CTRL-b d

with CTRL-b d you can detach from the current session and place it in the background.

CTRL-b s (in tmux) or tmux ls (in the linux shell)

to get a list of the tmux sessions you're currently holding in the background you can use CTRL-b s in tmux itself or from the linux shell it's tmux ls.

tmux a or tmux a -t #session-name#

if you want to come back to a running session from the background, you can do so by using tmux a or tmux a -t #session-name#. the shorthand command tmux a connects you to the last session you have detached.

tmux kill-session -t #session-name#

to kill a session (for example if it froze), then you have to do this with tmux kill-session -t #session-name# from the linux shell.

 

those are some tmux basics to start using it. i'll post some other little overviews about windows and panels in tmux in the near future, so stay tuned....also, leave a command if you have questions or suggestions.

thanks for reading! :)

welcome.

hello you and welcome to my new small random blog

this is just a tiny blog about my little exciting life. i'll post random stuff, sometimes with pictures, from time to time. it's always worth a stop by.

i hope you'll have fun reading and i'm always excited about comments and little discussions about this and that....

i'll post things about music, drumming, it, programming, etc. just random.

 

stay clean and enjoy :)

Home