Unix & Linux Stack Exchange
Q&A for users of Linux, FreeBSD and other Unix-like operating systems
Latest Questions
2
votes
1
answers
4019
views
Unable to open URL with xdg-open
Getting this error as regular user: ``` ~$ xdg-open http://www.google.com/ xdg-open: no method available for opening 'http://www.google.com/' ~$ ~$ xdg-mime query default text/html ~$ ``` Code from /usr/bin/xdg-open # if BROWSER variable is not set, check some well known browsers instead if [ x"$BRO...
Getting this error as regular user:
~$ xdg-open http://www.google.com/
xdg-open: no method available for opening 'http://www.google.com/ '
~$
~$ xdg-mime query default text/html
~$
Code from /usr/bin/xdg-open
# if BROWSER variable is not set, check some well known browsers instead
if [ x"$BROWSER" = x"chromium" ]; then
BROWSER=links2:elinks:links:lynx:w3m
if [ -n "$DISPLAY" ]; then
BROWSER=firefox:mozilla:epiphany:konqueror:chromium:google-chrome:$BROW$
fi
fi
open_envvar "$1"
exit_failure_operation_impossible "no method available for opening '$1'"
}
----
Operating system: Ubuntu 16.04 Gnu/Linux
xavier96
(21 rep)
Apr 11, 2020, 01:39 PM
• Last activity: Jul 14, 2025, 08:06 PM
158
votes
20
answers
171750
views
Decoding URL encoding (percent encoding)
I want to decode URL encoding, is there any built-in tool for doing this or could anyone provide me with a `sed` code that will do this? I did search a bit through [unix.stackexchange.com][1] and on the internet but I couldn't find any command line tool for decoding url encoding. What I want to do i...
I want to decode URL encoding, is there any built-in tool for doing this or could anyone provide me with a
sed
code that will do this?
I did search a bit through unix.stackexchange.com and on the internet but I couldn't find any command line tool for decoding url encoding.
What I want to do is simply in place edit a txt
file so that:
- %21
becomes !
- %23
becomes #
- %24
becomes $
- %26
becomes &
- %27
becomes '
- %28
becomes (
- %29
becomes )
And so on.
DisplayName
(12016 rep)
Oct 4, 2014, 01:13 PM
• Last activity: Jul 3, 2025, 05:20 PM
1
votes
3
answers
4493
views
how to get full URL from shortened URLs like bit.ly?
* I have a shortened URL from some documentation * I would like to open the URL because I believe the URL has good information * but I do not want to click the link until I can see the full URL ### how to get full URL from shortened URLs like bit.ly?
* I have a shortened URL from some documentation
* I would like to open the URL because I believe the URL has good information
* but I do not want to click the link until I can see the full URL
### how to get full URL from shortened URLs like bit.ly?
Trevor Boyd Smith
(4181 rep)
Feb 20, 2023, 06:41 PM
• Last activity: May 16, 2025, 11:56 PM
2
votes
2
answers
3761
views
Automating dirb for scanning several URLs
I have a bit of a problem making this script work and was wondering if anyone knew what the problem is. It is supposed to take a list of urls as input, scan them for sub directories and then output it to different files. for i in $(urls.txt); do echo $i; fn=$(echo $i | sed "s/\///g"); echo $fn; dirb...
I have a bit of a problem making this script work and was wondering if anyone knew what the problem is. It is supposed to take a list of urls as input, scan them for sub directories and then output it to different files.
for i in $(urls.txt); do echo $i; fn=$(echo $i | sed "s/\///g"); echo $fn; dirb $i /usr/share/wordlists/dirb/small.txt > $fn; done
This script does correctly remove slashes for the new file but I get the error (translated from Swedish) that ": no such file or directory". Probably from the > $fn part.
for i in $(urls.txt); do echo $i; fn=$(echo $i | sed "s/\///g"); echo $fn; dirb $i /usr/share/wordlists/dirb/small.txt -o $fn; done
And trying to use dirb's own output I instead get an error like
"OUTPUT_FILE httpwww.website.com
(!) FATAL: Error opening output file: httpwww.website.com"
And some clarification regarding the one liners:
1) loop through a list of urls
2) output the url to terminal
3) generate filename from url using
sed
4) output filename to terminal
5) run url through dirb and try to output it to file name
The supposed output file names look fine to me but aren't working. Does anyone know why that is?
Latedi
(121 rep)
Aug 4, 2016, 09:27 AM
• Last activity: Apr 23, 2025, 06:32 PM
0
votes
0
answers
13
views
kde konsole: clickable bugrefs
I would like to use so called bugrefs in [Konsole][1]. e.g. `boo#1194208` would be evaluated into https://bugzilla.opensuse.org/show_bug.cgi?id=1194208. Can I configure it somehow? Or do I need to implement it as a [plugin][2]? [1]: https://konsole.kde.org/ [2]: https://invent.kde.org/utilities/kons...
pevik
(1587 rep)
Mar 31, 2025, 08:54 AM
1
votes
2
answers
161
views
How automatically open a URL after rebooting in a Debian desktop?
How automatically open a URL after rebooting on a Debian desktop? 1- Running the command by terminal: xdg-open http://homeassistant.local:8123 OK it works and opens the URL above 2- creating any script, for example test1.sh with the content: xdg-open http://homeassistant.local:8123 and running it vi...
How automatically open a URL after rebooting on a Debian desktop?
1- Running the command by terminal:
xdg-open http://homeassistant.local:8123
OK it works and opens the URL above
2- creating any script, for example test1.sh with the content:
xdg-open http://homeassistant.local:8123
and running it via bash command:
bash test1.sh
works equally
But if I try to call these scripts or the command line itself via crontab, it doesn't run even if I include a sleep after reboot!
Example:
@reboot sleep 15; /home/carlos/test1.sh
Where test1.sh is a simple script with only a command line: (It works via bash manually as I describe above )
xdg-open http://homeassistant.local:8123
I see that my crontab runs because I did a simple command along with, in order to see if runs
@reboot echo "hi" >> filexx ( OK works and it creates the file )
My question:
What occurs to me is that it is not works because these commands lines only run in a terminal mode, but is that it?
Even the command to call a terminal before at crontab doesn't works
ex:
@reboot sleep 15; xterm
I am specialized in Hardware (electronic engineer not a software developer ) and therefore I don’t have many experiences in Debian or Ubuntu etc.
Even though I have seen several posts and repeat them in the same way, I cannot get crontab to open an specific URL...
Even creating by:
crontab -u user -e
Even giving permissions to the my test1.sh files by chmod etc
**I suppose that I’m making a basic mistake…**
In summary I just want after a reboot in a Raspberry Debian desktop open automatically an URL only this! (For use as a home assistant Kiosk webpage on this desktop)
carlos rother
(11 rep)
Mar 13, 2025, 01:37 AM
• Last activity: Mar 13, 2025, 11:34 AM
0
votes
0
answers
28
views
How to make garcon-url-handler open url in an INCOGNITO window?
``` $ garcon-url-handler https://example.com/ ``` opens the URL in a regular browser window. How to make it open it in an incognito window? No I don't want to type CTRL+SHIFT+N and paste it in the URL bar.
$ garcon-url-handler https://example.com/
opens the URL in a regular browser window.
How to make it open it in an incognito window? No I don't want to type CTRL+SHIFT+N and paste it in the URL bar.
Dan Jacobson
(560 rep)
Nov 15, 2024, 11:12 PM
0
votes
1
answers
18
views
How to browse to local_file.html#anchor fragments on the ChromeOS Linux command line?
``` nurdsborough@penguin$ ls info.html nurdsborough@penguin$ garcon-url-handler info.html #works nurdsborough@penguin$ garcon-url-handler info.html#anchor #fails ``` What is the workaround?
nurdsborough@penguin$ ls
info.html
nurdsborough@penguin$ garcon-url-handler info.html #works
nurdsborough@penguin$ garcon-url-handler info.html#anchor #fails
What is the workaround?
Dan Jacobson
(560 rep)
Oct 5, 2024, 11:23 AM
• Last activity: Oct 6, 2024, 02:07 AM
5
votes
1
answers
729
views
Open a url with a custom protocol from the command line
`xdg-open` can open urls, but only ones starting with `ftp`, `http` or `https`. But my browser will happily open other urls in programs that have a handler for it registered, e.g. `f5-vpn://` urls (for a vpn, this launches the vpn client after authenticating in a web app). How can I open other urls...
xdg-open
can open urls, but only ones starting with ftp
, http
or https
. But my browser will happily open other urls in programs that have a handler for it registered, e.g. f5-vpn://
urls (for a vpn, this launches the vpn client after authenticating in a web app).
How can I open other urls like f5-vpn://
with their registered handler from the command line, just like the browser does?
JanKanis
(1421 rep)
Aug 13, 2024, 02:44 PM
• Last activity: Aug 14, 2024, 07:09 AM
3
votes
2
answers
3332
views
How to block keywords in https URL using squid proxy?
I want to block keyword "import" in any URL, including https websites. Example: http://www.abc.com/import/dfdsf https://xyz.com/import/hdovh How to create acl to do it? Thanks
I want to block keyword "import" in any URL, including https websites. Example:
http://www.abc.com/import/dfdsf
https://xyz.com/import/hdovh
How to create acl to do it?
Thanks
flake
(31 rep)
Nov 20, 2015, 03:36 PM
• Last activity: Jul 1, 2024, 11:08 PM
0
votes
1
answers
796
views
Open specific URLs in certain app?
How can I tell `xdg-open` to open, say, YouTube URLs in a specific app, but use my default browser for all other URLs?
How can I tell
xdg-open
to open, say, YouTube URLs in a specific app, but use my default browser for all other URLs?
Geremia
(1252 rep)
May 28, 2024, 12:02 AM
• Last activity: May 28, 2024, 01:18 AM
51
votes
2
answers
43070
views
Create a custom URL Protocol Handler
I would like to register a URL scheme (or protocol) handler for my own custom URL protocol, so that clicking on a link with this custom protocol will execute a command on that URL. Which steps do I need to take to add this handler? Example: I want to open URLs like `ddg://query%20terms` in a new Duc...
I would like to register a URL scheme (or protocol) handler for my own custom URL protocol, so that clicking on a link with this custom protocol will execute a command on that URL. Which steps do I need to take to add this handler?
Example: I want to open URLs like
ddg://query%20terms
in a new DuckDuckGo browser search. If this protocol already exists, I assume that the steps to override a handler don't differ much from the steps to create a new one. Yes, technically, this is just a URL scheme, not a protocol.
palswim
(5597 rep)
Jan 28, 2019, 07:31 AM
• Last activity: Jan 23, 2024, 03:34 PM
4
votes
2
answers
1429
views
DNF: show URLs for downloaded packages
Is there an easy way to get the URLs for the downloaded packages in DNF? What I'm trying to achieve: I'm currently on a very expensive Internet plan, so I need to get links, download packages on a different connection and feed them to DNF.
Is there an easy way to get the URLs for the downloaded packages in DNF?
What I'm trying to achieve: I'm currently on a very expensive Internet plan, so I need to get links, download packages on a different connection and feed them to DNF.
Artem S. Tashkinov
(32730 rep)
Dec 23, 2023, 09:38 AM
• Last activity: Jan 2, 2024, 09:36 AM
10
votes
3
answers
9291
views
Resolve filename from a remote URL without downloading a file
I am creating a script, which should download latest version of an application from repository and deploy the app. The main issue: there are several repositories and I need to check, which of them has most recent version. E.g. http://repo1/xyz/LATEST -> (redirects to) -> http://repo1/xyz/app-1.0.0.0...
I am creating a script, which should download latest version of an application from repository and deploy the app.
The main issue: there are several repositories and I need to check, which of them has most recent version.
E.g.
http://repo1/xyz/LATEST -> (redirects to) -> http://repo1/xyz/app-1.0.0.0.zip
http://repo2/xyz/LATEST -> (redirects to) -> http://repo1/xyz/app-1.1.0.0.zip
So I need to iterate over available repositories and get only a filename - no need to download obsolette versions of software.
Denis Kulagin
(429 rep)
Apr 24, 2014, 07:21 AM
• Last activity: Sep 12, 2023, 07:22 AM
0
votes
0
answers
52
views
Calls to all googletagmanger.com URLs fail
I've been updating code on a website that contains calls to googletagmanager.com for a couple of days now, but only just realised that it's wasn't really broken. Turns out my MX Linux desktop simply refuses to connect any requests made to googletagmanager.com... All browsers = fail All plugins = dis...
I've been updating code on a website that contains calls to googletagmanager.com for a couple of days now, but only just realised that it's wasn't really broken. Turns out my MX Linux desktop simply refuses to connect any requests made to googletagmanager.com...
All browsers = fail
All plugins = disabled or removed
ping googletagmanger.com = success
httping https://www.googletagmanager.com/gtag/js?id=AW-866896948 = fail "could not connect (Connection refused)"
Tested on 4 other computers = success
So it looks like it's something with my computer only because **calls to anyones googletagmanager URL fail, not just ones I maintain** for my own clients. Any ideas what to look at next?
I'm running MX-21.3 "Wildflower"
Vince
(101 rep)
Aug 27, 2023, 09:31 AM
3
votes
2
answers
1614
views
Opening terminal links with the keyboard
One of the very useful things about `urxvt` is that I could use keyboard shortcuts to navigate through and open hyperlinks that appeared on the terminal screen (by adding some `urxvt*` entries on `.Xresources`, IIRC). Now I'm on `xfce4-terminal` and am missing this functionality. I took a look at `~...
One of the very useful things about
urxvt
is that I could use keyboard shortcuts to navigate through and open hyperlinks that appeared on the terminal screen (by adding some urxvt*
entries on .Xresources
, IIRC).
Now I'm on xfce4-terminal
and am missing this functionality. I took a look at ~/.config/xfce4/terminal/accels.scm
but couldn't find anything relevant. For the moment, I'm stuck to having to grab my mouse and Ctrl+click the terminal URLs I want to open in the browser, which is quite disruptive to my workflow.
Question: **is it possible to select and open URLs printed on the xfce4-terminal just using the keyboard?**
I'd be glad to hear about other terminal emulators that offer this functionality, but I don't intend on going back to urxvt for the moment.
Waldir Leoncio
(377 rep)
Jun 23, 2021, 05:49 AM
• Last activity: Aug 25, 2023, 08:26 AM
0
votes
5
answers
549
views
In bash how to copy an URL within a displayed text file without using the mouse?
Let me take you to this short trip: Open terminal. Type ```cat | head``` The first 10 lines of that text file are printed on standard output, displayed on the screen. In my case it looks like this: ```(Beginning of line 7)yada yada yada [[https://example-url-1.com][Example URL #1]] - [[https://examp...
Let me take you to this short trip:
Open terminal.
Type
| head
The first 10 lines of that text file are printed on standard output, displayed on the screen.
In my case it looks like this:
(Beginning of line 7)yada yada yada [[https://example-url-1.com][Example URL #1]] - [[https://example-url-2.com][Example URL #2]] yada yada yada (End of line 7)
Two links, right in the middle of line 7, surrounded by text, instead of being alone in that line.
And now the quiz question: How to copy only URL #2 into memory for pasting it in another program without using the mouse?
In GNU emacs? Super easy: Search for 'ht' - cursor jumps to beginning of the link, C-M SPC, link is marked, M-w, marked section is copied. But in bash?
futurewave
(213 rep)
Aug 17, 2023, 08:14 PM
• Last activity: Aug 21, 2023, 06:57 AM
0
votes
0
answers
197
views
How to sequentially open URLs in lynx?
from `$ man lynx` page: > If more than one local file or remote URL is listed on the command line, Lynx will open only the last interactively. All of the names (local files and remote URLs) are added to the G)oto history. Since I prefer not having to manually move between documents (`G)oto history`)...
from
$ man lynx
page:
> If more than one local file or remote URL is listed on the command line, Lynx will open only the last interactively. All of the names (local files and remote URLs) are added to the G)oto history.
Since I prefer not having to manually move between documents (G)oto history
), I'm currently using xargs to send multiple URLs (in a text file, one per line) in order to sequentially open all in lynx:
xargs --max-lines=1 lynx Q twice to proceed to the next webpage.
Directly opening several URLs opens the last one interactively, as mentioned on the man page:
lynx https://example.com/ https://example.net/ https://example.org/ https://example.edu/
---
related questions:
https://unix.stackexchange.com/questions/17659/opening-multiple-urls-from-a-text-file-as-different-tabs-in-firefox-chrome
https://unix.stackexchange.com/questions/703399/how-to-open-several-local-html-documents-in-lynx/
user598527
(735 rep)
Aug 11, 2023, 12:57 PM
1
votes
0
answers
144
views
Nginx proxy_pass + ssl problem with seo friendly url
Below is nginx.conf server { listen 00.00.000.000:80; server_name my_site.com www.my_site.com; return 301 https://www.my_site.com$request_uri; } server { listen 00.00.000.000:443; server_name my_site.com www.my_site.com; error_log /var/log/httpd/domains/my_site.com.error.log error; ssl on; ssl_certi...
Below is nginx.conf
server {
listen 00.00.000.000:80;
server_name my_site.com www.my_site.com;
return 301 https://www.my_site.com$request_uri ;
}
server {
listen 00.00.000.000:443;
server_name my_site.com www.my_site.com;
error_log /var/log/httpd/domains/my_site.com.error.log error;
ssl on;
ssl_certificate cert/214816718480217.pem;
ssl_certificate_key cert/214816718480217.key;
ssl_session_timeout 5m;
ssl_ciphers ECDHE-RSA-AES128-GCM-SHA256:ECDHE:ECDH:AES:HIGH:!NULL:!aNULL:!MD5:!ADH:!RC4;
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
ssl_prefer_server_ciphers on;
location / {
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_pass http://00.00.000.000:8080 ;
location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|tif|tiff|css|js|htm|html|ttf|otf|webp|woff|txt|csv|rtf|doc|docx|xls|xlsx|ppt|pptx|odf|odp|ods|odt|pdf|psd|ai|eot|eps|ps|zip|tar|tgz|gz|rar|bz2|7z|aac|m4a|mp3|mp4|ogg|wav|wma|3gp|avi|flv|m4v|mkv|mov|mpeg|mpg|wmv|exe|iso|dmg|swf)$ {
root /home/my_site/web/my_site.com/public_html;
access_log /var/log/httpd/domains/my_site.com.log combined;
access_log /var/log/httpd/domains/my_site.com.bytes bytes;
expires max;
try_files $uri @fallback;
}
}
location /error/ {
alias /home/my_site/web/my_site.com/document_errors/;
}
location @fallback {
proxy_pass http://00.00.000.000:8080 ;
}
}
In opencart with url
How can I fix it?
my_site/index.php?route=product/category&path=1_2
there is no problems. But if we are using some friendly url like my_site/category_1/category_2
than on page all url starts not with my_site/image
but with my_site/category_1/image
, so can't load any css, js, image.

Pavlo Kovchuk
(11 rep)
Jan 10, 2019, 02:26 PM
• Last activity: Jun 28, 2023, 12:06 PM
1
votes
2
answers
2050
views
how to convert plaintext to html with clickable links
how can i convert plaintext files containing a bunch of urls to html with clickable links? preferably on the command line. every once in a while i end up with a plaintext file containing a bunch of urls. often one url per line. maybe some empty lines in between. sometimes with some text. sometimes e...
how can i convert plaintext files containing a bunch of urls to html with clickable links? preferably on the command line.
every once in a while i end up with a plaintext file containing a bunch of urls. often one url per line. maybe some empty lines in between. sometimes with some text. sometimes even text and url in one line.
$ cat foo.txt
some links
https://stackoverflow.com/
https://superuser.com/
https://askubuntu.com/
best? https://unix.stackexchange.com/
the files are generated by humans so i cannot just configure the source to output well formatted files.
if there are only couple of urls then i can copy them by hand. or
cat
in gnome terminal (which makes urls clickable) and click on the links. i can even cat foo.txt | xargs firefox
.
but if they are mixed with text or if there are too many links then all that is no longer feasible.
i would like to not start to try to parse urls using regex: https://unix.stackexchange.com/questions/378496/sed-to-replace-text-url-to-html-url
Lesmana
(28027 rep)
May 2, 2020, 10:31 PM
• Last activity: Jun 20, 2023, 02:48 PM
Showing page 1 of 20 total questions