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

learn more… | top users | synonyms

2
votes
0answers
56 views

Force Ubuntu user to use specific shell

After years of reading helpful questions/answers on superuser, today it's my turn. I'm playing around with "lshell", a linux shell written in python (lshell on github) which gives the opportunity to ...
1
vote
1answer
27 views

PATH variable not working properly with hg

I am having a CentOS remote machine where I have hg installed. It was working fine for long time and today when I am trying to use hg commands, I got the following errors, [dinesh@lab test]$ hg st ...
6
votes
1answer
79 views

How to make bash keep most frequently used history entries for ever?

Duplicates are already turned off, but that's not enough (I feel like I have to enter commands too often). Assume I have a capacity of 2000 entries of by bash history and a command which I used very ...
0
votes
1answer
42 views

mv in for loop : “when moving multiple files last argument must be a directory”

I try to rename few files, omitting the first n characters. In fact I want to remove the [ www.blabla.com ] prefix (18 chars). I'm on windows, using bash command on Git-bash. I've tried this ...
-1
votes
1answer
65 views

bash - string manipulation get string before or after substring

good day all this is a noob question, but I can't seem to find the answer to this anywhere. Other functions like 'cut' or 'awk' or 'sed' are always mentioned but never using the string expression ...
-2
votes
1answer
46 views

Shellscript Looping Through All Files in a Folder

I want to write a shellscript that will loop through all the files in a folder and echo only the .sql files. Can anyone point me in the right direction? currently I am getting all the files along ...
0
votes
1answer
68 views

Docker Quickstart Terminal: cd: /u: Permission denied

I've just installed Docker for Windows. Quickstart terminal creates the 'default' vm, but then it can't access it with text: bash: cd: /u: Permission denied Looks like something went wrong... Press ...
0
votes
1answer
42 views

Can I run Powerline without Xorg

I installed powerline and its works fine in Xfce terminal. I am using ArchLinux. When I log in, pc always boot into cli mode. I like that. But in cli mode before satarting X, the bash prompt looks a ...
0
votes
1answer
35 views

Can't connect to remote machine via SSH - error: Permission denied (publickey,keyboard-interactive)

I've been trying to connect to the remote machine with the new second admin account but password was rejected. I'm very certain that I have typed the right password for the second admin account. After ...
1
vote
1answer
41 views

How can I navigate to a directory name with a special character

Normally, I'm used to navigate into directories in Linux using the cd command. Now, in a terminal, I need to get into a directory named -. I tried to navigate into the directory using cd -, but I was ...
0
votes
0answers
106 views

Merge xml files using Linux shell scripting

I have 2 files named file1.xml and file2.xml respectively. The contents of the files are: file1.xml: <EJB:Service> <EJB:ServiceId>123</EJB:ServiceId> ...
2
votes
0answers
38 views

Setting up a watchfolder

I want to make a folder that I can put any video file into and have ffmpeg catch it and spit it out as an mp4 and remove the non-mp4 file. I have the following: for f in *.*; do ffmpeg -i input ...
2
votes
1answer
35 views

Separate files by name into different folders

If I have a folder containing various files with the same pattern, for example: file1a file1b file1c file2a file2b file2c ... Is there a one-liner for separating them into folders named: ...
0
votes
1answer
20 views

Move one word backward repeatedly using ESC + B

I want to be able to move one word backward repeatedly using ESC + B on my OSX bash. The trouble is that I can just hold the ESC key and press B repeatedly in order to move repeatedly: if I don't ...
0
votes
1answer
41 views

Save shell execution output to file and display in terminal [duplicate]

I know you can save the output of executing a script/file to another file by using: ./script.sh >> script_output.log but this doesn't display the output in terminal during execution. Is there ...
0
votes
1answer
39 views

Find repeated numbered files

I have a bunch of files with names like this file_1_v4_sdk.x file_2_v1_3kl.x file_3_v1_39f.x file_3_v2_df0.x file_4_v4_f33.x file_4_v1_fks.x file_4_v5_skd.x file_5_v2_9ks.x file_6_v4_911.x ...
1
vote
0answers
64 views

“bash: gfortran: command not found” in Cygwin after Fortran installation is complete

I just installed Cygwin and am using it to run an open source software package which requires the use of a Fortran compiler. I have run setup-x86_64.exe and installed (I believe) all the Fortran ...
0
votes
1answer
73 views

How do I run a command as another user?

I’m using the following version of Linux [me@ip-99-99-99-99 myproject]$ uname -a Linux ip-99-99-99-99 99.99.99-99.99.amzn1.x86_64 #1 SMP Mon Sep 14 23:20:33 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux ...
2
votes
3answers
45 views

Restore shopt -s nocaseglob setting to default in OS X

In trying to make Bash for OSX TAB-Auto-Completion to be Case-insensitive, I followed a suggestion to run these commands: shopt -s nocaseglob bind 'set completion-ignore-case on' How do I restore ...
0
votes
1answer
32 views

How to bash complete an alias as the command [duplicate]

I have an alias alias gi=git Unlike git, gi cannot complete on subcommands, paths, branches. How can I tell bash to "complete X as if it were Y"?
0
votes
1answer
48 views

Shell Script to pass arguments to another script

I am new to the linux and shell scripting. I have a script, which has some read commands in it. So, something like #script1.sh echo "something here" .... read var1 read var2 ... Now, i want to ...
0
votes
0answers
12 views

registering an application in the Registry/../AppPath WITH flags

What I would like to do is to have Git Bash open through Visual Basic Process.Start() with the --login -i flags already set. To do this, I realized I need to have the shell file added to the registry ...
0
votes
1answer
16 views

How to start a program on user login

On Debian Lenny with KDE. I added a command to the bottom of $HOME/.profile to open transmission so my complete .profile looks like this: (everything except the last line is default) ... # if ...
1
vote
4answers
162 views

cat all files except a select few

If there some particular syntax so that I can cat all files in a directory, except for the select ones. For eg., suppose I have ~1200 text files containing some lines, about 3 or 4 lines per file, ...
0
votes
1answer
84 views

shell environment setup for virtualenv/virtualenvwrapper

The question is about shell setup for virtualenvwrapper, an extension to virtualenv (python guide). Similar questions had been asked many times but with a lot with different answers: Environment ...
0
votes
1answer
71 views

linux command to find out if folder exists or not in a windows ftp server

I have connected a Windows server from a Linux machine via ftp. I want to find out if a particular folder exists or not in the Windows FTP server. How do i find out that using Linux shell scripting? ...
-1
votes
2answers
46 views

A bash script to call itself and return a value

I'm trying to count the number of files inside a directory while checking the sub-directories with the same script itself and sum up the results. #!/bin/bash var=0 var=$(ls -l $1 | grep "^-" | tr ...
1
vote
2answers
54 views

how to find closest folder in the command line

Suppose the command :pwd returns ~/Users/MyUser/FolderA/FolderB I want to write a script where I don't know in advance that I am in FolderB, as I can be in FolderA or even some other external ...
2
votes
1answer
57 views

Whitelisting commands a user can use with sudo

I've been attempting to set up a whitelist of commands a user can run on my system. The server I'm using is running CentOS 7. What is the syntax that should be used to only allow a certain group of ...
0
votes
0answers
37 views

How can I wrap a sensible text file with a Bash script that allows every user to grep for $USER?

So I have a file data.txt that stores user name and some piece of data, one line per user. I'd like to have a Bash script that is runable by the users and allows them to call grep -w "^$USER" ...
2
votes
0answers
38 views

Many cron -f processes on unresponsive server

My Debian server had again become unresponsive and needed to be restartet (SSH login impossible, no longer transmitted log data to another server's MySQL Database, no new FTP connections possible, but ...
1
vote
1answer
44 views

How to get csvkit to recognise long ASCII lines?

I am using Ubuntu and I downloaded this CSV file, which file tells me is encoded like: ASCII text, with very long lines, with CRLF line terminators However, when I pass csvcut -e ASCII datafile, I ...
0
votes
1answer
35 views

What does the second field in ls -l mean on OS X? What does “number of links” mean?

I'm on an OS X operating System, and I don't understand what the second field in the ls -l command is supposed to mean. Say I am inside an empty directory, and I create a single directory inside of ...
0
votes
1answer
116 views

bash - find string index position of substring

good day all I am not able to see my error, I would like to find the position of a substring "searchstring" within string "t" of a few methods I have looked at, this seems easiest and most ...
1
vote
1answer
37 views

cat file contents to temp file but file/folder doesn't exist

good day all this is part of a larger function, but I get this error and can't figure out what is the problem: script name "connected.sh" running this cat "$logfile" | grep "$searchstring" ...
1
vote
0answers
39 views

Truncated input when piping to another command in Bash in Mac OS X

I used to be able to handle piping just fine, but recently I’ve been having problems with Bash truncating output when it’s piped into another command. What could be causing this? I'm using Bash on ...
1
vote
1answer
22 views

bash/readline doesn't autocomplete directory name

I have an executable in a subdirectory of the current directory: ~ $ ls -l src/users -rwxr-xr-x 1 me users 1001K Nov 17 18:52 src/users* I try to execute it by typing sr and then clicking tab. ...
1
vote
1answer
136 views

bash - return array from function and display contents

good day all after some bash self study and expermenting, I am stuck with returning an array from a function, and for the life of me can't see my error. in short, what this should/must do is by ...
2
votes
2answers
78 views

Unbound keys in ReadLine

About using Readline with Bash: $ cat ~/.inputrc "\C-[[Z": complete-command "\C-[[23~": history-search-backward "\C-[[24~": history-search-forward Now in Gnome terminal F11 and F12 key search ...
2
votes
0answers
39 views

Bash script: change to a directory with special chars

I have a bash script that goes through my music collection and downloads missing covers. The problem I have is that I can't cd to some directories which has '&' '(' and other characters. The ...
0
votes
1answer
51 views

execute su with additional commands

I want do something like this: sudo su -l <user> cd <somedir> But whenever I give su additional arguments after 'user', the command returns instead of giving me an interactive shell.
0
votes
0answers
44 views

Optimising AWS Resource Usage

I have a 10000 process -bash processes- and doing a curl request in same time. System is Amazon AMI Linux and i blocked by system wide (process limit) and i guess network limits. Computer have 36 cpu ...
2
votes
1answer
24 views

Basic Bash - If/Then with Boolean Operator

As you can see I set up a simple script to ping google(8.8.8.8) that should respond back with "Good Ping" if [ "ping -c 1 8.8.8.8 | grep 64 | cut -c 1-2" == '64' ]; then echo "Good Ping"; fi But ...
0
votes
0answers
40 views

Error with Bcrypt and Drywall

I have been having errors installing bcrypt on windows so i moved to a mac and now I am still getting errors. Can anyone tell me what this means or how to solve it: 1 error generated. make: *** ...
35
votes
6answers
2k views

A more comfortable way to edit a long $PATH?

I want to add, in ~/.bashrc, a few directories to my $PATH. My $PATH is quite long so it's a bit hard to see what directories it contains and in what order. I know I can modify my ~/.bashrc to be: ...
0
votes
0answers
35 views

Ping multiple domains from file and out only desired IP

Need bash script to ping multiple domains from file and output just domains with adress ip : 1.2.3.4 exemple (domains.txt): www.google.com support.mozilla.com stackexchange.com support.mozilla.com ...
1
vote
2answers
45 views

What is the difference between working on a machine and doing the same task over ssh?

I have been working at University on a local machine which is on a server that I have access to. I have some c code and am able to carry out parallel runs of the code as expected. However when I ...
1
vote
2answers
27 views

insert a string between two patterns

I would like to change file with name like: d1-a2_A1_B1.txt abcd_A90_B2.txt where I want to insert _FOO in between first _A[0-9]\+ and _B[0-9] so the file names becomes d1-a2_A1_FOO_B1.txt ...
2
votes
1answer
27 views

How can I modify Notepad++ here delim?

I want to document bash scripts with perl pod comments, as explained here. cat<<=cut perlpod =cut Unfortunately, notepad++ does not consider the = character as being part of the here delim, ...
0
votes
1answer
33 views

SVN commit from bash script WITHOUT a password

I have a bash script that needs to check in the result of a test into SVN. Problem is that whenever I commit to svn, it requires a user name and password which I really REALLY don't want to include ...