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

learn more… | top users | synonyms

2
votes
1answer
64 views

rsync error - Unexpected remote arg: root@1.2.3.4:/*

I'm trying to migrate centos server to a new box with rsync and I run this command in the destination server: rsync -auHxv –numeric-ids –exclude=/etc/fstab –exclude=/etc/sysconfig/network-scripts/* ...
0
votes
2answers
34 views

My code .sh cant run. Help me

#!/usr/bin/expect -f set port [lindex $argv 0] spawn ps xu | grep "ssh -f -N -o ConnectTimeout=5 -D $port" | grep -v grep | awk '{ print $2 }' | xargs kill -9 expect eol I make sure 100% port 1234 ...
0
votes
0answers
13 views

How to take user input from bash script when run as executable without terminal?

I am trying to make a bash script which takes some user input and processes as per the input. The script is executable, and has a shebang. The script is somewhat like this: #!/bin/bash read name -...
0
votes
1answer
10 views

loop inside multiple-level paths and rename

Assuming I have a file named list.txt contains Baths of files inside a directory; And the baths pattern like this: ./path/to/file.txt ./path/to/another/file.txt ... etc I want to loop inside list....
0
votes
1answer
19 views

Delete 'Permanent' Changes to PATH?

I am developing using Cocos2d-x on a Mac running OS X 10.11.6. I have installed Android Studio and have a number of new entries in my PATH which are NOT being added by my .bash_profile. Example '/...
1
vote
6answers
384 views

Looking for a recommendation for an OS X Bash manual

I've just begun to use the Terminal in Mac OS X and I've found the man command very useful, although very often the explanations are too compact or complicated for me. I am looking for a very basic ...
13
votes
5answers
34k views

How to remove all files starting with a certain string in Linux

I need to find all files starting with the name NAME in a directory tree and remove all these files using one shell command.
2
votes
2answers
207 views

Set $PATH For /bin/false user

I have a sensu user: sensu:x:496:496:Sensu Monitoring Framework:/opt/sensu:/bin/false Its $PATH is: /usr/local/bin:/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/sbin I want to update its PATH, so that ...
0
votes
1answer
18 views

How to install ImageMagick for MinGW on Windows 7?

Well... already have installed MinGW32 (don't know version - installed in a folder named Git 2.4.4.2) on wiidows 7 and I want to install ImageMagick to run some scripts like the follow: echo " ...
0
votes
1answer
18 views

Prepend all .jpg, .mp3, and .mts files in subdirectories with their respective parent directory name

I have decades worth of family photos and videos that are organized and labeled within a directory tree containing thousands of directories. The file paths, in general, all look like: /...
0
votes
2answers
41 views

Run Windows app from Ubuntu on Windows

I'm using bash on Ubuntu on Windows. I navigate to a folder and from there I'd like to open a file in a Windows program. For example: After entering cd \mnt\c\Users\myusername\Desktop notepad index....
0
votes
1answer
21 views

Bash one-liner to open several processes and execute a python function in each - poor man's parallel processing

I have a python file like my_functions.py and within that file is a function def func(a,b): result = does_some_stuff(a,b) return result Is there a way bash one-liner that would open N ...
1
vote
1answer
35 views

unix/linux chmod to let everyone read every directory and file

I'm having file permission trouble backing up my MacbookPro through my LAN to my Windows computer. I want to set permissions of all files and directories on MacbookPro to allow reading by all. On the ...
0
votes
1answer
21 views

bash: opposite of “histignore” behavior

I am looking for a way to ignore every command by default, unless I specifically want to save it in history. Ideally, saving a command should be as easy as prepending it with a space.
1
vote
1answer
35 views

Using bash, how to extract specific image's URL and title text from html file?

Given several hundred numerically ordered html files, each having multiple image tags but only one image with the id I'm looking for and following the convention <img title="$titleText" src="$...
2
votes
2answers
4k views

Changing the HOME for Cygwin

I'm trying to change the home directory for Cygwin on a computer at work. Our home directories mapped to a network share by default. This seems to cause some confusion for Cygwin, as it created a ...
15
votes
3answers
4k views

Tmux current pane border not obvious

I'm struggling to tell which pane is the current one in tmux if there are only two. The border only seems to highlight the adjoining edge which makes it impossible to tell. Here's a Gif to highlight ...
0
votes
0answers
10 views

Bash in Windows 10 - Directories not appearing when created in File Explorer

Using Windows 10 Enterprise Insider Preview Buil 14372.rs1_release.160620-2342 When I create a directory in Bash (e.g. mkdir test_from_bash) it appears in the File Explorer but the opposite doesn't ...
1
vote
1answer
20 views

Get part of string that matches regex

I'm writing a bash script and trying to parse a file to get a software version. The output is : Version 13.0.R7.0 - Built on Tue Feb 09 18:47:29 EST 2016 I want to be able to pull out 13.0 (I will ...
0
votes
1answer
23 views

How to configure AWS EC2 user data values and bash script

When launching a AWS EC2 instance, you can give a user data string that is interpreted either as key, value pairs with some configuration variables, or as a bash script, if it begins with a #!/bin/...
6
votes
3answers
601 views

When I paste a command on my bash prompt it is not in history — how can I add it?

When I paste a command to my OS X or Ubuntu bash prompt using CmdV, the command is not in history – even if it is executed. The command is in history only if I type it. How to enable that pasted ...
10
votes
1answer
566 views

Why doesn't this softlink work as expected?

bash4.3 # pwd /bin bash4.3 # ll sh lrwxrwxrwx. 1 root root 4 May 17 22:22 sh -> bash bash4.3 # ll bash -rwxr-xr-x. 1 root root 1072056 May 17 22:22 bash bash4.3 # bash bash4.3 # ...
0
votes
1answer
20 views

How to browse bash history between certain line numbers

Everytime I need this I google it like 10 minutes. I don't know how to express this better so that Google finds it right away but I need to retrieve bash history between certain lines like: $ history ...
12
votes
1answer
591 views

Multiple Installations and Understanding $PATH

I have an older version of Git installed at: /usr/bin/ I recently downloaded a newer version to: /usr/local/bin When I type: which git I get the location of the old version. I believe that ...
0
votes
1answer
23 views

logrotate files older than x hours

What's wrong with this rotate.conf? Goal is to delete only files older than four hours path/to/tokens/*.tkn { nosharedscripts prerotate if test `stat --format=%Y $1` -le $(( `date +%s`...
2
votes
1answer
20 views

Restricted bash circumvention via SSH command execution

EDIT: After much digging, this is almost certainly a result of /etc/profile.d/... being called before rbash is executed, and therefore not a problem with restricted bash in itself. There seems to be ...
18
votes
8answers
10k views

Replace Symbolic Links with Files

Is there an easy way to replace all symbolic links with the file they link to?
1
vote
2answers
2k views

Mac: truly detach process from Terminal.app

On Mac OS 10.6.6, I want to make a bash alias or function that will run Google Chrome. Launching Chrome is easy: "/Applications/Google Chrome.app/Contents/MacOS/Google Chrome". The problem is how to ...
10
votes
2answers
5k views

Why is Ctrl-Arrow not working in bash on OS X?

I use Ctrl-← and Ctrl-→ on every Linux system I work on, but these key combinations don't work in bash on my Macbook Pro. It is running Snow Leopard, and I'm using the built in Terminal ...
-1
votes
1answer
27 views

what happen on bash while builtin command executed as background process

Updated: The internal command was not done as separated process in normal execution because it done with shell. but what steps are done by bash,if the builtin process was executed to background. ...
0
votes
0answers
36 views

Unable to update Android SDK in headless mode on Bash for Windows 10

As currently I am exploring the Bash for Windows 10, I have stumbled on a problem with trying to fully set up Android SDK for it. I have downloaded the SDK and set up the path variables for ...
0
votes
1answer
359 views

Is Bash part of Apple's OS X System Update?

I think the title is self explanatory. How safe is it to upgrade yourself using methods such as this (https://coderwall.com/p/dmuxma)? Thank you in advance.
0
votes
1answer
36 views

Seeing actual commands typed in bash history

Is it possible to retrieve the actual commands typed in a bash history? If the command involved (for example) a history substitution or modifier, what is seen in the history is the resulting command ...
1
vote
1answer
5k views

init.d script - Permission denied

I'm trying to create a init.d script for my server which should start/stop the teamspeak server and some node.js apps using "pm2". Here's my script: #! /bin/sh ### BEGIN INIT INFO # Provides: ...
0
votes
1answer
12 views

bash function - use . character as parameter

I am trying to create a personalized function to wrap git add. Since I'm not a bit fan of having to type git add a/long/path/to/some/file/that/has/changed.java I am trying to create some sort of ...
0
votes
0answers
16 views

bash: $'\302\211[COMMAND]': command not found

I've used bash in xterm on Debian Jessie for about 2 years. Just recently I sometimes get an error bash: $'\302\211[COMMAND]': command not found. The only help I can find on the topic is Piping grep ...
2
votes
3answers
41 views

Make program able to run from terminal command

Having program in /home/user/Downloads/program/main I can launch it by following command cd /home/user/Downloads/program && ./main or from GUI. What I want is to launch it from terminal by ...
1
vote
2answers
29 views

Tee a script to file within itself

I'm familiar with using tee, and I know that I can simply log output with script.sh | tee file.log However, I want a seamless interface for the user. Is there a way to, within script.sh, run tee ...
1
vote
1answer
26 views

Save output from terminal to file

I have this command which is being executed on a remote server. I tried to send it to a file on the server that is calling the ssh command but it doesn't look like it is working. ssh $SERVER "su $...
2
votes
4answers
1k views

Docker on Conemu

I am trying to make docker run on ConEmu by creating a task that open up Docker start.sh file usinggit bash. Since normally docker Terminal is pointing to "C:\Program Files\Git\bin\bash.exe" --login ...
0
votes
0answers
5 views

NeoVim FZF Hidden Files

Hello bash experts out there, I'm new to using neovim and I'm having a hard time figuring out why my FZF is not showing hidden files, such as .gitignore and `.htaccess`` Here's what I have currently ...
0
votes
1answer
22 views

Smart word wrapping in `less`?

I use the Python package rtv as a terminal client to read Reddit. When it gets to a large text box, it calls less display the text. Currently, less wraps the words according to column width, meaning ...
2
votes
4answers
249 views

Rename to Start Case or Initial Caps in Bash

I need a oneliner to rename all files in a directory from SomeThing.TXT NOT A FILE.ogg sensitive lalala.doc to Something.txt Not A File.ogg Sensitive Lalala.doc In other words: first letters of ...
0
votes
1answer
4k views

How can I use wget to send POST data?

I want to make following POST request to my server using wget: email=abc@abc.com&file1=@FILE_HERE&file2=@FILE_HERE In the above request, there are three POST parameters called email , file1 ...
21
votes
3answers
16k views

How do I get the output and exit value of a subshell when using “bash -e”?

Consider the following code outer-scope.sh #!/bin/bash set -e source inner-scope.sh echo $(inner) echo "I thought I would've died :(" inner-scope.sh #!/bin/bash function inner() { echo "winner"; ...
-1
votes
0answers
12 views

Enable scroll in conemu with Windows LXSS bash

screen in Bash from Windows Linux Subsystem used in ConEmu have no scrolling enabled. How can I enable it?
0
votes
0answers
17 views

Sort 'top' by CPU time accumulated since launch of top

OS X 10.11.6, GNU bash v3.2.57. How I want top to behave top in 'accumulative mode' (that's the name according to the man page, which I understand to mean: accumulated values are counted from launch ...
4
votes
1answer
9 views

How to map one array element which is separated by newlines into a new array with multiple elements

I select 4 files in Nemo in the path /home/myUsername/.local/share/nemo/scripts/Folder with spaces/. Nemo stores the file paths in the environment variable NEMO_SCRIPT_SELECTED_FILE_PATHS. (As you ...
0
votes
2answers
213 views

Concatenate header of one file with tail of another

I have a large gzipped mysqldump file which contains some table definitions and then many insert statements. I'd like to edit the table definitions but leave the insert statements alone. The file is ...
-1
votes
0answers
5 views

Web gui tool for control scripted tasks to end users [closed]

Trying to find some web gui driven tool (linux installable) for such a tasks, for ex.: Office administrator clicks for active user check, then my bash script wrapper runs ldap tool for collecting ones ...