The default Unix shell used by Terminal in Mac OS X

learn more… | top users | synonyms

1
vote
1answer
613 views

Set terminal window title in a script

I would like to change the entire title of the terminal window for a particular bash script. I googled out but I couldn't find much more than this suggestion: printf "\e]0;My Custom Title\a" After ...
3
votes
1answer
1k views

How do I batch set the files “date modified” to the “date created”?

I have a folder with a bunch of photos taken by two different cameras, with one camera having been set to the wrong date. I managed to correct the EXIF date using Picasa (see photo.stackexchange), but ...
1
vote
1answer
427 views

How can I set Last Modified Date of file after using HandbrakeCLI to convert a file?

Running this on OS X Lion. I'm batch converting several hundred home movies using Handbrake CLI. I'd like to set the last modified date and created date to that original file. I'm using the ...
0
votes
1answer
320 views

Can't create alias for 'nano ~/.bash_profile'

I tried to make an alias to edit my bash profile, but when I save and relaunch a new window, I get the following: Last login: Sun Jul 22 12:00:25 on ttys001 -bash: alias: nano ~/.bash_profile: not ...
0
votes
1answer
382 views

tmux on Mac, how can I enable vi mode for the command line

I want to be able to hit escape and then use vi navigation keys like b (back a word). I can do this in my regular terminal sessions by setting set -o vi in my .bashrc file. However it's not working ...
2
votes
2answers
1k views

How do I install a2ps for better printing?

How do I install this program so that I can do postscript printing? Currently I get -bash: a2ps: command not found
1
vote
3answers
120 views

At the command line, how can I 'arrow along' faster using words instead of chr's

I am at the command line and I have . /this/set/of/directory/this_command "parm1", "parm2", "parm3" When I 'up-arrow' to recall previous lines, how can I move along the line from "word to word". ...
6
votes
2answers
1k views

Change my shell to a different bash version at /usr/local/bin/bash?

How can I set my /usr/local/bin/bash (which is the 4.2 version that allows auto-completion of 'cd to directory with directory name') to be my default bash for a new window instead of my regular ...
0
votes
3answers
2k views

Change owner for all files owned by x

I copyied files from my MacBook, mainly files from /usr. The one and only user on my computer is called 'Julian' (like on my MacBook). A lot of the copied files are now owned by '501' (id of "Julian" ...
76
votes
4answers
33k views

git auto-complete for *branches* at the command line?

On my linux machine I have autocomplete for branches with git. For example I can type git checkout [TAB] and get a list of branches. Or I can type git checkout feb* [TAB] to get all branches that ...
0
votes
2answers
959 views

Executing program through Terminal

I have Sage (math program) and I want to execute it through terminal. I know I can go to the directory and execute it with - open Sage.app But would I really want to do is simply type sage in ...
2
votes
1answer
675 views

Why doesn't the screen command source my .profile?

When I start a new screen, the aliases that I have set in my ~/.profile do not seem to be sourced. Does anyone know where I can change this or which file is actually read when starting a new screen?
0
votes
1answer
1k views

How can I start postgres automatically on startup?

I can start postgres with: # Start Postgres /usr/local/bin/pg_ctl -D /usr/local/pgsql/data -l logfile start Where can I put that to start up when I start the machine up? I can put it in my ...
11
votes
2answers
2k views

cd to a directory by typing its name?

For example if a directory 'blob' exists and I just type 'blob[return]' then the system cds into the blob directory for me. In Linux (Ubuntu) I can add shopt -s autocd to my .bashrc file, but on OS X ...
1
vote
1answer
76 views

.bash_profile not running with multiple commands

I am having an issue with my .bash_profile script. If I simply have the line source ~/sh/bashmarks.sh the bashmarks.sh script runs as expected. However, if I add an alias source ...
2
votes
2answers
354 views

Need a bit of help running a couple lines of bash in applescript. Maybe straight bash is best?

Preface this by saying I will be launching this script whether it be applescript or bash script with Alfred.app. Sorry to be so blunt and unknowledgable but I need to run a couple lines of bash in an ...
0
votes
1answer
994 views

cd 'brew --prefix': no such file or directory

After these errors: > brew update fatal: 'origin' does not appear to be a git repository fatal: The remote end hung up unexpectedly Error: Failure while executing: git pull -q origin ...
0
votes
1answer
837 views

Can't get commands inside .bash_profile startup script to run

From my bash shell (latest version of Lion) if I issue the command... source ~/sh/bashmarks.sh The bashmarks.sh script will run and the functionality it provides is available. However I don't want ...
1
vote
1answer
451 views

How to add a directory to my path that includes a colon and a space?

I installed MIT/GNU scheme and am trying to add the directory to my $PATH variable so that I can run it from Terminal. The app name MIT:GNU Scheme.app is a veritable "perfect storm" (for path names) ...
4
votes
2answers
5k views

Bash commands that work on an iphone

I've jailbroken my phone, and I'd like to execute some commands on it from my phone, namely, the Say command. That, unfortunately, does not work. What commands COULD I execute on the iphone, other ...
10
votes
4answers
4k views

AppleScript vs. Bash script?

I'm a long-time Windows "power user" and developer who has recently decided to move over to Mac OS X. On OS X Lion and indeed previous versions there seem to be two main options for scripting and ...
5
votes
3answers
3k views

Is it possible to have bash escape spaces in pwd?

I'd like to copy the current directory to the clipboard, something like: pwd | pbcopy. However, pwd does not escape the space, so something in "Application Support", for example, doesn't copy ...
2
votes
1answer
534 views

This script randomizes a MAC address--but I cannot renew DHCP afterwards

#!/bin/bash NEWMAC=`openssl rand -hex 6 | sed 's/\(..\)/\1:/g; s/.$//'` ifconfig $1 ether $NEWMAC ifconfig $1 down ifconfig $1 up I pass en0 or en1 as the sole argument to the script and run as ...
0
votes
0answers
2k views

using -exec command on mac os x

Does any know why the -exec does not work on mac os x lion terminal? It works on linux and other variants but not on mac os x find / -iname "*.mp3" -exec mv {} /mnt/mp3 \;
4
votes
1answer
480 views

Why does my Terminal command line screw up like this? (bash's fault?)

When I use the command line history ( CtrlR , CtrlP ) The command line screws up like this: The cursor is supposedly located at the end of the line ( just pressed CtrlE ) If I press enter, just ...
4
votes
1answer
390 views

How do I find where an environmental variable got set?

I installed a program to try it out, and decided I didn't like it so I moved the app to the trash. Today, in my shell, I noticed that there are a couple of PROGRAMNAME_BLAHBLAH environmental ...
2
votes
1answer
503 views

bash file recovery?

I think I messed up my bash file /bin/bash when trying to create my first script, it displays a message saying "process completed" and locks my terminal, if I switch to another shell e.g sh, then it's ...
1
vote
4answers
4k views

Executables in /bin and /usr/bin are not found in path

Somehow I can’t execute files in /bin or /usr/bin without providing the full path. This isn’t happening when running from Terminal, but, for example, iTerm can’t run bash (only /bin/bash), OnyX ...
9
votes
2answers
3k views

What is the difference between .bash_profile and .bashrc?

To make an alias for the Terminal in OS X, you can either put the aliases in .bash_profile or .bashrc. What is the difference between the two and why would I choose to put aliases in one and not the ...
3
votes
2answers
456 views

How do I add a flag to an alias?

Is it possible to add a flag to a bash alias you create yourself? e.g. con -a = 'ssh username@server1.domain.com' con -b = 'ssh username@server2.domain.com'
2
votes
2answers
2k views

iTerm2 terminals close immediately with “argpath=login error=No such file or directory”

Whenever I try to open a new terminal window in iTerm, it closes right away after displaying this: ## exec failed ## argpath=login error=No such file or directory Does anyone know what is causing ...
3
votes
3answers
3k views

How to make bash (Terminal.app) remember history of previous sessions?

In my computer at work, my bash shell remembers history from previous sessions, even if I just opened a new terminal. In my computer at home, this doesn't happen. I have the same OS 10.6.8 in both ...
2
votes
3answers
482 views

How can I change the default bash look?

My bash is white and black and I would like it to look much more colorful, how do I do that?
1
vote
1answer
402 views

How do I run Octave from a different directory?

I have recently installed Octave, a MATLAB clone, onto the following directory: /Applications/Octave.app/Contents/Resources/bin/octave I want to run it from a shell command prompt from a ...
5
votes
1answer
3k views

Why is a command line change to ~/Library/Preferences/com.apple.LaunchServices.plist not effective immediately?

When the Info window of Finder is used to associate files of a particular type with an application: the preference is effective immediately. When Terminal is used to make a comparable addition ...
1
vote
4answers
2k views

How to obtain Bluetooth ID (OS X)

I need to remotely grab the Bluetooth ID from multiple machines throughout my network. What are the best ways to remotely obtain the Bluetooth ID in OS X?
9
votes
4answers
27k views

How do I execute a bash script that requires root privileges?

I have this script lines from my ISP: sudo bash echo "plugin L2TP.ppp">>/etc/ppp/options echo "l2tpnoipsec">>/etc/ppp/options It works if I paste line by line into Terminal. I want to ...
3
votes
2answers
665 views

Allow the Terminal.app to pass command key based keystrokes to terminal programs

I want to allow programs running in the terminal the ability to interpret the keyboard short cut Cmd + S I have already Remapped the Terminals' default binding of Cmd + S to Ctrl + S via the ...
5
votes
2answers
2k views

How do I make find fail if -exec fails?

When I run this command in the shell (in a non-empty directory): find . -exec invalid_command_here {} \; I get this: find: invalid_command_here: No such file or directory find: ...
1
vote
1answer
201 views

How come compiling my .tex file with my alias is lagging?

I have written an alias in ~/.bashrc to compile my tex files into pdfs. I am sure that ~/.bashrc is sourced. alias p='rm -f *.pdf *.log *.aux;pdflatex *.tex;open *.pdf' However, after I edit my ...
2
votes
2answers
3k views

Is there a Mac equivalent for UDEV folder on linux?

I am writing a script which should backup my Documents folder onto a USB stick. I want the script to be executed every time I connect the USB stick. I found a solution here. But it seems like I can't ...
3
votes
1answer
1k views

Why don't my aliases in .bashrc work?

I have Lion on my Mac Air. I wrote some aliases in ~/.bashrc file, which looks like: # Aliases alias p='pdflatex *.tex;open *.pdf' alias bromine='ssh administrator@bromine.org' I then sourced my ...
4
votes
3answers
489 views

How to search for a file by a hash value with bash script (terminal)?

I am writing a script for Mac OS X Lion 10.7 and I would like to know how I can search for files based on their SHA1 hashes. I would like to search the whole file system for the file(s) I will be ...
5
votes
2answers
2k views

Can sudo use my existing aliases?

How can I let sudo use my existing aliases in my .bash_profile (or .bashrc, .profile …)? For example I want to be able to use ll instead of ls -laGF as sudo.
2
votes
2answers
175 views

Lion Fullscreen Desktop Switching Quirk

I make Java programs, many of which require input from the command line before they actually open a window. When I'm using the Terminal in fullscreen mode and I run java Program, it jumps over to an ...
11
votes
6answers
7k views

sourcing bash profile for root users

Apologies in advance if this question is going to annoy the hell out of everyone as I appreciate, it's been asked in various ways many times before. Please be assured, I have read the archives and ...
1
vote
1answer
1k views

listing all processes in iOS 5.0.1

How could one go about viewing all the processes in an ssh session to my (jailbroken)iphone? I'm currently able to ssh in, I have bash installed, core utilities installed, shell-cmds package installed ...
2
votes
1answer
986 views

How to use zsh and bash on iTerm2 at the same time?

Zsh is better than bash(obviously), but for some reason, from time to time I have to use bash. I am wondering is there any way for me to use them together without changeing them manually? What I ...
0
votes
1answer
1k views

What is the Apple_PubSub_Socket_Render environment variable for?

After running: env ; #from with in terminal I see the following output: ... Apple_PubSub_Socket_Render=/tmp/launch-pc2V6P/Render ... What is this environment variable used for? Not really ...
6
votes
2answers
15k views

Why must I source .bashrc every time I open terminal for aliases to work? [duplicate]

I added this line into my ~/.bashrc file. alias myserver='ssh davidfaux@davidfaux.com' However, when I open terminal and run myserver, terminal complains that -bash: myserver: command not found ...