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

learn more… | top users | synonyms

0
votes
1answer
17 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
20 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 ...
-2
votes
1answer
34 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" ...
0
votes
1answer
12 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
11 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
16 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 ...
0
votes
1answer
18 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 ...
0
votes
1answer
27 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
35 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 ...
0
votes
3answers
18 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
8 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: ...
1
vote
1answer
25 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
1answer
31 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
3answers
37 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
9 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 ...
1
vote
0answers
12 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 ...
0
votes
0answers
10 views

custom dotfiles sourcing ~/.bash_profile

I am trying to create my own dot files. In the root folder I have an installation script. I am watching other repositories like Lars Kappert to create this. I am using oh-my-zsh. I created the ...
0
votes
2answers
47 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 ...
-1
votes
0answers
28 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 ...
2
votes
1answer
23 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 ...
-1
votes
0answers
12 views

How to prepare clipboard in ubuntu before it will be pasted to anywhere [on hold]

I want to have some keyboard shortcut, which will be work seems like Ctrl+V shortcut, but before pasting some program will run and prepare clipbord. Is it possible in ubuntu? Can anyone help me?
-1
votes
0answers
17 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
26 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
36 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
19 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
29 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
1answer
16 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
0answers
14 views

How to auto execute my script

I want to auto execute my script when I login to putty session on my system. My script is residing in my /home/alih directory. Script change the current directory to my working directory.
1
vote
0answers
19 views

Iptabes and PSAD [closed]

I have a couple questions regarding my iptables configuration. First off I am still relatively new to iptables configurations, I am going over guides and books but progression is slow. When I ...
1
vote
1answer
38 views

How do I list all installed packages from the command line in bash / osX

What is the -bash command to list all the packages installed locally on my machine? I am using osX. I tried the following so far: dpkg -l - doesn't work. apt --installed list - doesn't work. ...
0
votes
1answer
9 views

Quotes in sed when used in bash script

I am generating sed expression in Bash script, and I am having a following problem. I want to add a space in front of each appearance of abc. This commands works as expected echo abc | sed -e ...
0
votes
1answer
34 views

cron job does not wait end of process

I made a script which execute commands and others scripts. Some of these actions take time. When I execute my script manually from the cli, it work fine waiting the end of each instruction before go ...
1
vote
0answers
20 views

Clean way to automate terminal commands in multiple windows and return to prompt in each?

So, as part of my workflow right now, anytime I pull up a project I open two terminal windows alongside it - one to manipulate and monitor git, and one to manipulate and monitor gulp/grunt. As it ...
3
votes
1answer
16 views

splitting separate bashrcs for different purposes

I was wondering if I can split my .bashrc into separate parts, and linux will pick up both files and use them correctly. I have general purpose scripts like 'cleanproject', and scripts that are only ...
0
votes
2answers
30 views

Bash: What command can I use to redirect the entire contents of my current Terminal window to a text file?

Lets say, I have a bunch of text in my Terminal session since the window was first opened (or since the last "clear" command was used), and exactly all of that is what I want in a text file. Instead ...
0
votes
1answer
20 views

Limit find request to one result

I've got the following command which should recursively go down folders and get the last modified date - which is perfect. However, sometimes it brings back more than one result for some reason. How ...
1
vote
2answers
46 views

Renaming hidden files to their filename sans .. (double dot)

I accidentally ran a script that added a ".." infront of a variety of files. ie. originalfile ==> ..originalfile Now I have a variety of files that are hidden. Being new to Linux commands, is there ...
0
votes
2answers
35 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 ...
-1
votes
1answer
17 views

bash change strings with multiple escape characters

Hello i try to automate for example change one variable in php file . root /tmp # cat defaults.inc.php|egrep "reply_all_mode" $config['reply_all_mode'] = 0; I try to first catch this by grep ...
0
votes
1answer
35 views

-bash-4.2$ for command line?

I don't know why when I SSH with putty onto my VPS, my command line starts with: -bash-4.2$ It hasn't ever been like that, it was myname@localhost Only thing I have done different in the last 24 ...
1
vote
1answer
26 views

.bashrc: command not found

I am trying to edit my .bashrc config, but when I try to access the configuration with: computer:~ home$ .bashrc I'm getting a: -bash: /.bashrc: No such file or directory error. Why isn't ...
2
votes
1answer
40 views

How to delete or move each image in directory of specific dimensions to new directory in bash

I'm trying to find a way to do the following (Google is only returning results for finding): Move all images of filetype (.jpg, .png, or .gif, etc.) of specified dimension(s) (such as 1920x1080, ...
1
vote
3answers
45 views

debian: permission denied for all users except of root

I wrote a bash script today which might destroyed some of my user settings and/or permissions. Now I know it was quite stupid to test the script on my live-system ;). What is not working? Every ...
-1
votes
1answer
37 views

$PATH not saving after exporting Imagemagick paths

I am trying to install Imagemagick using the official instructions. I have executed the three export commands: export MAGICK_HOME="$HOME/ImageMagick-6.9.2" export PATH="$MAGICK_HOME/bin:$PATH" ...
-4
votes
0answers
19 views

Need Bash Script for collecting info of other servers [closed]

i want a bash script that will use passwordless ssh to login to other three servers x,y,z from server A and collect the info from those three like df -h,uname,memory and save it to a file in Server A. ...
2
votes
1answer
145 views

Delete all not jpeg files

I have exercise, in which I have to delete all files, which are not jpeg. I tried find -type f |xargs file| grep -iv 'jpeg', but it doesn't work.
0
votes
1answer
26 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
35 views

Terminal does nothing when an unknown command is entered

When I enter a command which is unknown on my system, instead of getting the usual asdf: command not found error message, the terminal sits there doing nothing. If I terminate it, sometimes I see ...
0
votes
0answers
7 views

Static Routes startup scripts issue Debian 7

I think that is a bug of Debian 7, but maybe you have any other solution than crontab and add route add to /etc/rc.local I try to add static route during system startup, but all solution below not ...
0
votes
0answers
13 views

Why can't I git push from gTerm / MATE Terminal?

I'm running Linux Mint 17 'Qiana' MATE and have a strange issue with bash sessions initiated via Gnome Terminal: whenever I attempt to push code to our git repo via git push, the operation fails with ...