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

learn more… | top users | synonyms

3
votes
6answers
5k views

Messed up keys in vim when running inside tmux

I have been playing with tmux and I'm loving it. However, there's an annoying issue when running vim inside it. Somehow the arrow keys get remapped, but only on certain times, like when firing up ...
1
vote
1answer
17 views

Upstart: What is the first tracked PID w/o expect, but with script AND exec?

I have some Upstart configs used to start some foreground and blocking processes to run in the background as some kind of "daemons", especially those processes do not fork in any case. What I want is ...
1
vote
0answers
30 views

Is it Possible to get list of commands i typed in dos prompt? [duplicate]

I would like to search my own CMD history. we could browse within the same session, you can browse it with the up and down arrow keys but what about the history of former CMD sessions? Is there a ...
1
vote
2answers
57 views

Kill all tasks with PID above a certain integer with bash

How may I fetch and kill all processes with a PID above e.g 1000? Using commands like ps -A and top is fine for viewing the list of processes, but how would one only get the PIDs? The logic of ...
0
votes
3answers
305 views

bash shell error: “no such file or directory”

I am trying to install Virtualenv wrapper on Ubuntu 14.04. But whenever I start a terminal, I get the error saying bash: /usr/share/virtualenvwrapper/virtualenvwrapper_lazy.sh: No such file or ...
2
votes
3answers
5k views

How to get git bash back in Windows Explorer context menu

I've had git running on my machine for over a year. I have a folder in my C root called gitRepo, which contains all my various repos. For some reason, for one repo only, the git bash command is ...
0
votes
1answer
20 views

Execute command generated by a PHP script

I have PHP file which has logic based on which I run either bin/phpunit -c Application/app --testsuite $TESTSUITE or bin/phpunit -c Application/app --group group1 group2 when Im doing ...
0
votes
1answer
40 views

Script to monitor realtime CPU & Bandwidth usage in xen live migration

I need to write a script (bash or python or ??) to perform live migration of a VM in xen, and to simultaneously log and extract the CPU & bandwidth usage of the Domain-0 AND write the output into ...
-2
votes
1answer
39 views

bash: Loop over lines of a file

Here is my script: #! /bin/sh for line in $(cat list); do echo "[$line]: Getting my workers list.."; var=$line-"worker1"; echo "$var" >> "hostlistworkers.txt" ...
4
votes
4answers
6k views

Rsync print only files that would have been changed

Is there a way to get rsync to print the full filepaths to all files that are different without actually transferring any files? Alternatively, I need a way to diff the files across two trees (over ...
0
votes
1answer
27 views

Problems running nmap export to file in linux as a cron job / bash script

I have a very simple bash script that runs nmap and exports the results to an xml file, and the uses scp to upload the file to a server: #!/bin/sh nmap -sn -oX /home/scan.xml 192.168.20.1-255 wait ...
0
votes
1answer
12 views

Use disk-backed buffer between pipes

I'd like to pipe a command into a slower one, with a rather big (~200GB) buffer in between. Here is an example use-case: command1 | buffer -f file.buffer | command2 Is there a command to do that? ...
0
votes
1answer
33 views

Sort file by two column in the event of two the same value

I want to sort files by one column, but in the event of two the same value I want to sort these two by other column. How can I do it? My file: 1 2 3 1 3 2 1 4 3 2 4 1 2 1 3 3 1 ...
1
vote
0answers
16 views

how to make less pager respond to scroll wheel and not clear the screen

I know about answers like how-to-make-mouse-wheel-scroll-the-less-pager-using-bash-and-gnome-terminal, which is to remove the -X flag from the $LESS environment variable. But I would like to do both ...
1
vote
1answer
849 views

Postgresql query within a bash script

We are having an issue with a postgresql bash query. The output of the query from the bash script add's additional quotes around the date. Please can you help me fix it?! Script: #!/bin/sh ...
0
votes
1answer
15 views

Not able to set wallpaper after reboot through ~/.fehbg in .xinitrc in i3 on Arch Linux

I'm trying to set my wallpaper using an automated script in .xinitrc rather than having to set it after every reboot by myself. I've used feh to set the wallpaper. And then used the generated .fehbg ...
0
votes
1answer
27 views

Why awk printing wrong string into the output file?

I'm trying to read file with awk and write the output in a new file. Content file sample: DATE_Login|09:01:20.507|2015-08-13|TIME_Session|00:32:32|MX|w32 ...
0
votes
1answer
28 views

bashrc file read error in xterm

My bashrc files is read but is not interpreted correctly. qwul@qwul-ThinkPad-L440:~$ cat .bashrc #PS1='\[\e[1;32m\]\][\W]\$\[\[\e[0m\]\]\] ' alias la="ls -a" #alias ll="ls -l" ...
0
votes
1answer
20 views

Pipe string to a command with multiple read prompts

How can I pipe a string to a command with multiple read prompts in OS X? I am running a command for a Parallels VM to enable a password which prompts for multiple values (without running a secondary ...
1
vote
1answer
38 views

Incorrect output of history command of ssh. How to read the timestamp info correctly

I set the HISTTIMEFORMAT variable to store the timestamp info .bash_history file. I am able to display the history properly if I use interactive shell. But, when I run history command to display ...
0
votes
1answer
19 views

how to grep something with a wildcard path?

I want to grep a Gemfile in few rails apps. But for each rails app there are many branches and out of which the latest branch name lets say is 'main'. The structure is something like this: workspace ...
1
vote
3answers
1k views

How do I set the Android bash path in ZSH?

Looking through the Cordova Android docs, I see this line You need to add the path to your Android SDK platform-tools and tools directory. In my example I will use ...
149
votes
14answers
128k views

How do I detach a process from Terminal, entirely?

I use Tilda (drop-down terminal) on Ubuntu as my "command central" - pretty much the way others might use GNOME Do, Quicksilver or Launchy. However, I'm struggling with how to completely detach a ...
1
vote
0answers
52 views

How to configure .bashrc for git-for-windows?

I used Git Bash for Windows with Version 1.9.5 on my Windows 7 (64bit). I added a .bashrc and a .gitconfig in my %USERPROFILE% folder (C:\Users\<USERNAME>\). Everything worked fine. Now i ...
1
vote
1answer
232 views

How to remove file when over quota without root permissions and truncate, dd, mv, cp, and rm fail?

I'm working on a file system where I don't have root permissions and all of the above have failed to allow me to delete a file with the same errors: $ >file1 $ -bash: file1: Disk quota exceeded $ ...
0
votes
3answers
25 views

formatting output in bash shell to remove special characters - linux

I am issuing the command below against a logfile grep "Oracle Audit" /var/adm/messages | awk '{print $6}' How do I format the below output Audit[9460]: Audit[10507]: Audit[10507]: Audit[10507]: ...
0
votes
0answers
11 views

Canvas lms open sourse installation

Hope you are doing fine. I am facing a lot of problem while configuring canvas using ubuntu 14.04 following the steps described in https://github.com/instructure/canvas-lms/wiki/Quick-Start Step 1: ...
3
votes
1answer
60 views

rename(1) a set of files beyond the current directory

The rename command in Ubuntu 12.04 (manpage says it's part of perl v5.14.2 2012-03-23) works well in a single directory, but I want to use it on subdirectories too (or, more generally, on a list of ...
1
vote
1answer
27 views

How to color specific parts of the bash prompt?

I am working on a macbook OSX and I am administering some VMs inside my machine. I often make mistakes because all prompts have the same color and type, so I want to differentiate them. First of all, ...
1
vote
2answers
4k views

Mac Terminal showing bash instead of my username

This makes it hard to know what directory I am in. I installed a version of python for school and now it says -bash-3.2$ instead of MyMacbook: ~$. I'm sure this is really simple, but I know nothing ...
0
votes
1answer
31 views

Terminal on Mac Always Starts in PHP Process

I am on a Mac running Yosemite 10.10.4 and every time I start terminal or open a new terminal tab I am inside of an actively running php process. I must CTRL+C before I can do anything else. I don't ...
0
votes
3answers
44 views

/etc/shadow and /etc/passwd privilege - why is it writable

sghk1> id uid=0(root) gid=0(root) sghk1> ls -l /etc/shadow -r-------- 1 root sys 4045 Aug 24 15:52 /etc/shadow sghk1> ls -l /usr/bin/passwd -r-sr-sr-x 1 root sys ...
0
votes
0answers
15 views

Issue with python path after installing Vagrant

I just recently installed Vagrant using this guide: https://www.reddit.com/r/deepdream/comments/3c2s0v/newbie_guide_for_windows/ I noticed that after that when using git bash, I was unable to use ...
0
votes
2answers
48 views

Info on '#!' (shebang, hashbang, crunchbang, etc.)

I have a question about the phrase '#!' that appears at the top of every python file, most bash files, and several others. I've already performed a search for this term on both Google and this ...
2
votes
3answers
2k views

Run a remote script/application in detached mode in Ansible

I am having trouble running a remote application startup script "detachedly" from an Ansible playbook. The script will run, but I can't get it to get/stay detached. I am probably doing something ...
1
vote
3answers
48 views

Error extracting data from a text file, with grep command in bash

I generate an output file named "silence.txt" with ffmpeg. When I try to extract lines containing the word "silencedetect", I've got a strange extract. Here is my original "silence.txt" file : ...
1
vote
3answers
52 views

Bash: How to copy a file to multiple SSH servers all of which are specified in a list text file?

I have a file (lets say "thisfile.sh" for example) I would like to copy to multiple servers (of which some may require password authentication) at once upon launching my bash file, presumedly with ...
0
votes
2answers
192 views

Enter response once prompt returns?

It's neither a secure idea nor one I'd recommend elsewhere, but I have a situation when occasionally it takes a while for my Ansible ad-hoc command to respond. I'd love to pipe or args or whatever is ...
-1
votes
0answers
32 views

What does the “:.” in output mean when running “ls -R” in Linux?

ls -R is used for recursively listing out the files, directories and sub-directories. In the output I see a :. symbol when the ls -R is executed. Can someone please help me understand what that ...
1
vote
2answers
47 views

escaping awk with remote ssh command and bash that is already escaped

Hello. ssh ufk@10.0.0.2 "bash -lc 'pm2 list | grep app | awk { print $3} '" I need to run the command I pasted here. the problem is that i'm already escaping twice... the bash with " and the pm2 ...
2
votes
1answer
25 views

Bash Script will not stop.

So i had the bright idea of making a script that pings my IP to see if its up as i am having some issues with it. so here is the script I made. while : do ping (IP address) done now it ...
0
votes
2answers
2k views

How to store results of multiple sql queries in shell variables in Bash?

I need to store in array the results retrieved from the database. So far this is basically what I'm trying with no success. Myarray=$(echo "SELECT A, B, C FROM table_a" | mysql database -u $user ...
5
votes
3answers
851 views

Bash readline deleting till the previous slash

In bash emacs mode, is there anyway to delete till the previous slash character? For example if i entered the command cp /usr/local/bin/reallylongincorrectfolder ...
0
votes
1answer
19 views

How does conda's source activate foo work

Anaconda's documentation for managing environments states that activating an environment is done using: source activate <env-name> I've noticed that with conda installed, activate is in the ...
-1
votes
0answers
18 views

How to screen a bash script and run it as sudo

I am wanting to run a bash/shell script in a screen, but certain commands (mv/cp) need elevated permissions (such as root). How would I do this effectively? screen -dmS weblog sudo /dir/script.sh ...
0
votes
1answer
32 views

Having trouble creating symlink between the terminal in Mac OS X and Sublime Text 2 so it can be launched from the command line

I’m using Mac OS X Yosemite and I want to be able to open Sublime Text 2 from the terminal with a command like this: sublime . I’ve typed this into terminal as shown on the Sublime Text 2 website: ...
0
votes
1answer
38 views

appending to file with bash

using: #!/bin/bash echo "Please, enter name" read NAME echo "$NAME," >> MyFile$(date +%m%d%Y) echo "done" it will append the NAME to the file without issue, however, I want it to append the ...
0
votes
1answer
22 views

how to make curl re-use existing connection

curl --verbose google.com If I execute this command, after curl does its job, it says "Connection #0 to host google.com left intact". But it doesn't use same connection if I execute same command ...
0
votes
1answer
20 views

how to make alias ssh-add /bin/bash in bashrc?

how does not this work? alias push-bb="ssh-agent /bin/bash && ssh-add ~/.ssh/bitbucker_rsa && git push" I assume it cancels at /bin/bash part?
0
votes
2answers
38 views

FFmpeg : mp4 and multiple srt into mkv

I have a couple of srt subtitle tracks for an mp4 video. How do I make them into mkv using ffmpeg/avconv? I would like to use space efficiently. Performing conversion on Darwin v13. I will be ...