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

learn more… | top users | synonyms

1
vote
1answer
17 views

Changing sh color in .bashrc

I'm trying to change the color of my shell which I connect to using Putty. When I type this export PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h:\w\$ ' I get exactly what I want. ...
2
votes
1answer
5 views

Script SSH Interactive Console that needs escaped chars

I would like to modify my existing SSH connection via a shell script. So if I run an existing script remotely I would like it to open a new port to be tunnelled. Interactively I can do this via: ...
0
votes
0answers
11 views

git hub for version control for an entire directory

Code at bottom I am using a private repo on git hub as a version control between me and partner and I am having some difficulties in my approach. I have wrote a few bash scripts as a way of ...
0
votes
1answer
8 views

Bash alias/function to precede every `git diff` with `clear`

Every time I do git diff I'd like my bash to do clear & git diff instead. I tried to tweak an answer at Bash: Spaces in alias name like this: git() { if [[ $@ == "diff" ]]; then ...
1
vote
1answer
21 views

How to pipe output of active stream to other commands

I'm trying to pipe an active stream to another command (maybe a bash script), but it always wants to wait for the entire stream to finish before it processes the command. s.g. I can do this: tail ...
3
votes
3answers
56 views

Identify my specific client machine over ssh to server

I share a dev server/environment with a few other engineers, and we all share a user account on that server. I use it often enough that I'd like to do some configuration via .bashrc, but I don't want ...
1
vote
4answers
37 views

How do I restore the ability to do Terminal commands?

I am using Mountain Lion. I added an alias to my ~/.bash_profile file, and now every time I open terminal, it displays the following: Last login: Thu Feb 11 09:50:30 on ttys000 Saving session... ...
0
votes
0answers
16 views

GNU screen - open new window in working directory of current window in a named (sessionname) session?

In order to open a new screen window in the same directory as the current working directory of the screen window you are launching it from (rather than the directory you initially launched the screen ...
0
votes
0answers
11 views

Windows RegEdit: How to properly quote Cygwin commands in Registry “RunAs” entry?

I have a Windows machine with Cygwin/X installed and X11 server running. I want to open text files with Cygwin/X's GVim. I already have it set up, with the appropriate Registry entry at ...
0
votes
1answer
17 views

Linux:AWK gsub command not processing correct output

On the below csv file I would like to change the scope from ENG to PROD; I have used the following awk command but there is no change to the file, could anyone please tell me what is wrong? test.csv ...
0
votes
0answers
15 views

Add SONAR_RUNNER_HOME correctly to PATH

I'm trying to use sonar-runner in my Mac. So i download SonarScanner and follow the instruction here : http://docs.sonarqube.org/display/SONAR/Analyzing+with+SonarQube+Scanner When i try to run " ...
1
vote
1answer
15 views

How to download files matching a particular pattern from ftp command line

I am accessing ftp through command line and trying to delete all the files matching particular pattern. But seems it does literal match than regex match. Can somebody suggest anyway that we can do ...
-1
votes
0answers
15 views

How to delete a directory in unix using Runtime.exec() / ProcessBuilder in Java?

I am unable to delete a directory in unix using the command "rm -r path". I also tried to at first delete all files inside the directory and then delete delete the directory itself but the commands ...
3
votes
2answers
28 views

How to view logs online during heavy usage with screen, tmux or Byobu?

Normally I use tail -F, but on heavy usage it is getting irresponsible and unreadable. On ssh I also use buyobu to type password only once. But when any of screens become irresponsible then all ...
3
votes
0answers
37 views

How to start a systemd service after user login and stop it before user logout

I have a Fedora 23 Machine. I have a directory/file synchronizing bash script that synchronizes my local /home directory to a remote directory (in a NAS machine). I run it manually but I would like ...
0
votes
1answer
26 views

sed align all lines to last line in a file Bash script

I have a files with below lines Dev_Campaign_1873.rpm Dev_Campaign_1987.rpm Dev_Campaign_9876.rpm http://52.30.241.107:8081/artifactory/api/storage/adifact Trying to get the output to a file as ...
-2
votes
0answers
17 views

I think I broke gnome-terminal

After toying around with custom startup commands in GNOME terminal, I came up with the fabulous idea to make it start with su. I didn't realize the 'close after the command executes' option was ...
0
votes
1answer
24 views

How do I catch and log all attempts to write to /dev/null?

Essentially I'm trying to catch output any scripts that are currently running and silencing their output. So the question is fairly simple, how do I log any attempts to write to /dev/null?
1
vote
1answer
32 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 ...
-3
votes
0answers
47 views

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

I would like to be able to search for all script files in order to bring what info is buried in various text files out so that relationships in the mind can form quickly as to: (a) How it is ...
0
votes
0answers
11 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 ...
0
votes
0answers
19 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 ...
1
vote
0answers
17 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 ...
1
vote
1answer
23 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 ...
1
vote
1answer
18 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 ...
0
votes
1answer
40 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 ...
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
1answer
20 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 ...
0
votes
0answers
11 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
51 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 ...
0
votes
2answers
29 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 ...
4
votes
1answer
45 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 ...
1
vote
1answer
16 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 ...
1
vote
1answer
25 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 ...
0
votes
1answer
24 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
14 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 ...
0
votes
0answers
29 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
24 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
16 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
22 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
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
1answer
18 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
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 ...
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
27 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
1answer
23 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 ...
0
votes
0answers
11 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 ...
0
votes
1answer
23 views

Quote a command for `find -execdir test [command]` (Bash)

I would like to execute following command to do git fetch in git repos if the have a remote (= git remote is non-empty): find -name .git -execdir test $(git remote) \; -execdir git fetch ...
0
votes
1answer
42 views

How can I tell bash top stop echoing text whenever I press any key?

I'm writing a custom startup command for gnome-terminal, and my intention is to display a welcome message every time I launch it. The message displays correctly, I coded it in order to make the ...