126 votes
Accepted

How to change default new window directory from within the tmux

tl;dr Ctrl+b : attach -c desired/directory/path Long Answer Start tmux as follows: (cd /aaa/bbb; tmux) Now, any new windows (or panes) you create will start in directory /aaa/bbb, regardless of ...
Lqueryvg's user avatar
  • 1,979
57 votes

Scroll inside Screen, or Pause Output

All these answers addressed how to navigate within a screen session, but there is a built-in functionality in screen command to store everything in a file through the -L argument according to the ...
Mehrad Mahmoudian's user avatar
37 votes

search text on the terminal output

If you use Konsole (KDE terminal emulator), you can use Ctrl + Shift + F. This might work also in other (Linux) terminal emulators; it has been confirmed to work in GNOME Terminal, the Xfce terminal, ...
Augustin's user avatar
  • 483
32 votes
Accepted

How to scale the resolution/display of the desktop and/or applications?

Linux display This is detailed in depth on how does Linux's display works? QA. On most desktops system (like KDE or Gnome) there are settings available on their respective settings panel, this guide ...
intika's user avatar
  • 14.4k
31 votes

.ssh/config way to specify pseudo-tty allocation and command execution

To allocate the tty as you would with the -t option, put RequestTTY force as an entry in the ssh config file (usually in ~/.ssh/config). To always execute a command on the server after you've ...
Brian Albert Monroe's user avatar
28 votes
Accepted

How to scroll inside a screen session of an ssh connection?

By default Screen will keep a scrollback buffer, but you can't use it the same way as the "conventional" scrollback buffer maintained by your terminal emulator. I.e. you can't use your mouse to scroll ...
HBruijn's user avatar
  • 7,428
27 votes

How to get Kali Linux to not go to sleep?

With the gui, you do this by changing three settings. To access the settings, click any top right icon (a panel opens), then click the "settings" icon at the bottom left of the opened panel. Once the ...
ling's user avatar
  • 411
24 votes

Screen, or similar, for automatically resuming a flaky ssh connection

You could look at using mosh: https://mosh.org/ You could set up a 'jump' server with a reliable internet connection which you use mosh to connect to, then have ssh sessions to each server you manage....
rusty shackleford's user avatar
23 votes
Accepted

Prevent Logoff from Killing tmux Session

This "feature" has existed in systemd previously, but the systemd developers decided to effect a change in the default, to enable the setting for termination of child processes upon log out of a ...
palswim's user avatar
  • 5,187
22 votes

Setting a name for a screen session

To start: screen -S mysession To resume: screen -r mysession Credit
ᴍᴇʜᴏᴠ's user avatar
22 votes

How to control systemd service using screen?

I suspect you've stumbled on this blog post which uses screen to solve a problem where your minecraft server stops when you $ java -jar spigot.jar, then close your ssh or putty session. That method ...
Stewart's user avatar
  • 13.7k
21 votes
Accepted

How does `screen` actually work?

Very briefly (it's possible to write several pages on the topic): screen works by setting up a server process that takes over all input/output directly to your terminal, starting client processes for ...
Thomas Dickey's user avatar
18 votes

Increase buffer size while running screen

I actually figured this out after looking through the man page. Setting the screen buffer inside .screenrc does work, but you can change it inside your screen session. Ctrl-a + : and typing ...
ProdIssue's user avatar
  • 875
18 votes
Accepted

run two commands in screen detached

It works if I specify bash -c screen -dm bash -c 'command1; command2;' User meuh provided this solution in comments, thanks.
adrianTNT's user avatar
  • 573
17 votes

How can I save the output of a detached screen with script?

You can use the -L flag to create an automatic screenlog.0 file eg $ screen -dm -L sh -c 'echo hello' $ cat screenlog.0 hello If you have a long running screen session that isn't being logged then ...
Stephen Harris's user avatar
16 votes

Can mouse wheel scrolling work in a Screen session?

Although it is an old question, the method I found best that works for me is using Ctrl + A + ESC key combination. This makes the screen output scrollable. From the documentation page: Virtual ...
xabush's user avatar
  • 293
15 votes

GNU screen: move between regions

screen commands for switching between regions are: actually focus up, focus down, focus right and focus left. To type these commands (or any other screen command, for that matter) you type C-a :focus ...
sherzodr's user avatar
  • 151
15 votes

Can't resume screen, says I am already attached?

I attach to screen with the options -rD. See the manual: -D -r Reattach a session. If necessary detach and logout remotely first.
Marsel Arduanov's user avatar
15 votes
Accepted

Running GNU screen through SSH, the shell is not a login shell?

From the man pages of GNU screen: -s program sets the default shell to the program specified, instead of the value in the environment variable $SHELL (or "/bin/sh" if not defined). This can ...
aviro's user avatar
  • 5,542
14 votes

How to rename a gnu screen session

# screen -S old_session_name -X sessionname new_session_name
Sachin Dangol's user avatar
14 votes

terminate screen monitoring serial port

I run all my terminals inside a screen, and also sometimes use screen to connect to serial. If you screen /dev/ttyUSB0 inside screen, you'll just get a new window in your current session, not a new ...
arantius's user avatar
  • 270
13 votes

How do I kill all screens?

Have recently begun to familiarize myself with awk I put together this and it served its purpose. I posted it since its quite easy to understand. screen -ls | grep '(Detached)' | awk 'sys {screen -S ...
Eliassen's user avatar
  • 131
13 votes
Accepted

Do I really need -dmS option in screen to run background job stably even log out?

You would only use -dm if you want to run a command in a screen session and not enter it interactively -S is just to give the session a usable name so you can reconnect to it again easily later If ...
Eric Renouf's user avatar
  • 18.4k
13 votes
Accepted

Preventing bell flash with screen in putty

You can do what you want in a terminal-independent way using just your .screenrc: vbell on vbell_msg '' termcapinfo * vb=: The settings are: first line (you already did this) second line cancels ...
Thomas Dickey's user avatar
12 votes
Accepted

Increase buffer size while running screen

Do Ctrl + a : then enter scrollback 1234 sets your buffer to 1234 lines. You enter scrollback mode ("copy mode") with Ctrl + a Esc, then move in vi-style, leave copy mode with another Esc
Philippos's user avatar
  • 13.5k
11 votes
Accepted

Create a screen, launch a command in it and detach

You can detach right after starting a program inside of screen: screen -dmS myserver python myserver.py From screen's man page -d -m Start screen in detached mode. This creates a new session ...
Stefan M's user avatar
  • 1,616
11 votes
Accepted

sleep command using screen command is not displayed in ps

This was confusing to me initially as well. I then re-read the local screen man page for the SYNOPSIS -- the online man page does not give a synopsis) -- and noticed that it said: screen [ -options ] ...
Jeff Schaller's user avatar
  • 67.3k
10 votes

.ssh/config way to specify pseudo-tty allocation and command execution

Use the force, Luke! RequestTTY force in your ~/.ssh/config for the desired host.
Veaceslav Mindru's user avatar

Only top scored, non community-wiki answers of a minimum length are eligible