How can I assign a name for a screen? [closed] - linux

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 9 years ago.
Improve this question
I'm using the Screen multiplexer tool on the command shell and open a lot of screens. I then forget which process ID associates with which task.
I would like to set a name for a screen, but I can't find an option in the man page.
Currently, listing the screens looks like this:
There are screens on:
5422.pts-1.aws1 (Detached)
5448.pts-1.aws1 (Detached)
5027.pts-1.aws1 (Detached)
3 Sockets in /var/run/screen/S-sb.
And I would like to see something like this:
There are screens on:
5422.logCleanWorker (Detached)
5448.overNightLongTask(Detached)
5027.databaseOverNightLongTask (Detached)
3 Sockets in /var/run/screen/S-sb.
How can I do this?

To start a new session
screen -S your_session_name
To rename an existing session
Ctrl+a, : sessionname YOUR_SESSION_NAME Enter
You must be inside the session

To create a new screen with the name foo, use
screen -S foo
Then to reattach it, run
screen -r foo # or use -x, as in
screen -x foo # for "Multi display mode" (see the man page)

As already stated, screen -S SESSIONTITLE works for starting a session with a title (SESSIONTITLE), but if you start a session and later decide to change its title. This can be accomplished by using the default key bindings:
Ctrl+a, A
Which prompts:
Set windows title to:SESSIONTITLE
Change SESSIONTITLE by backspacing and typing in the desired title. To confirm the name change and list all titles.
Ctrl+a, "

The easiest way is to use Screen with a name:
screen -S 'name' 'application'
Ctrl + a, d = exit and leave the application open
Return to Screen:
screen -r 'name'
For example, using Lynx with Screen.
Create a screen:
screen -S lynx lynx
Ctrl+a, d = exit
Later, you can return with:
screen -r lynx

I am a beginner to Screen, but I find it immensely useful while restoring lost connections.
Your question has already been answered, but this information might serve as an add on - I use PuTTY with PuTTY connection manager and name my screens - "tab1", "tab2", etc. - as for me the overall picture of the 8-10 tabs is more important than each individual tab name. I use the 8th tab for connecting to db, the 7th for viewing logs, etc. So when I want to reattach my screens I have written a simple wrapper which says:
#!/bin/bash
screen -d -r tab$1
where first argument is the tab number.

Related

How to create desktop shortcut passing custom arguments? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed last year.
The community reviewed whether to reopen this question last year and left it closed:
Original close reason(s) were not resolved
Improve this question
I have KDE 5.20.5 and would like to create a desktop shortcut for launching Chromium passing custom command line arguments to it.
Initially, I've right-clicked on a Launcher Chromium menu entry -> Add to Desktop... and the shortcut got created. However, it's just a symlink to /usr/share/applications/chromium.desktop and I can't modify it.
Then, I've tried to copy that /usr/share/applications/chromium.desktop onto my desktop manually so I could modify the copy and not touch the original. However even before editing it, it 's unable to launch Chromium. It displays the following message box when double-clicked:
Unknown error code 100 You are not authorized to execute this file.
Please send a full bug report at https://bugs.kde.org.
I've sweated googling an answer to such the basic question: what is correct \ recommended way of creating a modifiable desktop shortcut based on a Launcher menu entry in KDE Plasma?
You need to make the copied chromium.desktop file executable. With Dolphin file manager: right-click on your .desktop file → Properties → Permissions tab → check Is executable checkbox.
Alternatively, from the folder with your .desktop file, you can run:
chmod 755 chromium.desktop
Now it should be able to launch Chromium.
To add a custom argument(-s) to the launcher - back in the Properties of your .desktop file go to the Application tab and add your argument(-s) to the Command field after the path to the executable, for example:
/usr/bin/chromium --profile-directory="Default"
While we are at the Application tab, you may want to change the Name field to something like "Chromium w/args" to help distinguish launchers later on.
As an option, you can edit the .desktop file by opening it with a text editor of your preference. To edit the launch command, navigate to the [Desktop Entry] group header, under which locate the line starting with Exec= and add custom arguments to it.
To edit the name of the launcher, under the same header locate lines starting with Name= (Name[xx_XX]=, e.g. Name[en_US]= for localized names) and alter them as you wish.
More information on Desktop Entries can be found in its specification or on ArchWiki
To add your new launcher to the application menus (for the current user) - move .desktop file to the
~/.local/share/applications/
Now your launcher will be available in Application Launcher and Krunner.
If you want the new launcher to co-exist with the original (instead of overriding it), you should rename the .desktop file to something like chromium_args.desktop.
Run this command at root directory :
ln -s $PWD ~/Desktop/

Text selection not works on Ubuntu terminal with SHIFT+ARROW (Left or right) [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 3 years ago.
Improve this question
Recently I installed Ubuntu and I've some troubles with typing text on terminal, the problems not occurs on the text editors. I can't select the text to right or left using shift+arrow. When I try it, like shift+left, D letter is typed on the line, and C is typed using shortcut with arrow right. Resuming, I've two issues:
Select text with shift+arrow not working;
Select all text with shift+home or shift+end
I installed KDE on Ubuntu. Please, anyone can help me?
The standard Terminal does not use the same shortcuts (or even the same cursor behavior) as you might expect in a browser or text editor window. The shift key by itself does not select text that way. shift+home will scroll to the top, shift+end to the bottom, and using it with pg up/pg down will scroll up/down one screen. The arrow keys are mapped to A/B/C/D.
As you can see on this list, most of the commands are for moving around and managing processes. I usually just select text with the mouse, then copy with ctrl+shift+c and paste with ctrl+shift+v. As discussed on Ask Ubuntu, there appears to be no easy way to select arbitrary text without the mouse.
Alternative terminal programs may offer more options.
Update While this is not a standard shortcut, you can go into Terminal's Edit > Preferences > Shortcuts, find the Edit section, click the Select All row in the Shortcut Key column, then enter a new shortcut like ctrl+shift+a. This new shortcut will then let you then copy all of the terminal text.

Add a custom option in Nautilus right click menu [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 2 years ago.
The community reviewed whether to reopen this question 3 months ago and left it closed:
Original close reason(s) were not resolved
Improve this question
When a user right-click on a folder in Nautilus, a menu appears. I want to add more options in that menu. I am using Gnome 3.
Is there any other way to customize that menu with command line? Actually I am making a Linux software and I want that these these options should be added when user installs the software.
This answer may be late, but it might be still useful.
No any third party package(s) needed
Write your own script and put it to: ~/.local/share/nautilus/scripts/
An example might be more clear:
If you want to add a Context Menu like Open By VSCode, you can create a file named OpenByVScode.sh with the content:
#!/bin/bash
code -n ${NAUTILUS_SCRIPT_SELECTED_FILE_PATHS}
then, make it executable;
chmod 744 OpenByVScode.sh
Finally, cope/move this file to ~/.local/share/nautilus/scripts/
The Context Menu is ready to use, which will be displayed under script submenu.
Codes explanation:
First line: #!/bin/bash, to specify which language interpreter needed
Second line: code -n ${NAUTILUS_SCRIPT_SELECTED_FILE_PATHS}
code is the VSCode default command, option -n means force to open in new window, on the contrary, it also has other option like -r, reuse the current windows, if the software is not open, this option will be the same like -n. For more, please check by code --help.
The variable NAUTILUS_SCRIPT_SELECTED_FILE_PATHS is defined by nautilus, like its name meaning, the path for the selected file or folder. It also has other three type of variables:
1. NAUTILUS_SCRIPT_SELECTED_URIS : newline-delimited URIs for selected files
2. NAUTILUS_SCRIPT_CURRENT_URI : current location
3. NAUTILUS_SCRIPT_WINDOW_GEOMETRY : position and size of current window
For more info, please refer HERE
You might want to use a Nautilus script, which doesn't require any additional installation like for Nautilus Actions.
In order to do that :
copy your script in the folder ~/.local/share/nautilus/scripts/
make sure it's executable.
It will then appear under the Scripts entry, from the right click context menu like below:
Nautilus Actions
We may define our own right-click context menu items with nautilus-actions
.
Run the Nautilus-Actions Configuration Tool either from the Dash, or from a terminal with
nautilus-actions-config-tool
In the Action tab give your action a sensible label, e.g. "Open in Terminator" and choose to display this in the selection or the context menu.
Next open the Command tab to enter the commands to run
Give in the full path to your command (/usr/bin/command_to_run) and program options.
After logging out and in again the right click context menu below will be displayed:

How to use vim help.txt in linux [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 8 years ago.
Improve this question
When I was trying to use vim help.txt file I found I was unable to open the .txt files included in it. Its instruction at the beginning of the file says:
Jump to a subject: Position the cursor on a tag (e.g. |bars|) and hit CTRL-].
But it doesn't work and it shrinks the size of the words on my terminal. I want to know how to open the related files and also how to get my terminal window back to normal.
Thanks in advance!
Thank you all for your kind help! I was using Gnome-terminal. Actually Ctrl+Shift+] is needed. Just as copy and paste are completed by Ctrl+Shift+c and Ctrl+Shift+v in the terminal.
As for the size of the words, it can be adjusted by view tab on top selecting Zoom in or Zoom out. The reason I was stuck was that, I can zoom in by Ctrl+- but I cannot zoom out by Ctrl++, and similarly, it should be Ctrl+Shift++.
(By + I mean pressing together. '+' means the actual key.)
Also worth mentioning, as #Kent pointed out, the settings can be adjusted through edit tab.
The problem is that in some keyboard layouts the ] key is the same as the + or the -, but with different modifiers. So when you type Ctrl-] your terminal emulator program thinks you are typing Ctrl-+, then uses it on its own, to change the size of the font, or something like that.
The solution is to map another key to this function. I'm using F12 because it is handy and seldom used for anything else. Just add this to your .vimrc:
nmap <F12> :exe "tjump" expand("<cword>")<CR>
imap <F12> <C-O><F12>
Well, technically, the Ctrl-] is equivalent to :tag, not :tjump, but I find that more convenient when using tags.

How do you scroll up/down on the console of a Linux VM [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 2 years ago.
Improve this question
I recognize that Up/Down will give you the command history. But, how do you look at past output by scrolling up and down?
I have used Shift+Page Up/Page Down, Alt+Shift+Up/Down and Page Up/Page Down but none of these seem to work.
It is a Redhat Linux box.
SHIFT+Page Up and SHIFT+Page Down. If it doesn't work try this and then it should:
Go the terminal program, and make sure
Edit/Profile Preferences/Scrolling/Scrollback/Unlimited
is checked.
The exact location of this option might be somewhere different though, I see that you are using Redhat.
Shift+Fn+ UP or DOWN on a Macbook will allow you to scroll.
Alternative: you can use the less command.
Type in console:
"your_command" | less
This will allow you to scroll with the up and down arrow keys.
Basically your output has been piped with the less command.
ALTERNATIVE FOR LINE-BY-LINE SCROLLING
Ctrl + Shift + Up Arrow or Down Arrow
Unlike Shift + Page Up or Page Down, which scrolls the entire page, this will help with a smoother line-by-line scrolling, which is exactly what I was looking for.
SHIFT + Page Up and SHIFT + Page Down are the correct keys to operate on the linux (virtual) console, but vmware console doesn't have those terminal settings. The virtual console has fixed scroll back size, it sounds like it's limited to video memory size according to this Linux virtual console Scrolling behavior documentation.
Another alternative, that might be already installed on your system is to use GNU screen :
# This starts screen which adds basic window management in terminals
screen
# This starts the copy mode you can use to scroll
<CTRL-A> [
# Now use the arrows to scroll
# To exit copy mode, do
<ESC>
See man screen for much more useful options (multiple windows, ...)...
Shift Pageup/End works for me.
It seems as though this is not easily possible: The Arch Linux Wiki lists no way to do this on the console (while easily possible on the virtual terminal).
You could use tmux scrolling:
Ctrl-b then [ then you can use your normal navigation keys to scroll around (eg. Up Arrow or PgDn). Press q to quit scroll mode.
Alternatively you can press Ctrl-b PgUp to go directly into copy mode and scroll one page up (which is what it sounds like you will want most of the time)
VM Ubuntu on a Mac...fn + shift + up/down arrows
I ran into the same problem with VMWare workstation with Ubuntu guest, turns out VmWare doesn't support scrolling back up from the server view. What I did was to install x GUI, then run xterm from there. For some reason it runs the same, but lets you scroll the normal ways. Hope this helps future readers in VmWare virtual boxes.
In some VPS hostings (like linode) you have to click Ctrl+A and then ESC. Exit with double ESC too.
Fn + Up/Down can scroll Terminal in Mac OS X 10.11
Press the Shift key when scrolling the mouse up/down works for me when loggin in Ubuntu using Terminal ssh in Yosemite.
PERSISTENT, longterm solution
Add this line to your ~/.screenrc
termcapinfo xterm* ti#:te#
Now you can create a screen, and scroll it up/down with your mouse;
Like you normally do.
For some commands, such as mtr + (plus) and - (minus) work to scroll up and down.

Resources