Sample Header Ad - 728x90

Unix & Linux Stack Exchange

Q&A for users of Linux, FreeBSD and other Unix-like operating systems

Latest Questions

4 votes
4 answers
6408 views
Command for launch a new terminal, or a new tab if exists
I have a keyboard shortcut that is mapped to running the command `gnome-terminal` (I'm on Fedora 27). I wish that this key, would open a new terminal if no terminal is open, but open a new tab on the existing terminal window if a terminal window is already open. What would be the command to do that?
I have a keyboard shortcut that is mapped to running the command gnome-terminal (I'm on Fedora 27). I wish that this key, would open a new terminal if no terminal is open, but open a new tab on the existing terminal window if a terminal window is already open. What would be the command to do that?
bluesummers (151 rep)
Nov 30, 2017, 08:03 AM • Last activity: Jun 21, 2025, 12:06 PM
3 votes
1 answers
2142 views
How to find gnome-terminal currently used profile with cmd line?
I'm using Ubuntu 16.04 and I want to be able to tell which profile is used by a given terminal emulator. Just the name would be enough. It's trivial to find with GUI : just right click in the terminal window, and the profile in use will be indicated under "Profiles". You can also go Edit -> Profile...
I'm using Ubuntu 16.04 and I want to be able to tell which profile is used by a given terminal emulator. Just the name would be enough. It's trivial to find with GUI : just right click in the terminal window, and the profile in use will be indicated under "Profiles". You can also go Edit -> Profile Preferences -> Profile Name. I would like to access that information with command line, but can't find how.
Luk (31 rep)
Jan 10, 2017, 10:39 AM • Last activity: Jun 17, 2025, 05:01 AM
5 votes
4 answers
9287 views
Change border color around window (edit GTK theme)
I am using a fairly recent version of `Cinnamon` (5.4.12), with desktop theme `Adwaita-dark` (and `Adwaita` sometimes). When I start a `gnome-terminal` window, it has a very thin (1px?) white border all around it. But as I like black terminals, I configured a black background to it, but now, I canno...
I am using a fairly recent version of Cinnamon (5.4.12), with desktop theme Adwaita-dark (and Adwaita sometimes). When I start a gnome-terminal window, it has a very thin (1px?) white border all around it. But as I like black terminals, I configured a black background to it, but now, I cannot see the window borders anymore. This also happens with other dark background applications. It can be very confusing to know which is which when terminal windows are overlapping, or even just next to one another. I tried to change this colour with no success: - by searching in the theme files in /usr/share/themes/Adwaita, - by playing with ~/.config/gtk-3.0/gtk.css to override some configuration, - by reading other similar questions , but they are either outdated or not applying to my use case. So, **how can I change the border colour of gnome-terminal (and possibly all other) windows to white?**
Totor (21020 rep)
Nov 20, 2022, 11:14 PM • Last activity: Jun 8, 2025, 04:00 AM
8 votes
2 answers
1250 views
Open HTML file in Firefox from terminal
I made this script to open three HTML files in Firefox from a subdirectory: #!/bin/bash firefox ./web/*.html 2>/dev/null & disown; I call the bash script from the terminal. Which seems to work okay, but after doing some things in Firefox I have this message in the terminal: $ [GFX1-]: RenderComposit...
I made this script to open three HTML files in Firefox from a subdirectory: #!/bin/bash firefox ./web/*.html 2>/dev/null & disown; I call the bash script from the terminal. Which seems to work okay, but after doing some things in Firefox I have this message in the terminal: $ [GFX1-]: RenderCompositorSWGL failed mapping default framebuffer, no dt ...which I then have to abort with Ctrl-C. Shouldn't disown and 2>/dev/null have taken care of that? Is there a better way for me to do this? FWIW, I'm using Linux Mint 21.1 and the latest Firefox.
Mike (271 rep)
Jun 3, 2025, 11:23 PM • Last activity: Jun 4, 2025, 07:17 PM
122 votes
13 answers
160363 views
How to rename terminal tab title in gnome-terminal?
Used to be able to right click on the tab and change the title. Not sure how to do this anymore. Just upgraded to Fedora 21. EDIT: I have switched from gnome-terminal to ROXterm
Used to be able to right click on the tab and change the title. Not sure how to do this anymore. Just upgraded to Fedora 21. EDIT: I have switched from gnome-terminal to ROXterm
penner (1331 rep)
Jan 5, 2015, 04:48 PM • Last activity: May 24, 2025, 04:02 PM
0 votes
2 answers
3047 views
Execute script in new gnome-terminal loading bashrc
I have a script in a gnome-terminal shell and I would like to open a new terminal, load the bashrc configuration, execute a new script and avoid the closure of the new terminal window. I have tried to execute this commands: gnome-terminal -x bash the script above open a new shell and loads bashrc, b...
I have a script in a gnome-terminal shell and I would like to open a new terminal, load the bashrc configuration, execute a new script and avoid the closure of the new terminal window. I have tried to execute this commands: gnome-terminal -x bash the script above open a new shell and loads bashrc, but I don't know how to execute a script automatically. gnome-terminal -x ./new_script.sh the script above open a new shell and execute the script but doesn't load bashrc and close the window. ---------- The result that I would like to obtain is to feel like opening a new terminal as clicking the term icon but execute a script after the bashrc setup.
Cyr (101 rep)
Jan 31, 2017, 11:05 AM • Last activity: May 16, 2025, 11:05 AM
4 votes
1 answers
250 views
Why does tab autocomplete sometimes not work?
In `bash` (Ubuntu 24.10, but I guess this would apply to other versions/distributions) when you type in a console a command you can use TAB to autocomplete the filenames of the current directory. Example: ```$ ls Doc``` TAB would propose the `Document` folder. This works for many commands, but not f...
In bash (Ubuntu 24.10, but I guess this would apply to other versions/distributions) when you type in a console a command you can use TAB to autocomplete the filenames of the current directory. Example:
$ ls Doc
TAB would propose the Document folder. This works for many commands, but not for other. On my system, for example, it does not work for sqlite3. Pressing TAB does nothing. Why does this happen? Is it the invoked program that has to handle the keypress or (as I naively thought) it is a feature of bash or even of gnome-terminal?
Mark (815 rep)
Apr 4, 2025, 06:56 AM • Last activity: Apr 26, 2025, 11:50 AM
0 votes
1 answers
4068 views
Create keyboard shortcut in Arch Linux
I'm new to Arch Linux and recently installed it with GNOME as a desktop environment. I can run the gnome terminal by clicking the icon, but I would like to set up a shortcut. I want to set up the shortcut like in Ubuntu, Ctrl + Alt + T . One can add a shortcut through **Settings>Keyboard>View and Cu...
I'm new to Arch Linux and recently installed it with GNOME as a desktop environment. I can run the gnome terminal by clicking the icon, but I would like to set up a shortcut. I want to set up the shortcut like in Ubuntu, Ctrl+Alt+T. One can add a shortcut through **Settings>Keyboard>View and Customise Shortcuts**. It asks for a command. What would that command be? I'm trying to get it to open up at /home. Does anyone have any suggestions or can point me in the right direction?
inspectorconfusion (1 rep)
Jul 1, 2022, 11:24 AM • Last activity: Apr 8, 2025, 07:09 PM
0 votes
1 answers
53 views
Gnome terminal doesn't display the first letter of every line
The Gnome terminal app is missing a letter... but only sometimes. It happens only when maximized (as in Alt + F10 or Super + Up arrow ) or in full screen ( F11 button) on a Full HD 1920 × 1080 external display This behavior is not present when terminal is not maximized/not full screen on the Fu...
The Gnome terminal app is missing a letter... but only sometimes. It happens only when maximized (as in Alt+F10 or Super+Up arrow) or in full screen (F11 button) on a Full HD 1920 × 1080 external display This behavior is not present when terminal is not maximized/not full screen on the Full HD screen or when on the 1366×768 laptop screen. No other apps encounter this issue. * OS: Ubuntu 24.04 LTS with removed extensions: Desktop icons and Dock * Hardware: HP EliteBook 840 G3 This is the closest I found to my problem but I don't understand if the solution is applicable: https://unix.stackexchange.com/questions/578754/how-to-fix-a-full-screen-terminal-that-believes-it-is-9-lines-bigger-than-it-is Looking forward for your help :)
airstrip1 (1 rep)
Mar 12, 2025, 11:48 PM • Last activity: Mar 20, 2025, 08:09 PM
0 votes
2 answers
1679 views
How to dynamically switch terminal colors for all open terminals?
I use gnome-terminal on Ubuntu / Fedora. For color schemes I use [base16-shell](https://github.com/chriskempson/base16-shell), along with its corresponding settings for my editor vi. I have configured my `.bashrc` to set the base16 theme on start up. I sometimes switch between themes by changing thi...
I use gnome-terminal on Ubuntu / Fedora. For color schemes I use [base16-shell](https://github.com/chriskempson/base16-shell) , along with its corresponding settings for my editor vi. I have configured my .bashrc to set the base16 theme on start up. I sometimes switch between themes by changing this bashrc file. This works for occasional changes to my color scheme, as I can just my .bashrc once in a while and all future windows open with the correct color. **What I want?** I want to be able to change color scheme on all open gnome-terminal windows with a single click / command. Is there a way to do that? **About my Workflow** I usually have a bunch of terminal windows open with different settings on them. Some of them have text editors open, and some text editor program (vim) in the background, to allow multi-tasking with multiple text editors on the same terminal window. Depending on the lighting in the room, I feel it is better to switch between two color schemes - A light color scheme during the day / brightly lit room, and dark color scheme during the night, not so well lit room. I don't want to go and type a command to switch color schemes on each open terminal windows. Besides some may have a program running in the foreground printing, which I may not want to interrupt. Is there a way to "signal" the terminal to switch to a custom color scheme? I understand it might be difficult to do it on terminals that have a program running actively in the foreground. But at least can I do it for all other terminals which have programs in the background, or no command running. I am willing to explore other terminals if that would help. I have been thinking of using gnome-terminal profiles, but can't seem to figure out how to achieve exactly what I want. Thanks in advance!
Rohit Banga (111 rep)
Sep 19, 2021, 07:59 PM • Last activity: Feb 9, 2025, 05:58 AM
2 votes
1 answers
409 views
With bash, create a hyperlink that opens with phpstorm
I have: - a bash script running in terminal that gives me a list of files from my local computer - phpstorm properly configured, so that I can open a file in phpstorm by typing "phpstorm /path/to/file" in terminal Now I want the script to provide not only the list of filenames, but each filename sho...
I have: - a bash script running in terminal that gives me a list of files from my local computer - phpstorm properly configured, so that I can open a file in phpstorm by typing "phpstorm /path/to/file" in terminal Now I want the script to provide not only the list of filenames, but each filename should act as a link. Clicking on the link should have the same result as typing "phpstorm /path/to/file" in terminal. I checked this answer https://unix.stackexchange.com/questions/284476/terminal-create-hyperlinks , but couldn't modify it to my needs. This doesn't work at all: echo -e '\e]8;;phpstorm /path/to/file\aLinktext\e]8;;\a' This does something, but opens the file in gedit: echo -e '\e]8;;file:///path/to/file\aLinktext\e]8;;\a' I looks like I "only" have to switch the preferred editor to phpstorm... But how would I do that? Any ideas?
yogi (21 rep)
Dec 10, 2021, 02:48 PM • Last activity: Feb 5, 2025, 03:56 PM
0 votes
1 answers
48 views
Yanking to the global clip board from the command line in Vi editing-mode
I am using Arch, bash and gnome terminal. All are up to date with the very latest software versions. I wish to bind ctrl+c to yank the current line on the command line to the global clipboard, which may not yet be in the history file. So far I have had no success. Parsing the history file is problem...
I am using Arch, bash and gnome terminal. All are up to date with the very latest software versions. I wish to bind ctrl+c to yank the current line on the command line to the global clipboard, which may not yet be in the history file. So far I have had no success. Parsing the history file is problematic becasue the line on the command line may be yanked before the command has been run, in which case it won't be in the history file, so parsing this is not a viable option. .bashrc has vi bindings enabled as follows # set editing-mode vi set -o vi I am being careful to re-source each time as necessary with source ~/.bashrc. I have tried adding the below various options to .inputrc, re-initialising each time with bind -f ~/.inputrc, none have worked. **.inputrc tests:** $if mode=vi "\C-y": " \C-e\C-u\C-k\C-y\C-l\C-y\C-e\C-y\n" $endif and this $if mode=vi "\C-c": "\e0\C-k\C-u\C-y\n" $endif and these "\"+y": yank-to-clipboard "\Cc": copy-line # ctrl+c "\^C": copy-line # ctrl+c "\006": copy-line # ctrl+c **.bashrc tests:** I have also tried adding the following to .bashrc bind -m vi-command '"\C-y": "fc -ln -0 | tr -d \"\\n\" | xclip -selection clipboard\n"' then copy_current_command() { local cmd cmd=$(fc -ln -0) echo -n "$cmd" | xclip -selection clipboard } bind -m vi-command '"\C-c": "copy_current_command\n"' The below does not work either This is .inputrc "\e[1;6C": yank-to-clipboard # ctrl+shift+c "\^C": yank-to-clipboard # ctrl+c and this in .bashrc yank-to-clipboard() { local line=$(readline) # get the current line echo "$line" | xclip -in -selection clipboard }
Kes (909 rep)
Feb 2, 2025, 01:47 PM • Last activity: Feb 3, 2025, 12:29 AM
1 votes
2 answers
3559 views
How to change terminal title without changing the prompt string?
I have customized my command prompt to display current directory with some color and full path. Now I want to set title of my window to only directory name (not full path). Can you please advise how to achieve that in korn shell. Thanks.
I have customized my command prompt to display current directory with some color and full path. Now I want to set title of my window to only directory name (not full path). Can you please advise how to achieve that in korn shell. Thanks.
Forever Learner (769 rep)
Jan 5, 2017, 07:55 AM • Last activity: Jan 5, 2025, 04:43 PM
1 votes
1 answers
769 views
Opening terminal in DWM
I got GNOME as my first desktop environment.  As I go to dwm and want to call the terminal by  Alt + Shift + Enter , the terminal opens in the GNOME environment, but not in dwm.
I got GNOME as my first desktop environment.  As I go to dwm and want to call the terminal by Alt+Shift+Enter, the terminal opens in the GNOME environment, but not in dwm.
Daniil (113 rep)
Sep 22, 2019, 06:28 PM • Last activity: Dec 30, 2024, 02:39 PM
16 votes
4 answers
83412 views
Terminal, Prompt changed to "-Bash-4.2" and colors lost
Usually my terminal prompt was username place$ now it only shows bash-4.2$ and all the color settings have been lost (on the terminal profile I have the same color scheme, but it just don't show colors) I don't have any idea of what happens (and I don't know how to search for this). It changes from...
Usually my terminal prompt was username place$ now it only shows bash-4.2$ and all the color settings have been lost (on the terminal profile I have the same color scheme, but it just don't show colors) I don't have any idea of what happens (and I don't know how to search for this). It changes from nothing, I was working with eclipse and maven, opened a new terminal and the new terminal didn't have colors. Note: I don't have a ~/.bashrc file, but I have a ~/.bash_profile.
lcjury (263 rep)
Apr 22, 2014, 01:00 PM • Last activity: Nov 27, 2024, 01:21 PM
3 votes
1 answers
273 views
grep return "No such file or directory" after command substitution
I'm trying to use grep in a bash script and assign the result to a variable: ```lang-bash RESUlT=$(grep -R -I --exclude-dir=addons "^[^#]*print(" ) ``` But it returns bash: Map/Places/place.gd:: No such file or directory I tested it in my terminal and ```lang-bash grep -R -I --exclude-dir=addons "^[...
I'm trying to use grep in a bash script and assign the result to a variable:
-bash
RESUlT=$(grep -R -I --exclude-dir=addons "^[^#]*print(" )
But it returns bash: Map/Places/place.gd:: No such file or directory I tested it in my terminal and
-bash
grep -R -I --exclude-dir=addons "^[^#]*print("
returns what I expect, but
-bash
$(grep -R -I --exclude-dir=addons "^[^#]*print(" )
returns the error. I have no idea why that happens. My whole Script:
-bash
#!/bin/bash

CYAN='\033[0;36m'
RED='\033[0;31m'
NC='\033[0m' # No Color

RESUlT=$(grep -R -I --exclude-dir=addons "^[^#]*print(" )
echo "${RESULT}"
echo -e "${CYAN}I ${RED}love${NC} Stack Overflow"
What bash does:
-bash
**bash -o xtrace .check_code.sh** 
+ CYAN='\033[0;36m'
+ RED='\033[0;31m'
+ NC='\033[0m'
++ grep -R -I --exclude-dir=addons '^[^#]*print('
+ RESUlT='Map/Places/place.gd:	print("enter")'
+ echo ''

+ echo -e '\033[0;36mI \033[0;31mlove\033[0m Stack Overflow'
I love Stack Overflow
One weird thing in the Terminal:
-bash
whereis grep
returns
-bash
grep: /usr/bin/grep /usr/share/man/man1/grep.1.gz /usr/share/info/grep.info.gz
**But:**
-bash 
$(whereis /usr/bin/grep)
returns
-bash
Command 'grep:' not found, did you mean:
  command 'grep' from deb grep (3.11-2)
Try: sudo apt install
T.S (33 rep)
Jun 27, 2024, 10:12 AM • Last activity: Nov 24, 2024, 02:17 PM
2 votes
1 answers
384 views
gnome-terminal: run a custom command without opening the terminal window
I am trying to use alacritty instead of the default gnome-terminal. When I specify it in "Profiles->Custom command" it does start, however the gnome-terminal also opens its own window in the background. Is there a way to get rid of this window? (Gnome 43.9, Debian 12)
I am trying to use alacritty instead of the default gnome-terminal. When I specify it in "Profiles->Custom command" it does start, however the gnome-terminal also opens its own window in the background. Is there a way to get rid of this window? (Gnome 43.9, Debian 12)
Iiro Ullin (131 rep)
Feb 9, 2024, 10:31 PM • Last activity: Nov 22, 2024, 08:31 PM
4 votes
1 answers
339 views
How to explicitly set the tabname of a new gnome-terminal?
I want to explicity rename a tab in gnome-terminal on startup of the tab. I don't want to use gnome-terminal --title flag as that gets reset by my systems bashrc file after whatever else is supposed to run. I have used this command with success in a normal terminal export PROMPT_COMMAND="echo -ne '\...
I want to explicity rename a tab in gnome-terminal on startup of the tab. I don't want to use gnome-terminal --title flag as that gets reset by my systems bashrc file after whatever else is supposed to run. I have used this command with success in a normal terminal export PROMPT_COMMAND="echo -ne '\033]0;TABNAME\007'" This command works fine to rename the current tab's name, but when I try to use it in conjunction with gnome-terminal execute command, I am not getting proper output. I have used gnome-terminal --e flag to execute simple commands with success, something like this will bring up a new terminal and echo hey then return to bash gnome-terminal -e "bash -c 'echo hey';bash" Here is what I am trying ***note the escaped " " marks that I added*** TABNAME="export PROMPT_COMMAND=\"echo -ne '\033]0;TABNAME\007'\"" gnome-terminal --tab --e "bash -c $TABNAME;bash" I always get weird output no matter how I change the quotes, but I think that is where the problem is.
Prodnegel (141 rep)
Jan 31, 2017, 08:35 PM • Last activity: Nov 14, 2024, 08:27 AM
0 votes
2 answers
423 views
gnome-terminal - Set default profile for each theme variant
I have created two custom gnome-terminal profiles, with custom colors, for light mode and dark mode (I like [PaperColor][1]). And in the gnome-terminal preferences, I have "Theme variant" set to "Follow system style". But even when gnome-terminal changes between dark theme and light theme based on s...
I have created two custom gnome-terminal profiles, with custom colors, for light mode and dark mode (I like PaperColor ). And in the gnome-terminal preferences, I have "Theme variant" set to "Follow system style". But even when gnome-terminal changes between dark theme and light theme based on system style, I have to manually swap between my two custom profiles. I _could_ just use one profile with "Use colors from system theme" checked, but then I have ugly system theme colors instead of my preferred colors. Is there any way to set gnome-terminal to use different custom profiles for dark theme and light theme? Or: Is there a way to configure the system colors to match my custom gnome-terminal profile colors? With both dark theme and light theme?
wile_e8 (111 rep)
Oct 17, 2024, 03:12 AM • Last activity: Oct 17, 2024, 12:26 PM
6 votes
1 answers
421 views
How to find the name of the binary used to launch an application installed with pacman?
I just took frustratingly long to find out that the binary for the "gnome-console" package is called "kgx". Hence, my question: **Assuming that I know the name of an installed package from pacman, is there a general way to find the name of its binary that can be used to launch the application?** For...
I just took frustratingly long to find out that the binary for the "gnome-console" package is called "kgx". Hence, my question: **Assuming that I know the name of an installed package from pacman, is there a general way to find the name of its binary that can be used to launch the application?** For context: I knew that my default Arch GNOME installation provided a terminal emulator from the GUI. In the GUI, it was named "Console". So I queried pacman via
-Qs console
. Which returned:
local/gnome-console 47.1-1 (gnome)
    A simple user-friendly terminal emulator for the GNOME desktop
However,
-console
was not within the known namespace of my terminal. Hence, I knew that the actual binary must have a different name. At this point, my knowledge ended, and I had to search the internet (for somehow way too long) until I stumbled over an old comment on Reddit mentioning that the binary is actually called "kgx" instead. I assume there is a better way to do this than hope that somebody on the internet knows the name of the binary that you are looking for.
ls. (944 rep)
Oct 11, 2024, 10:26 AM • Last activity: Oct 12, 2024, 11:43 AM
Showing page 1 of 20 total questions