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

learn more… | top users | synonyms

0
votes
0answers
4 views

Clean Mavericks Install: Bash and Environment Defaults?

Broadly: what are the default files in play on a clean OS X install when using environment variables and bash? What derives from root, and what from the local user? I always get turned around on ...
0
votes
0answers
5 views

CygWin shortcut to launch server, connect and start a program

I have miraculously only spent about 20 minutes getting an installation of cygwin to communicate with a remote box that I use for controlling my CNC machine. At this point, to get everything running ...
1
vote
1answer
19 views

Easily print out a spaces between larger data outputs in bash

I'm grepping through a very large web directory, and when I do multiple greps in a row, when scrolling up, it is difficult to tell when one result ends and an other one starts. I tried just clear, ...
-1
votes
0answers
13 views

Which open source program is similar to the Linux “dialog” command [on hold]

Dialog command is great command to view GUI dialog box But the non positive of the dialog is that we cant to locate the GUI window on the top of the screen or in the lower screen Dialog always show ...
0
votes
0answers
12 views

Temporarily switch Java version in bash script- Ubuntu Linux

I'm using the Java keytool as part of a larger bash script. I need to pass in a password to create a keystore, so used the command keytool -importkeystore -deststorepass:file ${somefile}. This ...
0
votes
1answer
33 views

Script to reference another file first

Hi I have a script and in it I need to get the hostnames from IPs that the script generates. The script will generate those IPs into 1 neat file with only 1 column. It is literally just IP address (1 ...
0
votes
1answer
15 views

Setting Terminal tab to current directory and program running

How can I make the terminal tab display <name of process running (vim, bash, ruby, etc)> - <parent directory/current directory>?
0
votes
0answers
17 views

How to view two dialog boxes on the linux console, running on the same time?

I want to view on the Linux console two dialog windows on the same time. I want a window that views the progress BAR, and the a second tailbox that view the logs are running. The problem is that the ...
0
votes
3answers
12 views

How do I close stdin in a shell script?

I have a misbehaving program that I need to call from my script. It exits as soon as it sees something on stdin. Is there a way to close stdin?
2
votes
2answers
25 views

One-line code in bashrc to edit pdf

I would like to have a one-line code in bashrc, for removing the first page of a pdf. The command to be typed in the bash prompt could of the form: cut name.pdf This command should remove the ...
0
votes
0answers
15 views

timer runing under bash script in dialog window

the following bash script is example how to use the dialog command this script run progress bar ( and display the process upgrade ) what is missing in the dialog is a time clock - that display every ...
-1
votes
0answers
7 views

linux + timer in the dialog window [on hold]

is it possible to insert the following code ( timer ) in the dialog progress bar ? date1=`date +%s`; while true; do echo -ne "$(date -u --date @$((`date +%s` - $date1)) +%H:%M:%S)\r"; done ...
0
votes
1answer
14 views

Light way to read big bz2 compressed files

bzcat *.log | sed # etc works but since the files are few gb big, it takes time to complete. Is there a way to do it in a faster way ? I tried echo *.log | xargs -P 4 bzcat | sed # etc but the ...
0
votes
1answer
17 views

Bash scripts are not working but on mac terminal those commands in scripts works

I'm stuck with a wired problem.My bash scripts are not working now.It worked previously.I don't know why.Interestingly the commands on the script work when I enter it directly on the terminal. This a ...
0
votes
2answers
25 views

Shell script to SFTP file to remote server

This is probably a question asked before, but I can't find a good question/answer. I need to write a shell script that will be called by PHP program (exec function) to move all *.pdf files to a remote ...
1
vote
0answers
18 views

How to change BASH “editing-mode vi” shortcuts?

I'm trying to change my bash vi mode keys to enter and exit insert mode, I would like to set these shortcuts: Ctrl-\ : Enter moviment mode Alt-\ : Enter insert mode how can I do that? I'm trying ...
2
votes
2answers
48 views

Recursively fixing image file extensions in Linux

I have a bunch of image files from misnamed scans/faxes I need to fix for our Linux users. It turns out we have a bunch of scans that are PNG files that are labled as *.jpg visa versa. Under Windows ...
0
votes
0answers
18 views

Bypass the $Recycle Bin in CygWin?

I'm using a CygWin session to find a large number of directories at a certain level in the file system tree in a loop, compress each directory into 1 archive, then delete the directory This ...
0
votes
3answers
44 views

How to copy multiple files and move them to multiple folders using terminal for Mac

I have a folder on my Mac's desktop called Bthepics that has 9 images that I want to copy and move to about 500 folders at once. These 500 folders are located in a folder on my Mac's desktop called ...
0
votes
3answers
30 views

Why is this echo command not working?

I want to overwrite /etc/postfix/master.cf with my own content. I'm using echo "<content>" > /etc/postfix/master.cf to try and accomplish this. But when I do: echo "# # Postfix master ...
1
vote
2answers
19 views

Run a command in another cygwin window and not exit

From current cygwin shell, I want to run a command(say, pwd) in another cygwin window, I use: cygstart /bin/bash pwd It did spawn a new cygwin window but close immediately. I want the window is ...
0
votes
2answers
35 views

ssh, scp or rsync for deploying built applications? [on hold]

I need to write a "deployer" bash script that will take a bunch of compiled/packaged Java applications and copy them to specific directories on our app servers. My options, as I see them, are ssh, scp ...
0
votes
2answers
28 views

How to execute multiple multiline mysql queries with a shell script?

I want to run multiple MySQL queries from a shell script. I'm using the following code: mysql -u <redacted> -p<redacted> servermail << EOF CREATE TABLE `virtual_domains` ( `id` ...
0
votes
0answers
26 views

Trap a program that has no command line output

I am using the CrashPlan backup tool to backup my home file server. I use an ssh tunnel to interact with the GUI on the remote machine (as detailed here). Currently, I have an alias in my zshrc that ...
0
votes
1answer
35 views

How to recover Kali linux password using LILO?

I forgot my Kali password and I tried getting into LILO single user mode but it still asks for root password (which I forgot). As a secondary measure I just ran init=/bin/bash The command runs but ...
0
votes
1answer
30 views

Using GNU screen to create a split screen environment from command line

Could someone please point me towards the syntax for using GNU screen from the command line. On a previous cluster, I managed to create a bash script that would create X number of tiled shells, each ...
0
votes
0answers
20 views

How can I get “ldd” on Mac OS X?

"ldd" is a Unix/Linux utility that allows you to determine "dylib" references within an executable file, typically created by gcc or g++. There is an Apple equivalent called "otool" that uses a -L ...
0
votes
1answer
25 views

What file does OSX Mavericks look at to setup environmental variables for terminal

I changed something on my Mac and when I start terminal by simply clicking on the icon, none of the PATH variables are loaded to tell terminal where basic (or any commands) are. I have edited the ...
0
votes
2answers
34 views

how to clone a directory list to another directory

I am trying clone a directory and it's subdirectories into another directory. I have hundreds of music directories with sub-directories that I want to convert from flac to ogg. I want all the music ...
0
votes
1answer
21 views

I'm trying to mirror dns queries generated by TCPDUMP filter and replay them with dig or any other utility

I'm not a very experienced script writer at all. I did find some useful hints in generating an stdout from tcpdump that generates a live feed if you will which is what I want, the problem is handling ...
0
votes
1answer
22 views

Why is “java” a valid command in terminal (bash) if it is not in my path?

On OSX, in the terminal, using the command: echo $PATH Gives me the following output: ...
1
vote
3answers
39 views

How to use grep on a variable or string?

I'm writing a bash script and I need to check if a file name has a number at the end (after a period) and if so get it, but I can't figure out how to use regex on a variable or string. I was able to ...
0
votes
0answers
18 views

iTerm/OSX Terminal: Change text margin from edge of window

Currently, I use iTerm on OS X. My terminal looks something along these lines: I came across this picture of a terminal setup on GitHub, and I wanted to imitate it: Specifically, I wanted to ...
1
vote
2answers
29 views

Run a script post login linux

I would like to run a script after a linux user logs in to do some additional security checks. The user should first login normally using their password, but then be checked with my script, and then ...
0
votes
1answer
27 views

Ubuntu equivalent command to Windows tasklist command

I have a couple lines in PHP to check if a specific process is currently running on my server. If the process is running, I include a script that is used in to interact with said process. Below is the ...
1
vote
0answers
21 views

Can't resume editor running as root

For years, when I have been working over an SSH connection, I will run sudo vi ... to edit a config file. If I need to do something on the command-line, I'll hit Ctrl+Z to suspend the editor, do ...
0
votes
0answers
14 views

Daily crontab with hg, git and svn

Hello I have made a script that updates some repos from git merc and svn, then updates a git repo. The script works manually but doesn't work in crontab, here is the script: #!/bin/bash cd ...
0
votes
1answer
17 views

.bash_history does not exist

Working in AWS I created an instance of Ubuntu 14.04 and noticed the history was not preserved between login sessions. Further investigation showed the .bash_history file did not exist. Why was a ...
0
votes
0answers
18 views

git-svn creates directories but doesn't check out content

I am migrating an SVN repository to Git using git-svn combined with some light bash scripts on Ubuntu 14.04. Locally. git-svn has worked fine so far (on Unix), but recently, it sort of gets stuck ...
0
votes
2answers
43 views

Move and rename files based on their parent's directory

I have a collection of directories that all contain a particular file that is named the same in all the directories. dir1/dirA/file.txt dir1/dirB/file.txt dir1/dirC/file.txt .... dir4/dirX/file.txt ...
0
votes
1answer
22 views

MSYS2 home folder: show ~

I've just installed MSYS2, and to have it use my Windows user folder as $HOME, I put this in /etc/bash.bashrc: HOME=$USERPROFILE And that works fine when I just run cd, except the prompt doesn't ...
0
votes
2answers
44 views

How can I colour-code files and directories in my shell environment?

I've seen many screencasts online in which the files and directories are colour-coded differently for ease-of-use. I'd like to achieve the same on in my bash terminal, on OS X 10.9 and using iTerm2. ...
0
votes
2answers
47 views

How to delete half of the files in a directory?

A directory has files with names ending 001 to 100. How can you delete 2,4,6,8...100. And can that be written as a script. As soon as the directory becomes week old, this has to run. And after a month ...
0
votes
1answer
23 views

bash auto-complete separates strings

Let's say I'd like to cd to the directory containing all albums by the artist "The Ghost of a Saber Tooth Tiger" so I start typing cd ~/Music/The\ Ghost and hit [TAB] [TAB]. At this point bash ...
0
votes
1answer
21 views

Creating a debian package or bash script?

I have started down the path of virtualizing my desktop to ease development...I am currently running VirtualBox with Debian running as a staging server...I am about to start the process of building a ...
1
vote
2answers
32 views

Script to join columns

I have two files: The output of yum list installed which is now yum_installed and yum list updates now as yum_updates What I need is to basically join the two files somehow but ONLY based on the ...
2
votes
4answers
87 views

Detecting known computer on public network in BASH

Anybody know of a way through BASH (specifically OSX terminal, but I'd prefer a BASH only solution without OSX' in built functionality) to detect a known computer on a public network (that I am also ...
1
vote
4answers
163 views

Shell script: ssh to remote machine, then exit: 'exit' does not work

I have a shell script of the following type: #!/bin/bash ssh mylogin@myremotemachine.com echo "Hi" exit I run it locally to do something on a remote server (represented by 'echo "Hi"'). However, ...
-1
votes
0answers
16 views

How does sudo decide whether a command is only executable by sudoers with ALL rights? [migrated]

I just wondered why on a Debian system with sudo installed a default user can execute ls but not ifconfig since the binaries do have the same rights: -rwxr-xr-x 1 root root 114032 Jan 26 2013 ...
1
vote
5answers
36 views

Turn comma-separate rows into 1 column

I have a list of users basically from /etc/group, Id like to basically format that line into one column, I just need the users. So if a field looks like this: bob,john,jane,sam,joyce Then I'd like ...