The default Unix shell used by Terminal in Mac OS X

learn more… | top users | synonyms

7
votes
2answers
2k 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
311 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'
1
vote
2answers
1k 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
2answers
2k 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 ...
1
vote
3answers
336 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
301 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
2k 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
915 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?
7
votes
4answers
17k 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 ...
0
votes
1answer
465 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 ...
4
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
172 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
964 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
388 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
855 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
170 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 ...
8
votes
5answers
4k 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
877 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
843 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
679 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
1answer
10k views

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

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 ...
3
votes
1answer
341 views

Screencapture Terminal command and then return to Shell script

I'm trying to run a shell script wherein I run the screencapture command, do a couple of modifications like file renaming, moving to Dropbox, shortening the url etc and then growling the url. Problem ...
2
votes
2answers
1k views

Creating wrapper script for Mail.app to send mail from Terminal

I'm trying to send mail from terminal with the help of bash and applescript. I use bash for taking care of arguments and the email message body. Then I have tried using Applescript to send the mail ...
1
vote
1answer
1k views

How to change bash version with homebrew

I have used homebrew to install the newest version of bash on my local system. I have added a symbolic link from: /usr/local/bin/bash to /usr/local/Cellar/bash/4.2.20/bin/bash and added the line: ...
7
votes
2answers
3k views

Make ls command sort by file type (e.g. directories and file extension)

How do I make ls sort by file type (e.g. directories first and then by file extension)? The answers suggested in (Super User) Make ls sort by file type result in unknown option errors from ls.
0
votes
3answers
276 views

Why does Terminal ignore capital “B”?

this happens to me from time to time: when I am using the Terminal, suddenly the terminal starting to ignore the capital 'B', regular 'b' works fine, other capital letter work fine. other applications ...
1
vote
1answer
685 views

Run a Cocoa application on Lion as another user

I'm trying to run an application as the user 'steve' with the window displayed on my desktop ( brendan ). This is what I have been doing so far. sudo -u steve open -a /Path/To/MyApplication.app ...
2
votes
4answers
761 views

List the extensions installed in Safari for Mac OS X, and state whether each one is enabled

I'd like a list, from which text can be copied. (Not a screenshot of preferences.) This information does not appear in any of the following: Safari System Profiler in Snow Leopard System ...
2
votes
2answers
1k views

Why does iterm2 close new sessions immediately?

I've made some changes to my .bashrc file in my new MacBook, mainly aliases for common commands. Shortly after, iterm2 immediately closes every new session or tab with the following cryptic message: ...
1
vote
3answers
1k views

How can I create a folder named like the current date in bash

So I'm messing around in my .bashrc making different aliases and playing with my prompt. I'm trying now to make an alias that will move into a specific directory, make a new directory based on the ...
2
votes
1answer
236 views

Long command in terminal.app cause a bug

If I am in the last line of Terminal.app and enter a long command, it does not create new line, but instead overwrites the same line. How can I solve this bug?
1
vote
1answer
485 views

Bash problem Mac OS Terminal

Hi when I pressed the up arrow to see the previous command, it rewrote the current command from half. Example: 21 /usr/local/sphinx/etc > /usr/local/sphinx/bin/search --config ...
5
votes
2answers
623 views

Strange behavior in Terminal with custom .bash_profile

It's hard to describe the behavior, but here's a short clip: http://www.youtube.com/watch?v=9KqHBA94FPI Basically, when entering multi-line commands, at the end of the first line, the insertion ...
4
votes
3answers
943 views

Bash script to toggle wifi in lion

Is it possible to have a bash script that toggle my wifi on and off? I am using lion (10.7.2).
2
votes
3answers
4k views

/bin/sh: rm: command not found

I have problems with some applications that use AppleScript shell script feature. For example, Growl's uninstall scripts shows an error: error "/bin/sh: rm: command not found" number 127 The source ...
5
votes
2answers
666 views

Smarter Bash Tab Completion

As a recent switcher from Ubuntu (Well recent switch backer if that's a word) I'm finding myself in the command line a lot more than when I was a mac user before. One thing I really loved about Ubuntu ...
8
votes
2answers
3k views

How do I reset the scrollback in the terminal via a shell command?

When using Terminal.app, you can clear the screen by using the shell builtin clear or by pressing ^+L (Control-L). However, all this does is push the current screen content back one screen height ...
4
votes
1answer
729 views

Accented characters and terminal redirection

I'm having problems dealing with accented characters in file names in the Terminal. Consider the following: $ touch leão.png $ ls > test.txt $ open -a TextWrangler test.txt The accented ...
2
votes
2answers
3k views

How can I exit “bash”?

I don't know how to get my .profile aliases back in to the terminal every time I try them, this error massage comes up: apaw:~ apaw$ cdp -bash: cdp: command not found How do i exit this -bash? I ...
3
votes
2answers
233 views

what is DELUXE-USR-LOCAL-BIN-INSERT in ~/.profile file?

My .profile file includes the following obscure lines. What are they for? ## # DELUXE-USR-LOCAL-BIN-INSERT # (do not remove this comment) ##
0
votes
2answers
3k views

How do I use arguments together with bash aliases

Today, I learned the very handy trick: man [some command] -t | open -f -a Preview I'd like to create an alias in my .bash_profile file as a shortcut. In order for this to work, I need to pass an ...
1
vote
2answers
512 views

What changes have been made to bash in Lion?

I am working on some bash shell scripting for a local login script and it works fine on Leopard and Snow Leopard but fails on Lion. I was curious if there was a place that listed the differences in ...
0
votes
1answer
53 views

Customizing the shell prompt causes some quirks

I have customized the shell prompt with the following code in my ~/.bash_profile, but there is one quirk left I can't seem to fix: export PS1="\u:\[\e[32;1;32m\W\e[m\] \$ " (code is also on github) ...
4
votes
3answers
435 views

In terminal, modify the text that comes before $

In terminal I can always see which path I'm in: macbook-romeo:School romeovs$ echo "example command" which I find quite useful. Yet there is a lot of unnecessary stuff here too: macbook-romeo is ...
2
votes
1answer
788 views

Run bash command with current URL as parameter from Firefox and/or safari

I'd like to be able, without much hassle, add a video to my Miro Download-queue. From bash I can do this by entering open -a Miro.app http://vimeo.com/24398084 Now I'd like to do this from within ...
1
vote
1answer
338 views

Correct syntax for bash grep function?

I'm trying to set up a function to make certain grep command easier. gr() { grep -r --include=*.\{m,h,xib\} $1 \* ; } The end result should be a recursive grep of all *.m, *.h, and *.xib files, for ...
5
votes
5answers
4k views

How do I restore my .bash_profile?

I've accidentally overwritten my ~/.bash_profile file. Does anyone have a "sample" one I could copy, or know where I might be able to find one?
3
votes
2answers
1k views

How do I make invisible files (like bash profile) visible in the finder?

question is in the title. There's some files that most Apple users don't need access to, but if you program you do need access to. in particular the bash profile. anyone know how to make these visible ...
35
votes
3answers
8k views

Is it safe to upgrade Bash via Homebrew?

I'm new to OS X. I'm running OS X Lion on a MacBook Pro. Is it safe to upgrade the bash shell using Homebrew: $ brew install bash If safe, how do I make it the default instance of the shell I run ...