Questions tagged [bash]

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

2,570 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
1 vote
1 answer
418 views

Is there a shell script that helps identify the non-system related files to backup?

Is there an application or script that will identify all of the distribution/system files? My ultimate goal is: I would like to automate backups to a secondary/alt sec Linux machine, but I would like ...
monksy's user avatar
  • 1,731
1 vote
2 answers
1k views

Extract URLS from code statements in JS files

All, I want to extract all URLS mentioned in code statements in all js files in a folder. For e.g. if a js file contains this piece of code: var myURL="http://yahoo.com/signup" //var myURL="http://...
smokinguns's user avatar
  • 1,428
1 vote
0 answers
195 views

aescrypt doesn't function with pv in pipeline

I am writing a bash script that pipes a file through pipe viewer to watch encryption progress. However, whenever I use aescrypt in the pipeline with pv, I get an error about not matching passwords. If ...
Patrick's user avatar
  • 143
1 vote
1 answer
314 views

cygwin - bash can't find file depending on arguments

If I type bash -i release_script.sh it starts processing the script If I type bash --login -i release_script.sh I get the error: bash: release_script.sh: No such file or directory I don't ...
Mr. Boy's user avatar
  • 5,256
1 vote
1 answer
1k views

How to add bash-completion to user www-data?

when logged in as user 'www-data' on my debian server (squeeze) i want to use bash-completion. I follewed this guide, but i doesn't succeed: it is working for all regular users but not for www-data! ...
Madamadam's user avatar
  • 115
1 vote
1 answer
975 views

Bind CTRL+W to werase (default bash behaviour in Linux/PuTTY) in iTerm2

I use a Mac at home and have changed my modifier keys swapping Command and CTRL, so CTRL+T spawns a new tab in chrome, CTRL+C is copy and so forth. I use Windows/Linux at work and I want a consistent ...
Greg K's user avatar
  • 358
1 vote
1 answer
726 views

Alter bash tab completion to make it more like zsh

I'm on a Mac and the cp and mv commands are killing me due to them copying the contents of a directory if a trailing slash is present. It has bitten me more than once when I use tab completion to ...
intargc's user avatar
  • 121
1 vote
1 answer
2k views

Encrypting using DES 64-bit with openssl

I'm trying to do a very simple thing, namely using a 64-bit password and a 64-bit plaintext (both in hex) and encrypt it with simple old DES. my script looks like this: plaintext=`echo -n "$2" | sed ...
Xander Tulip's user avatar
1 vote
0 answers
1k views

Vim shell bindings (set -o vi) on iTerm2

Trouble with history when using bash vi bindings on iTerm2 on Lion. (I had the same problem with iTerm when I switched to Lion.) Hard to explain exactly, but when I hit k to go to most recent command,...
mahemoff's user avatar
  • 1,063
1 vote
0 answers
121 views

script -e and crontab or at

I have a shellscript I want to run via at and use script to capture a transcript. script -e was introduced in util-linux-ng 2.18 and returns the retval of the child process. I want to capture the ...
COMPUTERUSER's user avatar
1 vote
1 answer
169 views

Formatting my $PS1 to x amount of character

I'm looking for a way to force my PS1 variable to a certain number of chars. It currently looks like: $PS1="\W $" and I'm trying to keep the same number of characters regardless of the length of ...
cmwright's user avatar
  • 123
1 vote
1 answer
2k views

BASH: How to best filter directories of files for a certain date range in the filename?

Here's the picture... Date format: Y%m%d%H%M%S% This is my filename format: file_sub1_20110501000000.txt Directory structure: dir/ sub1/ file_sub1_20110501003000.txt ...
Matt's user avatar
  • 11
1 vote
2 answers
1k views

RHEL6 Crontab doesn't work properly?

In RHEL6 root's account I have crontab job: 30 6 18 4 1 /sbin/init 6 It worked fine on the 18th of April and properly restarted my system, BUT it also restarted my OS at 6:30 on next Monday - ...
user avatar
1 vote
1 answer
155 views

Default folder from which commands execute

Once I upgraded to Maverick Ubuntu, bash shell in gnome-terminal starts by default at root rather than my home directory, this was easily fixable by adding a cd command in .bashrc. However, this is ...
Harshavardhan's user avatar
1 vote
1 answer
521 views

Subversion URL bash completion

I found the below script and sourced it correctly, and it successfully bash completes my commands, but isn't working for my URLs. I'm using OSX Snow Leopard and 3.2.48 and I've been using the normal ...
Scott Schulthess's user avatar
1 vote
1 answer
482 views

How can I automate or script daily downloads for any new anti- virus databases, and then have the program scan my drive?

(I know there are much better softwares out there for the Mac so please don't go there! The politics of this company dictate which Anti virus we have to use) Anyway without any further wait: ...
Macgrimm's user avatar
1 vote
1 answer
332 views

libreadline history lines combine

This has been driving me crazy for about three years. I don't know how to fully describe the problem, but I think I can finally describe a way to recreate it. Your milage may vary. I have a mixture ...
jettero's user avatar
  • 123
1 vote
1 answer
214 views

bash starts replacing the characters on the current line insead of moving over to the next line

I use bash shell $ bash --version GNU bash, version 3.2.25(1)-release (x86_64-redhat-linux-gnu) Copyright (C) 2005 Free Software Foundation, Inc. $ Sometimes, when typing a command on the prompt ...
Lazer's user avatar
  • 17.7k
1 vote
3 answers
270 views

Read everything that has been echo'd and 'errored' to terminal window?

I've inherited a complex shell script running on OSX that gets run on a crontab. Within the script I would like to periodically read everything in the terminal window and write it to another file... ...
Topher's user avatar
  • 11
1 vote
1 answer
1k views

Writing a bash shell script for website backup

I am about to write my first shell script for backing up my server. These are the steps I have identified so far. Copy files to be backed up to /srv/backup/ run mysqldump and copy the file to srv/...
morpheous's user avatar
  • 4,343
1 vote
0 answers
119 views

Using gxine_client to get and set value playlist.repeat for running gxine

I would like to know how to use the gxine javascript interface from bash shell. I want to have a bash shell script read out value of running gxine, set things like playlist repeat/loop option, ...
user42723's user avatar
  • 161
1 vote
2 answers
555 views

Moving symlinks into a folder based on id3 tags

I'm trying to get my music folder into something sensible. Right now, I have all my music stored in /home/foo so I have all of the albums soft linked to ~/music. I want the structure to be ~/music/<...
Reti's user avatar
  • 131
1 vote
0 answers
552 views

user crontabs don't work, only /etc/crontab

Hi when I use the command crontab -e to set up cron, the commands get triggered (according to syslog) but nothing happens. Also if I run sudo crontab -e. The only way to actually get cron working ...
gletscher's user avatar
  • 373
1 vote
1 answer
3k views

How do you make .sh files open with Windows Terminal Ubuntu?

I really like coding in bash, but there used to be many limitations of bash functionality in Windows. Though now there are many benefits to the bash windows users now rather than how it was pre ...
Nationalism's user avatar
1 vote
1 answer
124 views

Date formatting only available as root

I have a really weird behavior on both my RaspberryPi 3 and OrangePi 3 after upgrading them to Debian 10. The date command works but I can't set my own formatting with a non-elevated user: baprx@...
BapRx's user avatar
  • 11
1 vote
1 answer
810 views

bash on windows 10 runas netonly not asking for password

I prefer to work from Linux, but my workplace forces me to use Windows. I'm moving my workflow to BASH in Windows, to achieve a golden middle ground. My problem is launching SQL management studio ...
Stefan Finseth's user avatar
1 vote
3 answers
8k views

Starting script in screen with cron

I apologise if this has been asked before but I am not sure how to question a search query for this. I am extremely new to linux and I have been learning as I go to solve issues. I am trying to set ...
TheAngryBr1t's user avatar
1 vote
1 answer
1k views

Get the Group name which has GID=0

I wanted to write a shell script in which it needs to give the group name whose GID=0.I used awk command like this, awk -F ':' {$3==0} /etc/group | cut -d ':' -f1 It works fine in redhat,aix.But not ...
user1507's user avatar
1 vote
2 answers
589 views

Rename file names based on a pattern in Linux

I have a lot of data with file names like this: combination.2005.0801.txt combination.2005.0802.txt ... combination.2005.0830. txt What should I do if I want to rename that files to be like this? ...
ahmad's user avatar
  • 31
1 vote
2 answers
893 views

Find unique files across 2 drives

I'm trying to compare 2 volumes, which mainly have the same content, but in completely different folder structures. (Around 2 million files.) I want to see which files are ONLY in 1 folder, not the ...
d0g's user avatar
  • 2,280
1 vote
1 answer
1k views

sfdisk partition size in bytes

Kind of homework related so further reading is always appreciated! Using sfdisk I have to specify the size of certain partitions in bytes. For this I used sfdisk -lub /dev/sdd Which lists the ...
user avatar
1 vote
1 answer
477 views

Can I connect to an AP with Aircrack Suite and if yes how?

How can I connect to my WPA2 secured AP with aircrack suite?
JohnnyFromBF's user avatar
  • 4,938
1 vote
2 answers
433 views

Applescript won't move onto next instruction without ending shellscript?

I'm a new user to Applescript and programming in general. I'm trying to create a script that will 1) load a Renpy project through the terminal and 2) then move the resulting project window to a ...
Emerfin's user avatar
  • 19
1 vote
2 answers
2k views

automatically starting GUI program on startx

I have GUI code written in PyQt in main.py that I want to start up automatically after startx starts. I've already configured my beaglebone (Debian) to run startx on power up. I initially included ...
avelampudi's user avatar
1 vote
2 answers
4k views

How can a file be removed and then “cp” can't write it?

I have a part of a bash script, which I am executing as root: rm -f ../../include/profile.h; \ cp profile.h ../../include/profile.h the file ../../include/profile.h in question has permissions: -rw-...
user322908's user avatar
1 vote
1 answer
2k views

linux: monitor logfile for a string and execute script

I want to monitor a logfile (syslog) on my linux debian box. So if there is a new entry with a secific string, i want to execute a script. The strings are "alarm start" and "alarm end" So it should ...
whopperg's user avatar
0 votes
1 answer
15 views

I'm getting on gitbash a warning WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED! for github

When I try to clone a git repository in gitbash on Windows I get following error: $ ssh -T [email protected] @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ @ WARNING: REMOTE HOST ...
Asterios Raptis's user avatar
0 votes
0 answers
21 views

How to match PDF okular colors with Terminal colors?

OS: Kubuntu 22.04.4 LTS x86_64 okular 21.12.3 konsole 21.12.3 to display above: neofetch --stdout |grep 'OS:' okular -version konsole -version outputs: ok match color Blue in Terminal with ...
joseph22's user avatar
  • 357
0 votes
0 answers
52 views

Can you write a script that contains both bash (or sh) and powershell (or cmd, bat) so the same file can be executed on Win and *nix?

I have a script that needs to run on Windows, Linux and MacOS. I know Windows determines how to run a script by using the file extension, where *nix will use the #!. I'm hoping there is enough syntax ...
David Alsh's user avatar
0 votes
0 answers
45 views

Failure to use `/dev/pty` for one outside msys2 `bash` when calling it in `vim` installed inherently by git-bash

Env: Windows 11 pro. I want to call msys2 bash in git-bash's vim where both shares the same version of vim and bash (although this context seems to be weird). I asked one origin question in Vi/Vim SE ...
An5Drama's user avatar
  • 141
0 votes
0 answers
23 views

How to launch another blank terminal in Kali Linux?

When I launch another terminal in Kali Linux with Cmd+Shift+T, I can see Shell No. 2 tab created. However, it is just a copy of Shell No. 1 and all the commands I ran on Shell No. 1 are visible on ...
kerblue's user avatar
0 votes
0 answers
13 views

How to read from a kwallet map per kwalletcli?

I try to use kwalletcli to access a password in a bash script. I know how to access ordinary passwords. But in the kwalletmanager GUI tool there is another kind of entries which is called Maps. Look ...
stollr's user avatar
  • 202
0 votes
0 answers
33 views

how to use curl for single sign-on website or page

I've already written a shell script but it's not working. I'm getting an empty response whereas it should first return a token and also it should login then register the API. That's the task which my ...
DevOPs's user avatar
  • 1
0 votes
0 answers
36 views

Split pdf into separate files based on keywords

I work in an organization with a Purchasing dept. that processes a lot of POs. When they "print" a PO job to pdf, the resulting pdf can have pages for one or more Purchase Orders. For ...
reebo's user avatar
  • 1
0 votes
0 answers
15 views

docker compose down service with label

I'm trying to figure out how to programmatically compose down several services with a label. Currently I'm just using docker container stop as such: docker container stop -t 60 $(docker ps -q -f "...
Modem7's user avatar
  • 1
0 votes
1 answer
60 views

Broken pipe, write error: An epidemic of unnecessary output

In the last few months, a problem has been spreading across my systems. That of broken pipe errors: # Solution: # silenced by replacing /bin/bzip2 -> bzip2-reference # to /bin/...
Hincor's user avatar
  • 1
0 votes
2 answers
125 views

How to output a bright Green check mark?

OS: Kubuntu 22.04.4 LTS x86_64 to display above: neofetch --stdout |grep 'OS:' Terminal or bash script: printf '\u274c\n' # works fine. Bright red X. ❌ printf '\u2714\n' # outputs a check mark, ...
joseph22's user avatar
  • 357
0 votes
1 answer
34 views

Bash script error issue with Debian preseed dpkg-configure string

I am working on some bash scripts to configure various packages the way I need them. When installing Debian 'unattended-upgrades' normally one of the user intervention required is to run *user@...
trebonedoow's user avatar
0 votes
0 answers
34 views

Unsing ranger fm, how can I preview a file's thumbnail

I have images in HEIC format on my Synology NAS. I installed ranger in a docker container, and I can preview most videos and images (connecting using iTerm on mac), but HEIC is not supported. Synology ...
Adi's user avatar
  • 131
0 votes
1 answer
36 views

How to insert argument separating space into brace expansion preamble?

I want to use brace expansion to generate the following argument sequence: ./some_command -c root.foo -c root.bar -c root.baz. Brace expansion at first glance looks as a perfect tool: use -c root. as ...
Ivan Smirnov's user avatar

1
18 19
20
21 22
52