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

learn more… | top users | synonyms

0
votes
1answer
26 views

bash completion in msysgit by single or double tab

Single tab used to make bash complete current line, and double tab shown all possible variants. For example, if I have files (or git branches, or whatever is suitable in current context) "abc", "abd" ...
1
vote
0answers
9 views

Mouse tracking control codes for terminal using bash

I'm making a bash implementation of curses as an expermient for fun. I use infocmp to get the ANSI terminal codes. I'm a bit stuck now at how to enable mouse tracking in a cross-console way. I could ...
7
votes
2answers
8k views

How can I “grep” recursively filtering the name of the files I want with wildcards?

When I want to perform a recursive grep search in the current directory, I usually do: grep -ir "string" . But that command searches inside all kinds of files, including binary files (pictures, ...
3
votes
2answers
711 views

save bash history, regularly

I have bash set up to save history, to a file. It does this whenever bash exits [properly]. As sometimes bash does not exit properly the history is lost. So the question is can I set up bash to save ...
1
vote
2answers
517 views

Redirect output of remote python app started through ssh to file

I have a python app in a remote server that i need to debug, when I run the app locally it prints some debug information (including python tracebacks) that i need to monitor. Im trying to redirect ...
2
votes
1answer
23 views

Replacing a running Linux root filesystem

I'm trying to come up with a bash-scriptable method of replacing the root filesystem on a running PC. The system uses a MBR partitioned disk with an ext4 rootfs and a swap partition, unfortunately it ...
5
votes
2answers
5k views

Getting “-bash: fork: Resource temporarily unavailable” in OSX

I seem to run into problems with the max. number of processes every so often. Anyone know what is best practice for fixing this? Running OSX 10.6 on a MacBook Pro i7. ulimit -a returns these values: ...
0
votes
1answer
8 views

How do I fix a cipher mismatch issue with sftp?

I'm running into an issue where a server was upgraded to RHEL 6.5, and we have automated bash scripts on an RHEL 5.9 install that connects through sftp and ssh commands. Now, the new server only ...
7
votes
8answers
676 views

Remove linux file named with set of shell responsive characters

I've created a file named \;:$"\' to test a software of mine. I ended up with an error, because I cannot delete the file property. I'm trying to find a precise character combination to remove it via ...
0
votes
2answers
23 views

Open a Command in a New Instance of Various Terminal Emulators

I am trying to open a terminal emulator while simultaneously passing a compound command to it. What are commands for doing this (two versions: where the terminal stays open after completing or where ...
0
votes
4answers
30 views

Copy paste a multiline command into command line

I'm writing a doc about installation of my soft and I have to write things like Please do the following: sudo apt-get update sudo apt-get install python-dev cython portaudio19-dev The ...
0
votes
0answers
12 views

create and run bash script on start of runlevel5

I have created a following hello bash script: #!/bin/sh echo "Hello Run Level 5" I put this script in the /etc/rc.d/rc5.d directory with a name S100RunLevel5. How can I make this script to run ...
14
votes
3answers
2k views

Command vs program?

I was looking up the difference between adduser and useradd, and an explanation is that useradd is a command while adduser is a perl script. I understand what a perl script is, but what I do not ...
0
votes
2answers
46 views

How to disable bash drivers in windows 8.1?

I'm trying to follow these instructions to stop Bash Driver BHDrvx86 or BHDdrvx64, but device manager in Windows 8.1 no longer displays non plug and play drivers (such as the Bash drivers), even as a ...
15
votes
5answers
6k views

Cygwin bash prompt is wrapping lines on the same line

I'm using Cygwin bash prompt, and for long commands the text will wrap around on the same line as opposed to going to the next line despite setting my PS1 to simply ' $'. Here's a screenshot,
7
votes
4answers
182 views

Is there any in-built Linux command to display the contents of a directory in real-time?

Is there any in-built Linux command to display the contents of a directory in real-time?Similar to the "tail -f file_name" command which displays the contents of a file in real-time.
0
votes
3answers
25 views

How can I use the output of ls/grep as input for pdfunite

I want to use pdfunite to merge several pdf-files into one output file. Since the directory contains lots of different stuff, I thought i could use ls/grep to get the apropriate file-names and then ...
0
votes
2answers
23 views

Is there an equivalent to source which allows me to have a batch script alter environment variables of the parent bash process?

My situation is this: I use python with conda on a windows machine, and work mostly in cygwin when on the command line. Now conda allows for different python environments, similar to virtualenv, but ...
0
votes
0answers
15 views

Enable tab autocomplete in PhpStorm terminal on mac?

I am using PhpStorm for a pretty big project. We use Git for our versioning control. Needless to say, this leads to me switching back and forth all day between branches. I'm using the terminal window ...
14
votes
4answers
30k views

How can I use a bash like shell on windows

I use Linux and a Mac. I'll be teaching some command line stuff soon. What can I install on Windows to give me a terminal window most similar to a basic mac/linux bash shell. Would like to be able to ...
0
votes
1answer
14 views

Bash not starting in shell properly

When I open my terminal (OS X 10.10.3) I can't run some commands including the commands that are in my ~/.bashrc, but then if I launch bash from that terminal, all those commands work, as below:
1
vote
2answers
68 views

Edit xml file using shell script / command

I need to do this using unix script or command There is a xml file in /home/user/app/xmlfiles like <book> <fiction type='a'> <author type=''></author> ...
11
votes
14answers
19k views

Monitoring a file until a string is found

I am using tail -f to monitor a log file that is being actively written to. When a certain string is written to the log file, I want to quit the monitoring, and continue with the rest of my script. ...
0
votes
2answers
110 views

Unix Script: Wait until a file exists

I need a script that will wait for a (examplefile.txt) to appear in the /tmp directory and once it's found to stop the program, otherwise to sleep the file until it's located So far I have: if [ ! ...
1
vote
2answers
37 views

Is there a folder-specific .bashrc or .bash_profile?

Is it possible to have a bash script (like a .bashrc or .bash_profile, basically) that is executed only upon cd’ing into a specific folder?
16
votes
5answers
19k views

How do I convert a bash array variable to a string delimited with newlines?

I want to write out a bash array variable to a file, with each element on a new line. I could do this with a for loop, but is there another (cleaner) way to join the elements with \n?
2
votes
1answer
22 views

Linux command/script to find all files in a directory with a 4 digit number <= a specific number

I have a folder containing several other folders, each named in this format: Company XYZ (1999 OneWordDescription) I'm trying to filter out the ones that are marked 1995 or older, so I can move ...
0
votes
1answer
24 views

What does qsub --cwd `pwd` mean?

I am newbie to Linux command lines. I just got a queue submission command from others. The command line is as follows: qsub --cwd `pwd` -t 60 -n 1 --proccount 1 --mode c1 --env ...
9
votes
6answers
7k views

bash execution time in milliseconds (mac osx user)

I've checked this , but the solution provided did not work for me. Using date I can get the execution time in seconds: T="$(date +%s)" #some work here T="$(($(date +%s)-T))" echo "execution time ...
0
votes
0answers
14 views

Git Bash on Windows 8 open to specific directory except when using Git Bash Here context menu

When I right click and choose Git Bash here it works as expected and the shell launches in the correct window. When clicking just the icon, despite changing the Start In settings, the directory is ...
100
votes
6answers
62k views

Why does Ctrl + V not paste in Bash (Linux shell)?

When I copy something to the clipboard and press Ctrl + V in Bash, nothing happens; However, right clicking and selecting Paste does the job. Why? Is there any reasonable issue (I'm sure there is) ...
0
votes
0answers
9 views

Issue with backing up and restoring XAMPP due to unknown software version

I had a ton of permission errors with my XAMPP installation, so I decided to uninstall and start over to avoid hassles with figuring out the correct permissions. I used the XAMPP backup and restore ...
0
votes
2answers
522 views

osx: setting default python for files in terminal?

How do I set the default python for running py files without "python" keyword i.e $ django-admin.py manage.py startproject" in bash shell?
2
votes
2answers
51 views

pip not working on hombrew python 2.7 install

I've installed python using homebrew and I can't invoke pip from the bash. I've tried amending my .bash_profile to include /usr/local/bin/python and /usr local/share/python to no avail. When I use ...
0
votes
1answer
16 views

LSB init service dependency

I have added the two services A and B. B is dependent on A, meaning that if I will start B then A should be start automatically if it is not running already. But A is not coming up automatically when ...
1
vote
2answers
4k 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 ...
3
votes
2answers
2k views

Multiple parameters to bash script

I need to check for user provided options in my bash script, but the options won't always be provided while calling the script. For example the possible options can be -dontbuild -donttest -dontupdate ...
0
votes
0answers
14 views

Process stuck after being put into BG

I'm trying to put a process into background with (Ctrl+Z + bg): [andrey@localhost dir]$ git clone https://github.com/rust-lang/rust Cloning into 'rust'... remote: Counting objects: 465324, done. ...
2
votes
2answers
29 views

how to insert text at the beginning of each paragraph in bash

I have a file with multiple paragraphs separated by blank line. Technically they are not paragraphs just sections of text separated by blank line. I want to number the paragraphs so to speak by ...
6
votes
2answers
4k views

rsync complaining about `missing trailing-"` in a Bash script

Trying to rsync files from one server to the other in a screen session. Instead of writing the long command every single time, I decided to put in a Bash script. However, when I run it, I get a ...
0
votes
1answer
23 views

How to recursively compress subdirectory's files with password

I need to recursively compress subdirectory's files with password and then delete the uncompressed file in bash file. There are zip files and other files. I don't want to compress zip files again. I ...
2
votes
1answer
147 views

How can I tell what command is running on the remote end of an ssh connection?

Tl;dr - how do I find the name of the command (eg $BASH_COMMAND) running on the remote end of an ssh connection? ... My example setup is two tmux vertical panes, LH pane runs a local vim session ...
1
vote
1answer
16 views

Bash script that should do stuff when the first command is CTRL+C-interrupted

I want to make a bash script to automatize a simple task. This task involves running a program (not made by me) which do something until user presses CTRL+C. After that, I have to process the output. ...
1
vote
1answer
14 views

Make shell script rerun command on certain user input

I'm writing a shell script that randomizes my hostname but prints the random hostname and prompts me if I want to use this hostname for example NEXTHOST=$(sed `perl -e "print int rand(99999)"`"q;d" ...
3
votes
2answers
1k views

How to justify and center text in bash?

Newbie here. I'm looking for bash script to center and justify text. My script only works with one line of text. How would you improve it? #!/bin/bash COLS=$(tput cols) while true; do clear ...
0
votes
1answer
7 views

Distribute session-only git configuration on ssh login

I have a bunch of development servers (linux) that I connect to via SSH from linux workstation. On most of these servers I want to use the Git command line interface. I use a set of Git aliases that I ...
0
votes
2answers
29 views

Creating a bash routine

Everytime I log in into my work machine, I have to open a terminal and type the same routine: $ cd /Documents/some_folder/some_another_folder $ vagrant up $ vagrant ssh I'd like these commands to ...
0
votes
1answer
6 views

Linux remote run a scripts, screen hangs and never back to controls

I have a script in server. If I run it in server locally it is no problem. <user@server> ~ % restart_forms A forms [A] is Restarting <user@server> ~ % However, if I run it remotely ...
2
votes
3answers
62 views

Can I change my PATH dynamically based on my cwd?

I would like to change my $PATH environment variable dependent on my current working directory. Say I'm in /foo/bar/baz and I have the directories /foo/node_modules/.bin and ...
2
votes
2answers
26 views

gnu parallel: forward all of stdin to all processes

I'm trying to process input in different ways in parallel, writing out the resulting lines as they come in. My current approach is this: # process_parallel.sh read input parallel --colsep ' ' ...