Questions tagged [bash]

Bash (Bourne-Again SHell), is the shell used in Ubuntu's command-line interface by default.

Filter by
Sorted by
Tagged with
1 vote
1 answer
20 views

Where is the "scripts" directory in Nautilus 43?

Where do you put the scripts that appear in the context menu when you right click in a folder or on a file in Nautilus? (Screenshot from a previous version of Nautilus) My scripts used to work just ...
  • 2,956
0 votes
0 answers
10 views

opening terminal when save as executed inside a given program for instance Texmaker Ubuntu 22.04.1

Is there a way to open terminal instead GUI when saving a given file inside a given program in Ubuntu? For instance, after editing a latex document inside Texmaker, I will press Ctrl+S and the GUI ...
  • 1
-2 votes
0 answers
28 views

With Starship Prompt, every time I log into root, this message is shown

[WARN] (starship::config): Error in 'Directory' at 'palette': Unknown key [WARN] - (starship::config): Error in 'Character' at 'add_newline': Unknown key ..... add_newline = false [line_break] ...
3 votes
4 answers
753 views

Is there any way at the bash command line to compute multiplication and division so that the first 3 digits after the period appear?

I currently use the following to compute the following at the bash command line with commas every three digits: printf "%'3.f\n" $(((29246636)*4096)) 119,794,221,056 The equation needs to ...
1 vote
1 answer
129 views

Terminal Output Redirected to another user's terminal

I wanted to know if it would be possible to redirect the output of my terminal into another user's (that is part of my group) terminal. For example, I would like to be able to execute this command : ...
  • 13
0 votes
0 answers
26 views

Is there problem with 'read' command in Bash, or in Bash itself when using multiprocessing, or may be I make some mistake?

First to mention that I do not have lot of experiences with Bash scripting. Here is the problem that I observe: When I execute read command and inside the cycle I run background processes, the read ...
  • 1
4 votes
1 answer
199 views

Can find's -newermt accept epoch time?

I seek to find files made after a specific time similar to how this command does it: find . -type f -newermt '1/30/2017 0:00:00' except instead of a date, and time, string, I need the time stamp to ...
  • 371
-2 votes
0 answers
23 views

-bash: ./configure: Permission denied and chmod: changing permissions of 'configure': Operation not permitted

I try to run ./configure to install fftw 3 and the output is -bash: ./configure: Permission denied and then I try to change the permission using chmod +x configure on the directory but the output is ...
0 votes
0 answers
34 views

Reload user groups without reboot and without ugly hacks for use in a bash script

The /etc/sudoers.d/user1 file contains: %user1 ALL=(user1) NOPASSWD:ALL Which using the sudo command grants all users of the user1 group (%user1) to login to the user1 user (ALL=(user1)) without the ...
1 vote
2 answers
71 views

How to tail multiple gz files

To tail multiple log files, I use: tail /path/to/logs/*.log To tail a zipped log file: zcat /path/to/mylog.1.gz | tail But I'd like to tail multiple zipped log files since the output of the ...
1 vote
1 answer
45 views

Special character password variable from bash to expect block is not working

I have been struggling with this issue for a few days now. I have scoured the internet for a solution and tried many different methods but none seems to be fruitful so far. I am passing a password ...
  • 13
1 vote
2 answers
64 views

Couldn't able to store a output of awk command

I have been trying to print git clone progress on more minimalistic way for my project. Aim Instead of printing a whole git clone output on screen remote: Enumerating objects: 1845678, done. ...
0 votes
1 answer
32 views

Using redirection to write a command using a file

I´m starting to use Ubuntu as my secondary OS and I´m creating a script which writes the current IP configuration in a file using redirection (with the command $sudo ifconfig -a > /etc/scripts/...
0 votes
0 answers
48 views

A very weird "command not found" error in Ubuntu 20.04.5 LTS appeared in the bash terminal

In Ubuntu 20.04.5 LTS, using bash, I got a very weird "command not found" error when entering command from the terminal: sudo apt install strongswan strongswan-swanctl The response from the ...
2 votes
1 answer
169 views

Configure bash instead dash on Ubuntu 22.10

On a brand new Ubuntu 22.10 installation I tried the command sudo dpkg-reconfigure dash That he did nothing I learned from this post that this feature has been removed. So what is the right and clean ...
1 vote
1 answer
32 views

What is executed?

$ which -a chia /usr/bin/chia /bin/chia $ ll /bin/chia lrwxrwxrwx 1 root root 49 janv. 9 08:40 /bin/chia -> /opt/chia/resources/app.asar.unpacked/daemon/chia* $ ll /usr/bin/chia lrwxrwxrwx 1 root ...
0 votes
1 answer
66 views

kubuntu 22.04 (.iso downloaded via kubuntu.com) broken? apt upgrade as well?

on a system freshly installed (eventually) with a months old version of Kubuntu 22.04 LTS, 'apt upgrade' after 'sudo su -' does NOT work for me : ~# cd /var/www -bash: cd: /var/www: No such file or ...
1 vote
1 answer
102 views

Which binaries should be available for the user to change password via ssh

I have a user that has a rbash as default shell (in order to limit his privileges). I also changed his default bin directory to cut-off most binaries from his PATH. User should time to time change his ...
-2 votes
0 answers
27 views

How to track everything related to Ubuntu Package [duplicate]

which curl : /usr/bin/curl whereis curl : curl: /usr/bin/curl /opt/lampp/bin/curl /usr/share/man/man1/curl.1.gz whereis is better than which but still ignoring my two curlcr config in : mg@mg-PC~/....
-1 votes
0 answers
21 views

How to close a specific firefox profile by terminal

If I have multiple instances of Firefox opened (Profile 01, Profile 02, etc.), is it possible to close a specific profile by terminal? What I'm doing is a script that opens the firefox 01 profile and ...
0 votes
0 answers
11 views

Visual Studio Code for Ubuntu unable to run C# code

I installed Visual Studio Code a few days ago and installed the Bash Debug extension. Today I installed C# and it seems to have gone well. I am trying to run a simple HelloWorld program. Every time I ...
  • 261
3 votes
1 answer
60 views

set -e subshell doesn't exit on the first command that fails if I capture the error code of the compound command using "||"

I have a script.sh and I have to correctly diagnose any errors inside it, so the prova function in case of an error shouldn't stop midway but should continue to the end reporting its error message. To ...
0 votes
2 answers
46 views

Ubuntu 20.04 @reboot cronjob doens't run script

I have a vultr server in a ubuntu so 20.04, i'm creating a bash script in the following dir /startupscripts/apilibro Inside of the script i need to start my directus server running yarn directus ...
1 vote
1 answer
43 views

What is the difference between `$HOME/bin` and `$HOME/.local/bin` ? When to use use one over the other?

According to this post, $HOME/.local/bin is used to store user-specific binaries. But I see in this post that $HOME/bin serves a similar purpose. What am I missing? When should I use one over the ...
  • 113
-1 votes
0 answers
29 views

Ubuntu 22.04 Server - Problem in my bash script. Program version

I'm learning bash but know too little to make a script that I need for my purposes. The script is to show the program versions: That is: Python: 3.11.1 Apache: 2.4.52 PHP: 8.1.2 MariaDB: 10.6.11 ...
0 votes
1 answer
63 views

Allow restricted bash users to run specific python script

I need to allow a particular user to run a specific python script. This user has access to a restricted bash which for now allows only the clear command. Usually, the script would be run through ...
0 votes
1 answer
34 views

How to print the manual of gzip program

I am new to Linux and I need to print the manual of gzip program but I am not able to figure it out. I have written the command man gzip but I am not sure whether it is reading or printing it. I am ...
2 votes
1 answer
54 views

Passing "flag" Arguments to Systemd Services

I have a Systemd service that calls a script. That script takes it's own arguments, some of which are named arguments. I currently have the following service: [Unit] Description=My Service ...
1 vote
0 answers
32 views

Why does executing this shell script shut down my system?

Ubuntu 22.04.1 LTS Was trying to install Pycharm without using snap. I navigated to the bin folder and then: chmod u+x pycharm.sh followed by: sh pycharm.sh My system instantly shut down within ...
1 vote
1 answer
39 views

How to generate multiple files in sequence with data in sequence?

I have to create 50 files in sequence labelled r01.inp to r50.inp and in each file I need this text in sequence as well. #!/bin/bash abc2 r01.inp > r01.log I used echo and touch to create the 50 ...
1 vote
1 answer
22 views

'.*' regex properly not functioning in ubuntu of wsl

There was a file with the following text: foo bar baz bar foo baz baz foo bar bar baz foo foo baz bar baz bar foo I needed to get the 1st one foo bar baz and the 5th one foo baz bar as the output to ...
-2 votes
0 answers
41 views

xdotool script configure infinite loop

I'm trying to configure a xdotool script to run following tasks: Select Active Window X - where X is a game client Click 1 in a specific spot [100px area] Press enter Wait 30 seconds Repeat The ...
0 votes
0 answers
30 views

bash script not outputting information to a separate file

The idea of the script is that it enters the switch, enters the username and password. Enters the show command. And redirects the output of this command to another file. But, perhaps, something is not ...
0 votes
0 answers
11 views

Not able to login due to messed up bash file [duplicate]

Recently I added java home variable in PATH and after restarting I got into a loop of login where I couldn't login while I try to use the terminal am not able to use any commands it says it is not ...
9 votes
3 answers
1k views

Why is `$(git branch)` outputting all files' names inside folder (besides git branches)?

I wrote a command to delete all git branches without needing to write them all mannually, which is currently like this: git branch -d $(git branch) It does what I want, but also tries to delete ...
3 votes
1 answer
81 views

Bash completion not working in subshell

When I start a bash subshell (by calling bash from my command prompt), all tab completion stops working. The complete command becomes empty in the new shell: $ complete [...] complete -F _apport-...
  • 197
2 votes
1 answer
41 views

exclude files that have specific characters in name

here is my command to find files in a specific location and with specific extensions only, it works fine. But I want to exclude files that have '_bkp' or '_backup' as a substring in their file names - ...
  • 219
1 vote
0 answers
32 views

Storing pactl name to variable by using alsa.name

I'm having an issue where my RPI using ubuntu 20.04 sink cards change card # between boots. I was thinking to remedy this, I can create a bash script to get each card Name and it’s associated also....
  • 11
2 votes
1 answer
102 views

Syntax error in While loop

Here is my code - #!/bin/bash find FileFrom -type f -name "*" > prodRefresh.txt filename="prodRefresh.txt" while read -r line; do name=$line echo "Name read from ...
  • 219
6 votes
2 answers
2k views

Syntax error: "(" unexpected

While executing the below command directly over the terminal, its working fine: comm -2 -3 <(sort FileOne.txt) <(sort FileTwo.txt) > myFile.txt But while trying to execute it via .sh file, ...
  • 219
1 vote
1 answer
92 views

Fix error: Cannot autolaunch D-Bus without X11 $DISPLAY on script to change wallpaper using systemd

Background I have created a script that changes my wallpaper periodically. The script works perfectly fine when I run it from bash, but having to manually run it on every startup is becoming annoying, ...
0 votes
0 answers
22 views

Proxy working in CLI but not with Chrome

I purchased a proxy and whilte-listed my server's IP address so that my server can connect to proxy without authentication. Its working fine in Ubuntu CLI, but when I open Chrome, it cannot connect to ...
0 votes
1 answer
46 views

How can I use bat command as an alternative to tail command?

I love the syntax highlighting of cat. So I want to use it as an alternative to tail command. But I cannot find a generic way to accomplish this. But I can use this command as an alternative to tail ...
1 vote
2 answers
99 views

How to use yad to terminate application

I want to use yad system tray notification to terminate an application (vlc for example), I used the following code: yad --notification --no-middle --image=emblem-warning --menu='Cancel ! kill $pid' --...
3 votes
2 answers
111 views

is there a command to stop listening to a usb device?

I made a harmonograph (Drawing machine to draw Lissajous curves). Its an analog machine with a digital component. The analog portion is non interruptible. the digital component is a drawing tablet, ...
  • 14.1k
0 votes
0 answers
18 views

bash handles comments sometimes as commands in regards to writing to history list, what can I do?

I have now by updating got a new version of bash, instead of v590 now v5.2.15(1) (i681-pc-linux-gnu) in Kubuntu 20.04 and KNOPPIX 9.1. But in this respect the behavior is the same. Bash manpage says, ...
0 votes
1 answer
28 views

when sourcing a bashrc how to get the line number of the error messages

Following this post, I am souring a bashrc file inside the WSL2/Ubuntu by: source /usr/share/openfoam/etc/bashrc but I get lots of error messages: -bash: /usr/share/openfoam/bin/<someFile>: No ...
  • 803
0 votes
0 answers
24 views

Custom protocol handler for Firefox can't start gnome-terminal

I want to open ssh:// links from Firefox with script that opens gnome-terminal and initiates SSH connection. Script works as intended when run manually but not if run from Firefox. I use script found ...
  • 1
0 votes
0 answers
18 views

can we display some characters (ex: *****) when typing / changing the password [duplicate]

Just want to know whether is it possible to display some character when typing the password, unknowingly if we enter some other character and want to delete, it is quite confusing and need to enter ...
1 vote
1 answer
83 views

whats wrong with this cron job?

I set up a cron job to write a webpage every 50 minutes, but then I looked at the web page, and its blank. The cron job: 50 * * * * mkIndex.sh > /home/user/img/index.html mkIndex.sh is a script I ...
  • 14.1k

1
2 3 4 5
218