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

learn more… | top users | synonyms

-3
votes
0answers
32 views

How Can I Find All The Script Files on My PC? [on hold]

The previous contents (referred to by one critic as being "My life's story"_ has been moved to file 000.txt at https://my.pcloud.com/#page=filemanager&folder=63120803 Now I am leaving the part ...
1
vote
2answers
5k views

How to auto commit to my git repository using cron?

I look into a lot of answers about this subject, but something is wrong here, let me explain. I create this script, to make my cron cleaner :) #!/bin/bash cd ...
0
votes
0answers
12 views

How to construct a proper command string in bash? Quoting issues, I think

I have a very newbie question, I am sure. I am trying to construct a script to edit the internal EXIF timestamps of a number of JPG photo files, using the commandline exiftool utility. My actual ...
1
vote
1answer
20 views

Prevent open -a Terminal.app from automatically exiting on Mac OS X

On my Mac OSX 10.9 Mavericks, I wrote a small bash script to open a log file for a terminal game application I'm writing so I can see print statements: #!/bin/bash printf '\e[3;0;0t' ...
0
votes
1answer
16 views

Alias command from terminal that opens a new terminal on a specific folder

I have this command already working in my .bash_profile: alias mysite='cd /Applications/sites/mysite;pwd; php artisan serve --port=9000 | open http://localhost:9000 | open -a Finder ./' So it: ...
0
votes
0answers
6 views

In elasticbeanstalk, can I ssh in and manually restart the (node) app?

I want to eb ssh in, stop the node app (not the entire instance), make a debug change, and npm start. When I eb ssh in I can inspect my files, and edit them. But I can't use the npm commands, and I ...
1
vote
1answer
20 views

unable to remove symbolic links of rsync copy of /bin and /dev

I accidentally made a rsync copy of my root directory, "/" using the -a option, as follows: user@mycomputer:~$ rsync -a / /backup-dir user@mycomputer:~$ ls -l /backup-dir/ total 10102784 drwxrwxrwx 1 ...
0
votes
0answers
16 views

Duration time between cycles in a log file

My apologies if this is too basic, but I have a log with this kind of information: Mai 5 12:34:00 xoengine XO[1287]: [Xo|xoengineMain.cpp:122|0xb88ec60] starting xoengine 4.0.1.2 (x86) from ...
0
votes
1answer
34 views

Bash autocomplete behaviour in Debian 8

On a new install of Debian 8 (Jessie) I have found that the autocompletion in bash, using the tab key, has changed. The test I did was: Open a terminal (in my case Konsole). Above the prompt it ...
2
votes
3answers
500 views

list multiple file types in bash for loop

I wrote a script that converts images in a folder. The script uses a for loop: i="1" for file in *.jpg; do outputFile=$(echo "image"$(echo $i)) convert "$file" -resize 50x50 $outputFile ...
0
votes
0answers
9 views

Running `pip` gives 'command not found' after successful Python homebrew install

To preface, I am very bad with the terminal, please be patient with me. when I run pip I get: zsh: command not found: pip I have installed Python 2.7.11 with brew, which should allow pip to work ...
13
votes
3answers
2k views

Escape non-printing characters in a function for a Bash prompt

In a Bash Prompt (PS1 variable), I'm calling a function to potentially add text to the prompt: export PS1="\u@\h \$(my_function) \$ " However, the function in the prompt contains ANSI color codes ...
1
vote
1answer
17 views

Looping through wildcard folders and executing multiple commands in Bash

I have a set of commands to change the contents of files called MenuSettings which work fine when directed to a folder. cd /Applications/snowflake/table-updater/Testing/Applications/Salford_100 sed ...
4
votes
1answer
41 views

Is it possible to suspend/restart a 'find' command?

Let's say I have a slow filesystem in which I would like to list all the files: find . -type f -printf "%p\n" Is it possible to launch this command in a way I can interrupt it, save the state and ...
88
votes
12answers
63k views

Is it possible to `tail -f` the output of `dmesg`?

Want to do something like dmesg | tail -f but it doesn't work: I use Mac OSX 10.6.7, by doing that the tail will exit, instead of monitoring the output. I wonder if there is any way to do it, or ...
0
votes
0answers
6 views

Setting proxy settings to Auto Proxy Detection using command line Mac OSX

Hi I want to know how to set the proxy settings to Auto Proxy Detection like in network preferences but using bash. I have tried looking around but I only am seeming to find commands like this ...
0
votes
0answers
25 views

How do I configure a Jenkins job to target a specific server to deploy to?

I am using two CentOS servers. I am not using any code repository. In Jenkins when I click "New Item," I see no place to enter the target server. I expect a place to configure a target server for a ...
0
votes
1answer
18 views

Why does du report different sizes for the same directory?

$ pwd / $ du -hs * 0 bin 8.2M boot 82M dev 23M etc 0 lib 0 lib64 16K lost+found 4.0K media 0 misc 4.0K mnt 0 net 106M opt 44K root 414M ...
13
votes
2answers
7k views

How to add more commands to Git Bash Shell

I am working on windows machine and I use bash shell which comes with git. But there are many utilities which are missing in this version of bash shell. How can I install more commands on this shell. ...
0
votes
0answers
9 views

Stop bash script with any key

I'm writing a script which I want to stop with any key I choose. After pressing the key, my intention is to complete all my commands at that moment and start su. I've tried adding a & to my ...
0
votes
1answer
49 views

How can my macbook be able to ping google but not my router?

I've been having a lot of trouble recently with my macbook dropping internet connection intermittently. Every 5 minutes or so. So I've been trying to determine where the failure is occurring. Virgin ...
2
votes
5answers
6k views

Move all files in sub-directories to current directory?

I've got files in a bunch of subdirectories, and I'd like to flatten them out and move them all to the current directory. I found this question, but adapting the answer to: mv * . didn't work. I ...
1
vote
0answers
22 views

How can I configure git bash to display a timestamp for each command?

I run git's bash on Windows7 to manage source control for projects. Can I edit C:\Program Files (x86)\Git\etc\git-prompt.sh to enable me to timestamp when I ran commands? e.g. instead of ...
2
votes
1answer
28 views

Terminal not working properly

While I was messing around with stuff, I ran the commands: curl https://sdk.cloud.google.com | bash exec -l $SHELL gcloud components update dns gcloud auth login gcloud init After this, my bash ...
0
votes
2answers
25 views

How to pass parameter in linux command at the end of the line

I would like to pass a parameter at the end of the line while I am giving a command in terminal. So I would like something like the example below find /path/to/directory -type f -exec grep -irl ...
1
vote
1answer
24 views

Man pages are outdated

Background: I recently learned about the mv -t flag option in bash, but when I checked the man pages on my computer, there was no mention of it. The man pages were dated 9 July 2002. I ssh-ed into ...
1
vote
1answer
14 views

How to check shell options?

I want to check what options are enabled for my current shell. For example, I want to know whether I was invoked with -x or -e or any number of other options. I source a shell script with shebang ...
5
votes
3answers
369 views

Suppress execution trace for echo command?

I'm running shell scripts from Jenkins, which kicks off shell scripts with the shebang options #!/bin/sh -ex. According to Bash Shebang for dummies?, -x, "causes the shell to print an execution ...
0
votes
3answers
6k views

Autostart programs/scripts in Debian 8 Jessie

I have a scipt (.sh) for screen rotation of my thinkpad on linux. I have now installed Debian 8 Jessie and the "Startup Applications" is no longer there, how can I make it to startup on boot? or user ...
0
votes
1answer
22 views

bash if statement keeps changing second argument to literal string

So I'm not sure why it's doing this. My if statement keeps interpreting the second variable as a literal string instead of a variable. Below is my exact code. lights() { bulb1state=$(gatttool -b ...
0
votes
0answers
11 views

Vagrant shell provisioner does not respond

I am provisioning a VM through shell script in AWS using vagrant-aws plugin. VM gets launched and the shell script gets executed but I don't see any update on the shell prompt. It used to get updated ...
4
votes
3answers
5k views

LANG=C is in a number of the /etc/init.d/* scripts. What does LANG=C do and why do you need to set LANG=C.

Its not clear what it does or what it contains. I tried greping the out put of set and env to see what C or LANG are set to in other places on the systems. Nothing was clear about how it is used or ...
3
votes
9answers
20k views

How to find the index of a word in a string in bash?

In bash script, I have a string which contains several words separated by one or more than one spaces. ie: Name Age Sex ID Address If I want to find any of the word, for instance I want ...
0
votes
1answer
22 views

How to overwrite an echo/printf line with another one? (Making it start at the center of the screen)

I want to write a script which outputs sentences I choose. I want them to appear in the center of the screen: output the first one, and then make the second one appear over the first. Here's my code: ...
0
votes
0answers
21 views

Remotely shutdown all computers on network running Ubuntu - bash scripting

I'm trying to iterate sudo poweroff through all ip addresses in my network using for loop. All computers in the network have the same password. sshpass -p password ssh $ip sudo poweroff The problem ...
0
votes
1answer
15 views

Apple Script: cannot call id3tag from script with “do shell script”

Trying to rename mp3s from an apple script which will be part of a larger script including Audio Hijacker. set folder_p to "/Users/me/Music/" set folder_path to POSIX path of folder_p set file_path ...
0
votes
1answer
20 views

Bash expands array where it should just use one element

My simple bash script to fetch images of a Raspberry Pi that are older than one minute: #!/bin/bash time=`date +"%FT%H_%M_%S"` imagedir="/root/pilapse/images/" files=`ssh pi find ...
0
votes
2answers
44 views

XML query in Bash with XMLStarlet

I need to extract a few values from an XML file, and I stumbled onto XMLStarlet that seems pretty powerful. Knowing little about XML, I'm overwhelmed with the tool, and likely need only a very tiny ...
0
votes
1answer
20 views

File Operations Using Symlink Source/Destination

I've created a set of symlinks which I can use in BASH with CDPATH: 'desk' which points to my desktop, and 'docs' which points to my documents. I can cd using these symlinks cd docs without problems, ...
0
votes
0answers
12 views

Default Profile

How can I set the default profile to be loaded on a bash login? My system was loading my user profile instead of the system one. I had it working properly and seemed to have accidentally broken it ...
39
votes
4answers
19k views

How to: Unlimited Bash/shell history?

Is there a way to define an unlimited history in Bash ?
0
votes
1answer
24 views

Vim E488 trailing characters but I don't see any trailing characters in file

Im opening the vimrc file with the following command vim ~/.bash_profile. Here's the error message and also the vim file contents. I actually get this error when ever I open any file with VIM. Error ...
0
votes
0answers
29 views

Most commands won't work on bash

So I updated to latest version of El Capitan (10.11.3) and adb stopped working for me. Upon messing with ~/.bash_profile, I made it worse and now most commands like open etc. won't work in terminal. I ...
0
votes
1answer
21 views

Bash 4.3 Substring Negative Length on OS X

Bash 4.2 added support for negative substring lengths: http://tldp.org/LDP/abs/html/abs-guide.html#SUBSTREXTR01 Example 37-12. Negative parameter in string-extraction construct When the ...
4
votes
2answers
3k views

What do I need to do to mount a USB drive in ArchLinux

What packages do I need to allow me to mount a USB drive in ArchLinux from the command line? What command do I use? Under Ubuntu these things happen automatically, but it's about time I learned how to ...
-2
votes
4answers
2k views

How to set a file NOT no be executable - linux terminal?

The question is that I want to toggle of the executable bit of a linux executable I know that I can set a+x executable, but I can't set is as NOT executable :( Google omits not from searches..
1
vote
2answers
76 views

Should I ignore .bash_rc, .bash_profile etc if I'm using Zsh?

Zsh configs go into the ~/.zshrc file. That’s where I’ve been putting my aliases, etc… But I want to know if I should be ignoring .bash_profile and those other files, and putting everything into the ...
0
votes
1answer
21 views

bash: show names of background jobs in the bash prompt

It would be cool if the bash prompt can be used a a mini task bar. Can the bash prompt (PS1) show the names of the jobs listed in the jobs command?
0
votes
1answer
34 views

Check if samba down from a Linux client

What is the most effective way to check Samba server availability from a Linux client?
0
votes
0answers
10 views

Is it possible to automatically compile a LaTeX document through terminal using TeXworks?

I want to create an alias to automatically compile the main .tex file of a big document in LaTeX under Debian Wheezy. That means I need a shell command to do so. Is this possible? I am currently ...