Questions tagged [bash]

Bash is a free shell for Unix-like operating systems from the GNU Project.

Filter by
Sorted by
Tagged with
0 votes
0 answers
13 views

PowerShell command makes windows loop

I've installed today Screenfetcher module for Windows - as follows: PS D:\INSTALKI\ScreenFetch> Find-Module -Repository Local Version Name Repository ...
  • 1
0 votes
1 answer
18 views

Why am I getting an error in my Bash script?

Wondering if someone could take a look and I keep getting errors when trying to execute this script. Can someone tell me the possible reason is? Error /volume1/Cameras/bv2.sh: line 5: syntax error ...
0 votes
0 answers
14 views

UNremovable files/directory

opensuse leap 15.4 on asus l210 I have unreadable/unremovable files on a usb fs. Could someone kindly explain the following sequence of commands, and what I might do to get rid of the problem? /media/...
0 votes
0 answers
14 views

Running shell script with find command returns double slashes in file paths

I have cobbled together an Applescript that returns a list of the full posix filenames of all of the files in a directory (and all subdirectories). It runs the 'find' command in a shell script. The ...
2 votes
0 answers
28 views

How to automatically refresh the Bash prompt every second?

As far as I can see, the user must press Enter in order to update PS1, PROMPT_COMMAND, etc. Is there some way to automatically update PS1 and have it get displayed on the screen (without messing up ...
1 vote
0 answers
23 views

Can't figure out how to add padding to left side of Ubuntu 20.04.5 CLI in WSL 2(On Win11)

Posting here with updated detail after posting on AskUbuntu as user @NotTheDr01ds had a great answer but unfortunately it did not accomplish what I was hoping to accomplish. I installed WSL 2 and ...
  • 111
0 votes
1 answer
6 views

Changing bash PS1 colors ruins bash command line [duplicate]

Hi I am using Fedora 37 and came across next problem. Adding export PS1="\e[43;39m[\t]\w\r\n[\u@\h]\\$\e[40m \[$(tput sgr0)\]" to my .bashrc file in /home/username in my case led up to this ...
user avatar
0 votes
1 answer
25 views

PATH env only valid for user creating this entry?

We encountered a strange behaviour with /etc/environment and PATH variables. An extension like export PATH="/opt/poetry/bin:$PATH" is only valid for the user who creates this. Workaround is ...
  • 61
0 votes
2 answers
23 views

Does htop have a bug in the display of process status and memory consumption?

When running a few processes, I noticed that htop showed certain process as consuming CPU, but yet were marked S in the State column (the S column)...which meant that the processes were sleeping or ...
  • 1,019
-1 votes
1 answer
23 views

Script to Find and Resample Audio via FFMPEG Fails on Files with double quotes

Why does this script explode when file names contain double quotation marks? for i in **/*.flac; do echo "$i"; done | parallel -j+0 --eta --joblog /tmp/parallel.log --progress --bar --...
0 votes
1 answer
18 views

How can I watch a windows folder from my Ubuntu VM know which file has changed?

I need to know which files have been updated in a Windows folder from my Ubuntu VM. I have a symlink of the folder I want to watch. What I found that is the closest to my needs is this python program ...
0 votes
2 answers
66 views

Shell script in Mac Automator won't work with folders

I am creating a service in Mac Automator which is basically a bash script to change some dcm files with dcmodify. Whenever I run it on a single file it works flawlessly, but when I try to run it over ...
0 votes
0 answers
15 views

File auditing in macOS - check which process deleted a folder/file

After macOS minor upgrade of Monterey I've noticed that a directory of mine has been deleted. is there a way to check in retrospect which process deleted my directory ? I know of fs_usage, but it's ...
  • 153
1 vote
1 answer
33 views

How to send post request to a discord webhook via CMD

I have been trying to send post requests to a discord webhook for around an hour now but can't seem to figure out how to do it. I want to send this: { "content": null, "...
0 votes
0 answers
12 views

apt-get -y install build-essential [closed]

I am writing bash script for vps server. I got this problem: I need to install the build-essential package by script. I coped with the problem (yes / no), found the -y switch for apt-get. But here's ...
user avatar
0 votes
0 answers
17 views

Is there a way to get Notepad++ to spellcheck a heredoc?

I love the spellchecking I have with Notepad++ DSpellCheck, but it doesn't spellcheck bash heredocs. Is there a way to change this behaviour?
  • 572
0 votes
1 answer
26 views

Startup script for Rock 4 SE running Debian

I am trying to run VLC player with a url as input when my Rock starts. I have created a unit file called startup.service and put it in. /etc/systemd/system/startup.service It looks like this: [Unit] ...
  • 101
5 votes
1 answer
615 views

sending print string command to remote machine

I'd like to print some string to all open terminals processes that are running in remote machine. currently I'm using ssh to connect the remote machine, and than I echo my string into wall command : ...
  • 153
1 vote
0 answers
15 views

wget and curl switch default to background task

When I use wget and curl from bash, it automatically switches to a background task by default, without me having provided the required arguments. This is making it hard to use these commands in ...
0 votes
1 answer
17 views

How can I create a symbolic link of a file in another directory with relative path?

THE PROBLEM I'm developping an ai training app. The app uses docker and some folders are shared (mounted). Absolute paths inside and outside docker differ, and I need to create symlinks that work on ...
0 votes
0 answers
27 views

Ubuntu 22 - zsh: command not found: lessc

OS: Ubuntu 22.04.1 LTS zsh 5.8.1 (x86_64-ubuntu-linux-gnu) Before installing oh-my-zsh everything worked, now I have issues. One of the issues is zsh: command not found: lessc, but who knows how many ...
0 votes
0 answers
25 views

How to pipe a user input after a command

I'm trying to automatize the call of the library ADB to connect to android. The command pair ask to user for a code, so I was thinking if there is a way to do all in the same call. C:\Android\sdk\...
0 votes
1 answer
34 views

What is the difference between “base64 -b0” in macOS versions prior to macOS 13 (Ventura) and “base64 -i” in macOS 13 (Ventura)?

Up until I recently upgraded to macOS 13 (Ventura) I could run this Bash command to convert a JPEG image into a Base64 string in a script I occasionally use: IMAGE_BASE64=$(base64 -b0 /path/to/image....
0 votes
1 answer
21 views

how can I convert svg xml code to image, using bash script in linux

I have a xml file which is xml code of captcha image. how can I convert it to regular image in bash script. <svg xmlns="http://www.w3.org/2000/svg\" width="150\" height="...
  • 3
0 votes
0 answers
24 views

Globally store all command line / bash / windows terminal input and output into text log files

I am looking for a global and automated way to always log all the input and output of all of the command line windows I am using into text files. I am using 3 types of console on Win 10 - git-bash.exe,...
  • 143
0 votes
0 answers
19 views

Bypassing bastion idle timeout : Session stopped

I'm forced to work through bastion to connect to the servers I work on. that's fine but the idle timeout is ridiculously small and it totally ignores the ssh keep alive of the client. I can't change ...
  • 11
0 votes
0 answers
12 views

What is saving environment variables across logins? Using GDM to log in to a Gnome Wayland session (ver 43.1) on Debian Testing (19 Nov 2022)

I am on Debian Testing using GDM to log in to a Gnome Wayland session. I observe that the gdm-wayland-session process runs a shell script called /usr/bin/gnome-session, passing it "-l", ...
0 votes
1 answer
25 views

Get output logs of previous command in ZSH

I'm working on a helper script that needs to run after every command to analyze its exit status and output logs. I understand that stdout/stderr buffers are not stored on pseudo terminals. I therefore ...
0 votes
3 answers
63 views

Remove the lines before and after the exact match - linux

I have a file like this in /etc/test/host.conf : # this is a test host = example.com private = 192.168.1.1 # end of test # this is a test host = example.com private = 192.168.1.2 # end of test I ...
0 votes
0 answers
16 views

discard buffered output when displaying binary file by mistake

It happens that I send by mistake the content of binary files to the terminal. Eg: I run a cat file or curl http://some.url/ when I was expecting the result to be plain text. In such cases I need to ...
  • 343
1 vote
0 answers
36 views

Is there a way to print a commands stdout/stderr only after a given 'timeout'?

Imagine a command which usually takes less than a second to complete an in this case you don't want to get bothered with verbose output, but sometimes it takes longer and in that case you want to have ...
  • 997
0 votes
2 answers
44 views

Setting environment variables in bash script doesn't work?

If I run this on the command line, it will make the commit be at the specified date: THE_TIME='2022-01-01T22:50:12 -0700' GIT_AUTHOR_DATE=$THE_TIME GIT_COMMITTER_DATE=$THE_TIME git commit -am 'commit' ...
0 votes
1 answer
14 views

Git Log of a particular file from a particular commit only

git log --graph --decorate --pretty=oneline --abbrev-commit --patch --full-history --follow -- "${FileP}" prints * b8800d8 (HEAD -> master, origin/master, origin/HEAD) chore(export): ...
  • 353
1 vote
1 answer
22 views

Separate file path from command in Bash under WSL2

Is there a way to separate the file path from the commandline in the Bash prompt in WSL2? For example: Current: user1@DESKTOP-RMF1234:~/mywork/helloworld/tests$ ls Expect: user1@DESKTOP-RMF1234:~/...
  • 127
-1 votes
0 answers
26 views

How to command a 4 word search?

Using Kubuntu 22.04.1 : neofetch # OS: Kubuntu 22.04.1 LTS x86_64 grep --version # grep (GNU grep) 3.7 What is the Terminal command to do a 4 word search? Objective search 1000s of files ...
  • 115
1 vote
2 answers
60 views

Is there a way to extract subtitles from an MKV while maintaining the original format?

I am trying to extract (first, in case of many) subtitle track from mkv files (via CLI only, no GUIs) using ffmpeg or mkvextract. But there is one downside to this: I have to write the output name ...
0 votes
0 answers
27 views

Execute a bash script with a shortcut on Ubuntu

I've a problem, I'm trying to execute a script whith shortcut on Ubuntu but it doesn't work: enter image description here enter image description here Can you help me please ?
  • 1
0 votes
0 answers
35 views

How to copy file of env variable to another file

I am executing bash commands inside a yaml file. I have set an env variable SECRET which point to a yaml file in my home directory, and I want to copy the content of this yaml file to another file, as ...
0 votes
0 answers
10 views

Redirect Error Messages for SFTP

I'm sftp to a server and I would like to download the files and all the info are redirected to a file. I have a bash script to do this, and it works great but when I get error messages, for example, ...
0 votes
1 answer
12 views

FFMPEG MultiPlex all video's to all audio's

(windows 10 64) I have seen & read MULTIPLE (50+) answers to forms of this question but not for what Im trying to do. I have a folder with 30+ short clips (few seconds each) mp4's I also have a ...
0 votes
1 answer
16 views

Starting ssh-agent from a script for use in multiple scripts (invoked by git)

I have some homepages in a git repository each. They are built by Jekyll. When I change something, I use git's pre-push hook to let Jekyll build the page and sync it with my HTTP server via rsync. ...
0 votes
1 answer
33 views

Bash alias based on conditional

I want to create a bash alias called pg to use a pager program based on a condition. The condition is: If most is present then use it, otherwise use less. This is what I have so far: alias pg='command ...
0 votes
0 answers
13 views

Find out the source of an installed CentOS Linux package, assuming chef and dnf install packages (system managed by chef)

The TL;DR here is if I have a command "checker" installed in a bash shell on a CentOS Linux server, is there anyway to easily find what package/source installed it to check what that package ...
-2 votes
0 answers
18 views

How to find and replace a line (in a file) which has / as a special character in it in shell script

How to find and replace a line(in a file)which has / as a special character in it in shell script? EX: If I have a.txt file cat a.txt has the following: abcfads <p name="myself">1889&...
  • 1
12 votes
2 answers
2k views

Why doesn't this unzip all my files in a given directory?

Why doesn't this unzip all the zip files in a given directory? find -name "*.zip" -exec unzip {} + \; Instead I get "caution: filename not matched:" for each matching item
  • 121
1 vote
2 answers
36 views

linux cp current directory level only

I have a dir that contains files and subdirs. I want to copy files in the dirs only, so I run cp -v src/* dst/ and get error cp: -r not specified; omitting directory. I'd be ok to ignore it but the ...
  • 852
0 votes
0 answers
3 views

Deploy Group Policy for Folder Redirects via Windows Script on Windows Server

GP via Script Is there a possible way to Deploy a group policy for folder redirects instantly working on the local active directory domain via a script? The script should create a new GP and set the ...
  • 1
0 votes
0 answers
20 views

I cant get the file to be read

I am trying to get the the read command to read from the file and put it in a directory. shellcheck says the program is fine, but I keep on getting a "bad file descriptor" message, and it is ...
0 votes
1 answer
21 views

How to ssh into a remote machine by passing through multiple bridges machines, become another user and run a command as that user

I need to save in a variable on my local machine a value that is returned from a script or command - let's take bash /tmp/script1.sh for the example - which lies on a remote machine - let's say ...
  • 162
0 votes
1 answer
41 views

How can I run a bash script everytime I open my terminal? [duplicate]

I want to run a bash script every time my terminal opens. I'm kind of new to Arch Linux, so I'm not an expert on it. How can I do this?

1
2 3 4 5
226