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

learn more… | top users | synonyms

0
votes
0answers
6 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 ...
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 ...
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, ...
0
votes
1answer
15 views

Print Windows mapping of root path in MSYS Bash

In MSYS Bash I get: $ cd ~ $ pwd /c/Users/antonio but: $ cd / $ pwd / Can I get the full Windows absolute path from Bash?
-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
1answer
16 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
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 ...
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
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 ...
1
vote
3answers
126 views

When copying directories with sudo it copies just the first level of its hierarchy

This question was also asked here. When I copy some directory (dir) recursively with sudo in bash it copies just the first level of the dir hierarchy, but when used without sudo it copies the dir ...
0
votes
0answers
91 views

When copying folders with sudo it copies just the first level of folder's hierarchy [on hold]

When I copy some directory (dir) recursively with sudo in bash it copies just the first level of the dir hierarchy, but when used without sudo it copies the dir with all its subdirs, though commands ...
0
votes
3answers
13 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?
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
19 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 ...
1
vote
2answers
66 views

OS X Terminal wildcard doesn't work for some paths

Okay, this is weird, hopefully someone here can explain what is happening. I am using OS X 10.9.4 and I want to list files in a directory (and filter them using *) I want to look for zip files in ...
0
votes
2answers
26 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 ...
15
votes
3answers
585 views

How do I reduce a PDF's size and preserve the bookmarks?

I have a ~259 MB PDF. I did pdf2ps and ps2pdf. The final size was 45 MB. I don't see any visible difference in quality in any reader. Although, the bookmarks were lost. I tried using pdftk, but it ...
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 ...
81
votes
6answers
78k views

chown is not changing symbolic link

I'm trying to change the user/group of a symbolic link with the command: $ chown -h myuser:mygroup mysymbolic/ But it's not changing. I'm logged in as root. The current user/group is set to ...
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 ...
6
votes
6answers
1k views

How to write a script that accepts input from a file or from stdin?

How can one write a script that accept input from either a filename argument or from stdin? for instance, you could use less this way. one can execute less filename and equivalently cat filename | ...
10
votes
7answers
10k views

How do I queue multiple files for copying on a Mac?

When I copy multiple files on a Mac, the system tries to copy them all at the same time. The problem is two-fold. First of all, when you select multiple files and copy them, they all go into one ...
4
votes
2answers
375 views

on quit, 'less' does NOT clear its contents when run in a 'screen' session [duplicate]

Possible Duplicate: Using screen, commands like less and man don't clear the screen afterwards When I quit 'less' in a normal bash, it clears the previous contents displayed by 'less' ...
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 ...
1
vote
2answers
432 views

symlink of concatenated files?

In a Linux system, I have a set of very big files, containing a long list of entries, one per line, that are read one by one to create certain indexing files for each of them, that are then used for ...
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 ...
1
vote
5answers
4k views

How do I substitute environment variables when I ouput a file?

I'd like to somehow spit out a file (which has env variable references) and substitute the actual values. This is what I've tried, but as you can see it's not working. Any ideas? -bash-3.00$ cat ...
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
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
3answers
31 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
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` ...
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 ...
2
votes
1answer
1k views

How can I extract only some specific folders from a tar.gz archive?

Let's say I have the archive website.tar.gz, inside is the following folder structure : home -mike -www -coolwebsite file1 file2 file3 etc. When I ...
0
votes
1answer
22 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
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
2k views

“Reset” colors of terminal after ssh exit/logout

When I ssh into a remote server, I like the colors of the terminal to change. I use setterm on my remote ~/.bashrc file to get this done. However, when I exit, the terminal colors are not reset to the ...
0
votes
1answer
31 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 ...
3
votes
2answers
1k views

Is there a face recognition command line tool?

I've download a lot of images in one directory including People and Landscape. I want to split the directory into two. I'm looking for a Linux command line tool to filter by face.
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
192 views

How to automate shell script to run when I open a particular app in OSX?

I've been running into a rut recently with one project I've been trying to accomplish. Using Automator, but I don't know how to exactly to go about this project. There's this script editing app called ...
4
votes
5answers
255 views

Save command to history without executing in bash

Is there a way to save a command in bash history without executing it? e.g. $ cmd [a long list of arguments] and now during typing i remember I'd like to do something else first. Can I have ...
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 ...
1
vote
1answer
56 views

How to give each virtual terminal in GNU Screen it's own background color?

I have a dream: I want each virtual terminal within GNU Screen to have it's own unique background color. I think I can fake it in an .bashrc script that emits xterm control codes to set background ...
2
votes
5answers
3k views

Move all files in sub-directories to current directory?

I've got files in a bunch of subdirectories, and I'd like to flatten them out and move them all to the current directory. I found this question, but adapting the answer to: mv * . didn't work. I ...