The default Unix shell used by Terminal in Mac OS X

learn more… | top users | synonyms

6
votes
4answers
3k 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
784 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
750 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
554 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
8k 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
303 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
979 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: ...
6
votes
2answers
2k 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
253 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
642 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
603 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
793 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
987 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
223 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
454 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
486 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
861 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
621 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 ...
6
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
663 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
2k 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
224 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
1answer
2k 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
508 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
50 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
378 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
742 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
304 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 ...
30
votes
3answers
7k 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 ...
1
vote
3answers
724 views

-Bash command not found appearing every time I start terminal

every time I start my terminal, it always says "-bash: .: command not found" twice. Does anyone know how I can get rid of that?
6
votes
2answers
2k views

What option should I give the sudo command to have the password asked through a graphical interface?

This problem has ben bugging me for a while now. Every now and then, I need to write a script file that should execute sudo commands. I do not necessarily know in advance that I will run as sudo so I ...
2
votes
2answers
996 views

Bash shell script to locate and remove substring within a filename

I am trying to write a bash shell script (which is called by an Automator Action) to rename TV show DVD rips that I have named badly over the years. I want to remove part of the text in the filenames. ...
2
votes
1answer
385 views

Always show service in contextual menu

Sometimes when I create a service in Automator, I want it to always appear in the Finder contextual menu, not just when I have a selected a file or folder. The services are always either pure ...
26
votes
3answers
9k views

Is bash in OSX case-insensitive?

Are bash commands on OSX case insensitive? I type "which TR" and it shows /usr/bin/TR, though there is no such binary there. Same thing for other binaries, when capitalized. Or is Terminal.app maybe ...
3
votes
5answers
3k views

Why do I have to source ~/.bash_login every time I open Terminal

When ever I close and open Terminal.app, it never loads my ~/.bash_profile. I have my RVM setup at the top of the file but it never loads it. As you can see, when I type rvm into Terminal, it says ...
1
vote
2answers
238 views

show battery in prompt and have it update after every command

i just fresh-installed Lion, and i am in the process of seeing up my system. i am using this function (found somewhere online...) to show it in the prompt : battery_status() { maxcap=`ioreg -l | ...
2
votes
1answer
293 views

Add info to Dock/Menubar from Shell in macOSX

I'm working on MacOSX environnement, but I would like to tweak it a bit. I have a few bash scripts I used in Linux to retrieve infos such as IP, average ping and so, that I would like to be displayed ...
6
votes
2answers
2k views

Changing Terminal colors when ssh-ing into remote machine and back

Looking for a way automatically change terminal colors when ssh-ing into remote machine and revert back to the default colors, when exiting the ssh session. Simply, want have another colors when i'm ...
2
votes
1answer
378 views

Mac Terminal: emacs-style command editing messed up

This has been a "quality of life" issue for me for a while now- command-line editing in the Mac terminal is messed up for me. If I type a few chars, and then hit CTRL-A to move to the beginning of ...
1
vote
3answers
2k views

How to dim (and un-dim) display in automator

For those that are interested in the final script you can get it here original question I am trying to make a alarmclock script to wake me up. but I can't figure out how to change the screen ...
2
votes
4answers
4k views

Find logged on user and network home directory with a bash script

I am trying to use a script to find the username and home directory of the user that is currently logged on to a Mac. This is what I have, and it works, but is there a better (i.e. simpler) way to do ...
1
vote
2answers
354 views

Rsync Backup Script

I'm having some issues backing up some data. Basically, I have FileVault enabled on my Macbook Pro and want to backup a folder I use - however, I don't want to use Time Machine (at work, I have one ...
0
votes
3answers
123 views

Is there a way to turn on indicator that a directory item is a shell script in Terminal?

When I do an ls of a directory and a shell script is listed as a directory item, is there a way I can have a visual indication that it is a shell script ? For example: From /opt/local/bin ls -l ...
3
votes
3answers
5k views

Where are environment variables specified when .profile, .bash_login, .bash_profile cannot be found?

When I type env at the terminal prompt, I get a dump of all the environment variables. When I check / or ~, however, I do not see a .profile, .bash_login or .bash_profile. Where is this being stored ...
10
votes
4answers
1k views

Updating modifier key mappings through defaults command tool

I am trying to automate the inital setup of my macbook, that includes installing software and changing OS X configuration to my needs. I have tried to update the modifier keys with defaults, the ...
3
votes
3answers
2k views

Opening a terminal window to a specific directory from a bash script

How can I write a bash script in Mac OS X that opens a Terminal window in a specific directory? I'd assume something like: open /Applications/Utilities/Terminal.app But that does nothing (maybe ...