tmux is a terminal multiplexer. It lets you switch easily between several programs in one terminal, detach them (they keep running in the background) and reattach them to a different terminal.
after installation you can list your sessions by:
Output would be something like this:
You can attach a session by:
Now let's say you want to detach a session you need to press ^b+d (CONTROL+b and then press d).
If you want to split your window to multiple panes press ^b+" (split horizontally) and/or ^b+% (split vertically).
^b+n : next window
^b+(up/down/left/right) : to move between panes
^b+? : help and shortcuts
^b+x : kill a pane
THE GREAT THING about
I know you will get tired if I say more about tmux, so go and explore more yourself and see the real power of multiplexers.
#tmux #linux #sysadmin #terminal #multiplexer
after installation you can list your sessions by:
tmux ls
Output would be something like this:
0: 1 windows (created Mon Aug 7 10:34:00 2017) [135x52] (attached)
2: 1 windows (created Mon Aug 7 13:56:10 2017) [126x25]
(attached)
at the end of session 0 tells us that the session has been attached by a user.You can attach a session by:
tmux attach -t 0
-t
tells tmux which session should be attached.Now let's say you want to detach a session you need to press ^b+d (CONTROL+b and then press d).
If you want to split your window to multiple panes press ^b+" (split horizontally) and/or ^b+% (split vertically).
^b+n : next window
^b+(up/down/left/right) : to move between panes
^b+? : help and shortcuts
^b+x : kill a pane
THE GREAT THING about
tmux
is that multiple users can attach the same session and work simultaneously!I know you will get tired if I say more about tmux, so go and explore more yourself and see the real power of multiplexers.
#tmux #linux #sysadmin #terminal #multiplexer
In
Now lets say you want to get count of files which is listed by
Now you shoud the count of files listed by the first command. This method of using 2 commands is
#linux #sysadmin #ls #wc #command #bash #terminal
ls
you can list files by using regex pattern as below:ls data.subtitle_*
*
is gready and list all the files that start with data.subtitle_
.Now lets say you want to get count of files which is listed by
ls
command. For that you can use wc -l
as follow:ls data.subtitle_* | wc -l
Now you shoud the count of files listed by the first command. This method of using 2 commands is
piping commands
, which is in fact separated by |
(pipe)#linux #sysadmin #ls #wc #command #bash #terminal
If you have an script and you want to clear the terminal before executing your script you can use the below control characters:
The above command will clear the screen by using
#python #chr #terminal #clear_terminal
print(chr(27) + "[2J")
The above command will clear the screen by using
Python
#python #chr #terminal #clear_terminal
https://unix.stackexchange.com/questions/31414/how-can-i-pass-a-command-line-argument-into-a-shell-script
#shell #argument #pass_argument #command_line #terminal #linux #bash #script
#shell #argument #pass_argument #command_line #terminal #linux #bash #script
Unix & Linux Stack Exchange
How can I pass a command line argument into a shell script?
I know that shell scripts just run commands as if they were executed in at the command prompt. I'd like to be able to run shell scripts as if they were functions... That is, taking an input value or
Do you think
Its security is like shell, as it uses shell authentication mechanism for login. You need to open UDP ports 60000 to 61000. Or you can give
One of the caveats of mosh is that you cannot scroll to previous commands as its buffer is limited to the window you are viewing itself.
Install it using
For further instruction head over to link below:
#ssh #mosh #terminal
SSH
sucks? Do you think SSH
suck specially when you are from an unstable network like what we have in IRAN and when DPI (Deep Packet Inspection) is undergo? OK, I have mosh
for you. mosh
stands for Mobile Shell
. It reconnects itself and you never have to login again. Even if you change your internet connection you are safe and your shell is open :)Its security is like shell, as it uses shell authentication mechanism for login. You need to open UDP ports 60000 to 61000. Or you can give
-p
parameter to connect on a specific port:mosh -p 60010 admin@my_server.com
One of the caveats of mosh is that you cannot scroll to previous commands as its buffer is limited to the window you are viewing itself.
Install it using
apt-get install mosh
.For further instruction head over to link below:
https://mosh.org/
#ssh #mosh #terminal
https://stackoverflow.com/questions/22163102/you-have-mail-message-in-terminal-os-x
#osx #mac #mail #iterm #terminal
#osx #mac #mail #iterm #terminal
Stack Overflow
"You have mail" message in terminal, os X
Few days ago I got this message in my terminal window:
What does that mean? I've never seen that before.
That was messages from xCode bots.
Thanks for the help.
What does that mean? I've never seen that before.
That was messages from xCode bots.
Thanks for the help.