New answers tagged

0 votes

How to setup the terminal proxy for ubuntu terminal via v2ray

youtube-dl has option to use proxy: youtube-dl --proxy socks5://127.0.0.1:1080/ https://www.youtube.com/watch?v=... or youtube-dl --proxy http://127.0.0.1:1080 https://www.youtube.com/watch?v=...
2 votes

Replace a line of text in a file, with the contents of another file

You can use the sed editor's r command to read the contents of a file and insert them, deleting the original matching line after: sed -e '/rule_map = /{r fix_rule_map_in_foo' -e 'd;}' foo.py The new ...
2 votes

Replace a line of text in a file, with the contents of another file

You can set that single line contained in the file fix_rule_map_in_foo in a variable named e.g. fix with command substitution like so: fix="$(cat fix_rule_map_in_foo)" You can set the ...
  • 17k
0 votes

adduser fails with error code 1 and then error code 6

you can try creating the user with no group like below: sudo adduser <username> --system the user will be created with group 'nobody'. Then if you would like to add the user you created to a ...
  • 1
0 votes

Command to switch on/off sharing Ubuntu desktop

I found this : https://serverok.in/enable-remote-desktop-in-ubuntu-from-the-command-line This works for me: export DISPLAY=0.0 gsettings set org.gnome.Vino notify-on-connect false gsettings set org....
1 vote

How to check out which windowing system am I using on ubuntu 22.04 in command line now?

I use Kubuntu and this works for me. fred@z690-jammy:~$ echo $XDG_SESSION_TYPE x11
  • 11.1k
1 vote

How to access Windows files from Linux in WSL?

Everything in @Tooster's answer is corrected, but let me address your main question a bit more directly: (base) paloma@DESKTOP-ISCC0ON:~$ cd Documents -bash: cd: Documents: No such file or directory ...
  • 9,567
0 votes

How to find out the terminal command of an application?

From https://specifications.freedesktop.org/desktop-entry-spec/desktop-entry-spec-latest.html: Basically when you install an app, a .desktop file is generated somewhere. This .desktop file is what ...
  • 141
0 votes

Why does my terminal app not open on Ubuntu 22.04?

Basically, try to open and close, in the header it shows "bin/false" or "None" and in the bottom line "none 80x24"
  • 1
0 votes

Errors in sudo apt upgrade

WineHQ has altered their PGP key. You'll need to follow the steps at WineHQ's documentation and add the keyrings (at you own risk; external source) Type this commands to download and add the ...
2 votes

Bash Equivalency Struggles

pacmd list-sources usually results in lines with leading spaces/tabs ... That might result in the two strings you are comparing to be not equal ... Spaces count. You can use =~ for partial match e.g. ...
  • 17k
1 vote

"vcxsrv.exe: command not found" Error on WSL Ubuntu

Per the instructions, you have to run the command "C:\Program Files\VcXsrv.exe" :0 -multiwindow -clipboard -wgl -ac from Windows. Only after this step should you run the commands from ...
-1 votes

Run an application from a newly spawned Alacritty without the window closing after execution

See the Alacritty man page for the --hold option. I think this is what you're looking for. Also you might want to open bash at the end so if the process is closed Alacritty wouldn't be unusable.
0 votes

Wayland equivalent to "xset led"

The device name seems to change on every reboot for me, thus I borrowed the last answer and provided the work around below. *Unless you use more than one keyboard, then it in theory should work. Until ...
2 votes

Cannot install software

I also got this issue recently. The exact error is the line chown: invalid group: ‘root:adm’ Ubuntu doesn't have adm group by default. You can add the group adm manually. sudo addgroup adm
  • 21
1 vote

How to uninstall the WSL installation of Ubuntu 20.04 from Windows 10?

Uninstalling a distro via the settings or store didn't work for me. What did was: Enter a cmd or PowerShell prompt, wsl -l to see a list of installed distro names wsl --unregister <DistroName>
2 votes

How to log URL to a file only if it’s HTTP status code is 200?

If you want the HTTP response/status and the URL saved to a file in the format you desire. then curl alone can do that ... It has the option -w or --write-out(Which defines what to display on stdout ...
  • 17k
0 votes

Re-attach detached Terminal Tabs

Try Mate Terminal on Ubuntu 18.04 It is available in apt: sudo apt update sudo apt install mate-terminal I use Mate Terminal (1.20.0) on Ubuntu 18.04, and I confirm that the workaround solution given ...
0 votes

How do I create a fake process bar?

Taking the comment from @wjandream and just using for i in {1..100}, the third option is reduced to: for ((i=0; i<=100; i++)); { echo "$i"; echo "# Downloading $i%";sleep 0.2; }...
  • 488
0 votes

Yad Button closed

Further to my comment, I did some experimenting and came up with this script, which I believe does exactly what you want. While the documentation says that a form must call a function, with my version ...
  • 488
0 votes

What is the terminal command for launching a web app?

Locate the .desktop file that is used to launch the web app Usually present at .local/share/applications in Home directory Copy the exec command and run it in the terminal (check for the name property ...
  • 1
3 votes
Accepted

Oneliner to get the command which started a process on a certain port

There are simpler straight foreword methods of getting the PID of a process that uses a certain port ... Like e.g. lsof when used with the options -i(which selects the listing of files any of whose ...
  • 17k
1 vote

How to access Windows files from Linux in WSL?

First of all try to format code and output from terminals using the fenced code block format. And now to the meritum. current working directory is the directory you are in. Your home directory (...
  • 183
1 vote

How can I change the Dropbox folder location using only the command line/remote access?

I renamed ~/Dropbox to ~/hideDropbox I had 2 drives as a RAID0, formatted ext4 so I plugged them in, then using Nautilus I looked for the RAID under +other locations and mounted it. Once it was ...
  • 11
1 vote

After attempting to set up code . on my wsl environment, commands have stopped working

A few notes: First, for recovery, exit Ubuntu and wsl ~ -e zsh -f. This should start Zsh without processing your ~/.zshrc. Alternatively, wsl ~ -e bash --noprofile --norc if the first version doesn'...
  • 9,567
4 votes

How do I replace multiple fields in multiple XML files?

One way to do it with sed is by running the following command: for f in *.xml; do sed "s|\(<filename>\).*\(</filename>\)|\1${f%.*}\2|; s|\(<path>\).*\(</path>\)|\1${f%.*}\...
0 votes

How can I tell what date Ubuntu was installed?

Unfortunately most answers can be misleading for cloud services because they often have an image they created beforehand. In that case the best bet might be delving inside /var/log files and finding ...
  • 101
5 votes
Accepted

How do I replace multiple fields in multiple XML files?

You would need an XML tool(like xmlstarlet) ... so: sudo snap install xmlstarlet In a loop ... so: for f in *.xml do xml ed -L -u "(//annotation/filename)" -v "${f/.xml/}" ...
  • 17k
0 votes

Is there a command to close a terminal window via commandline?

I'm using KDE here. I wrote a script and I execute it by right click > execute in console. After the executtion, the newly opened window of konsole, was left open and I had to manualy close it (by ...
  • 21
0 votes

How can I see if I'm logged in via VPN?

You can check for any "tun" entries in the routes output. I run the following: if [[ $(route | grep tun -c) -gt 0 ]]; then echo "Connected to VPN" else echo "Not ...
  • 131
0 votes

How do I make a custom path identifier?

You can also customize your alias just like I do alias work = "cd ~ && cd /home/anish/workspace" It's also the better approch suppose you are in some directory and you have to ...
0 votes

Open terminal from Nautilus right-click menu

To those who still encounter problems in 2022: The problem is that the open terminal feature had been implemented in gnome-shell; all you need to do is: sudo apt install gnome-shell-extension-desktop-...
0 votes

what is the new command for sudo nautilus on ubuntu 22.10?

The command you mention in the title never has been a valid command. It has been a recipe to potentially break your system. To perform file management as root user, hit Ctrl+L, then type "admin://...
  • 74.3k
0 votes

How do I move/maximize/activate desktop windows using `dbus` in terminal?

To manipulate windows in Gnome Shell from the command line, you can install the extension Window Calls by domandoman. It exposes a dbus interface that can return list of windows, move, resize, close ...
  • 74.3k
0 votes
Accepted

How to set sound balance through command line?

Taken from This answer: If you run PulseAudio then try with alsamixer: amixer set Master 100% 0%. To automate the process, you can write a Unit for systemd that will run this command on startup.
  • 183
8 votes

Renaming files with a year prefix from the beginning of the filename to the end

You can use rename command with regexp: rename 's/(\d+) - (.*)\.avi/$2 - $1.avi/' *.avi explained: rename - command (you may have to install it) s/<match>/<replacement>/ (substitute ...
  • 183
0 votes

How I can add to variable values in while loop using read line?

I can't think of a good reason to do this (except perhaps as a homework exercise), but yes, in bash, you can "add variables in a while loop using read". In particular, man bash notes of the +...
1 vote

Ubuntu 22.04.1 server: Putty will not accept any keyboard input properly when Putty is displaying a GUI in command prompt

Ctrl+Z to send the apt dist-upgrade process to the background. fg to bring the last process that you background-ed, which is the unfinished apt dist-upgrade, to the foreground. Once completed, the ...
  • 167
0 votes

How I can add to variable values in while loop using read line?

Don't try to reinvent the wheel: passWord_input="" while [[ "$passWord_input" != "$verifPassword" ]]; do read -s -r -p "Enter Password: " passWord_input ...
0 votes

service command not found

try sudo find / -type f -iname service if you get /sbin/service then /sbin/service sshd start
3 votes

How can I copy all files which starts with a letter and ends with another to a specific folder?

First, a file name actually refers to everything(including the file extension) ... So you might want to pay attention to that when asking/explaining in the future. Second, it appears that you want to ...
  • 17k
0 votes

Ubuntu 20.04 terminal is not responding

Faced the same issue on Ubuntu 20.04.4 LTS after installing ng-common package and doing some npm build/ install/ run commands. The part of my .bash_history file before I've faced the issue: npm run ...
0 votes

Finding a program running as AppImage

If you need to know where the AppImage binary (or any file) is located, run the following command. find / -name "*.AppImage" -exec ls -l {} \; The command find will search root /, and then ...
  • 14.4k
1 vote

How to configure Ubuntu terminal to jump/select words on Ctrl(+Shift)+Left and Ctrl(+Shift)+Right?

Short answer: I would recommend upgrading to Windows Terminal, the (relatively) new terminal replacement in Windows. In new installations of Windows 11 22H2, it is now the default terminal for ...
  • 9,567
1 vote
Accepted

Shortcut to specific profile mate-terminal

I found the man page for mate-terminal online, you should be able to read it with man mate-terminal, and it explains: --profile=PROFILE-NAME Use the given profile instead of the default profile I'm ...
  • 95.5k
0 votes
Accepted

Can't Create a Permanent Alias In Fish Shell

Ok, I figured it out. Basically, in the fish shell, you just need to type alias pd="pwd" and you create a temporary alias. To turn it into a permanent one you do funcsave pd and is done. ...
0 votes

"-bash: line 7: bc: command not found" error in script

Try installing bc: sudo apt install bc
0 votes
Accepted

Bash export errors when ssh-ing in

There is a space missing in front of #. Add the space manually with an editor or run, sudo sed -i 's/PATH#/PATH #/' /etc/profile
  • 25.1k
4 votes
Accepted

How can I print text while downloading file in ubuntu?

Main script: Create the following script as the source for your progress/bouncing bar (I called it bash-progress): #!/bin/bash # Initial configuration variables # Set time interval for progress ...
0 votes

how to set socks5 proxy in the terminal

Proxychains is very nice tool, but there are certain use cases that it does not support. What that worked for me was graftcp based on this comment. The installation is easy: git clone https://github....

Top 50 recent answers are included