The default Unix shell used by Terminal in Mac OS X

learn more… | top users | synonyms

13
votes
2answers
2k views

Why do I need to put sh before running .sh files?

When I want to run .sh files in Terminal, I need to put sh in front of them. Is there any way to avoid this, and thus save typing?
1
vote
0answers
55 views

What's the /home directory for, or did I just accidentally create it?

I saw reference to a bash command, cd /home, in a multiple choice quiz about navigating within Terminal. I tried it, expecting -bash: cd: /home: No such file or directory, but to my surprise it took ...
7
votes
4answers
99 views

How to list installed versions of the same program

I have a program called PyMOL installed multiple times on my machine. One was installed by MacPorts, one was installed through the developers distribution channel and so on. One is in /opt/local/bin, ...
2
votes
1answer
128 views

How can I send the current working directory from bash to Terminal?

I set up a very nice custom bash prompt in .bash_profile, but I noticed that I've now lost the ability for new tabs to open in the same directory, and the ability to see the current working ...
0
votes
2answers
40 views

wacked a directory from the command line

I was copying a file to /usr/local/bin from the commandline on a Snow Leopard Server 10.6 ... anyhow i typed the following ... sudo cp ./le /usr/local/bin Ouch ... that missed last forward slash ...
2
votes
1answer
2k views

What Version of Bash comes with OSX 10.9 / Mavericks?

Trying to decide if I want to bother upgrading my bash shell to v4.x; if it comes with Mavericks, I probably won't, but I can't find much information on what versions of bash come with what versions ...
6
votes
3answers
9k views

Getting files, all at once, from a web page using curl

I would like to download the files, all at once, from the following page using curl: http://www.ime.usp.br/~coelho/mac0122-2013/ep2/esqueleto/ I tried curl ...
3
votes
1answer
81 views

Running an AS droplet from Terminal

I have an Applescript Droplet application that I need to run from terminal. I can use osascript or even just open to open the AS App, but that will run its on run handler, not the on open droplet ...
2
votes
2answers
431 views

Changing terminal color

I would like to know how to change the terminal color, so whenever I run ls it will return the name of: Directories in red Files in blue Executable files (those you do ./file) in light green How ...
0
votes
0answers
13 views

How to create aliases in the terminal? [duplicate]

I tried two methods: With nano created a ~/.bashrc file in which stored my aliases from linux mint, after used source command and after it all work fine until i exit the terminal. Found in the ...
1
vote
3answers
7k views

How to create ~/.bash_profile and ~/.profile

So, I don't have .bash_profile neither .profile in my home folder. How do I create them? After that, what should I do so every time I open the terminal these files get read?
1
vote
3answers
238 views

Make shortcuts to directories via terminal

My problem is: whenever I'm coding, I work inside folders that are inside other folders and it's a long way to type: cd /folder1/folder2/.../folderN I know it's possible to make a shortcut to the ...
8
votes
3answers
810 views

OS X - Create a personal bin directory (~/bin) and run scripts without specifying their full path

So, what I am trying to do is to create a personal bin directory at my home folder. I created the following folder: /Users/thi/bin I put my scripts in this folder, but if I type in the Terminal: ...
0
votes
1answer
1k views

Mac OS X Terminal: -bash: $: command not found

While trying to install pagekite on OS X Snow Leopard using the following command: $ pagekite.py --signup I got: -bash: $: command not found I am a noob with the terminal but after reading a bit ...
2
votes
1answer
153 views

Is there a systemwide .bash_profile file?

The order of directories in my path is messed up, and I'm trying to correct it. Some of the path seems to be coming in from somewhere other than my user bash config files (I'm using both .bashrc and ...
0
votes
1answer
844 views

Automator won't execute my bash shell script

I have a bash script that works like a thread. Now I'd like to turn it into a service with Automator. Input is set to Image Files in Automator and the shell script action is set to Pass input as ...
0
votes
3answers
140 views

Alternative to cp --parents in terminal

I was trying to use the --parents option with cp (to create the non-existing directories in the target path) in the terminal but that option does not seem to be working in MacOS. >cp --parents ...
0
votes
1answer
41 views

Terminal app no longer automatically recognizes functions in my ~/.profile any more

I made some function in my ~/.profile to automate things like SSH connections. They were working fine until recently. Now I need to "run" the ~/.profile by doing . .profile each time I open Terminal ...
4
votes
4answers
113 views

How do I copy the content of a whole disk on OSX 10.3

I would like to copy the contents of a whole disk into another folder on an external drive. it should preserve permissions and timestamps. on linux i use cp -a but on OSX it seems to be different
0
votes
2answers
168 views

How Can I Send Text (and Not a Text File) to My Printer on OS X?

I know about this question (How do I send ASCII text to printer (over USB)?). But I'm working on something different. I'd like to be able to send text from within a bash script or Perl script to my ...
0
votes
1answer
82 views

changed user path and lost aliases in .bash_profile

I reinstalled mountain lion recently and had to reset my git path. Everything was working fine until I realised I had to do it for every project so I tried to change the default system path by sudo ...
1
vote
1answer
232 views

Automator to execute shell script with an input text file, copy it to specific directory

I'm simplifying making a .deb file with Automator. I currently have a shell script that does some simple actions - Ask the user for text input Do some directory parsing Execute a command with the ...
0
votes
2answers
456 views

My Automator Workflow fails because it fails to find the git command within the 'Run Shell Script' command? Need help

I have an Automator workflow and one of the actions is to clone a repository. Here's the code for the 'Run Shell Script' action. The command is run within the Bash shell /bin/bash if that matters: ...
3
votes
2answers
171 views

Re-reading your .bash_profile

When you make a change to your .bash_profile it will be read the next time you open a terminal. But what if you have a terminal open already. Is there anyway to do a re-read?
0
votes
1answer
118 views

How can I make OS X's bash expand $PWD to be case sensitive?

I am running OS X 10.8 on a MBP 2011. I use some bash-scripts for tasks like backups of remote servers. One of the scripts contains this snippet: #!/bin/bash if [ "$PWD" != ...
0
votes
0answers
31 views

Why nc doesn't response even if the “w” option set?

For some servers: nc -w 1 -z x.x.x.x 22 doesn't work. It has no response, but is looking like very busy: only ctrl + C can help. So -w 1 seems to be a useless option, to specify the timeout. Does ...
0
votes
2answers
318 views

vi shortcuts on bash on mac not working e.g. CTRL + E, CTRL + A [duplicate]

I have used vi as my main text editor for years now on Linux (and a few years back Mac too) and on my brand new Mac (running 10.8.4) I find when trying to edit a file using vi in Terminal I can not ...
0
votes
1answer
557 views

Playing alert sounds from terminal

Is there a way to play OSX alert sounds from terminal? The alert sounds that are listed in System Preferences > Sound > Sound Effect Tab
0
votes
0answers
14 views

How do I use Mathias .osx defaults? [duplicate]

I just got a mac and am still familiarizing myself with it. I was taking a look at: https://github.com/mathiasbynens/dotfiles/blob/master/.osx Not sure how to use it!
2
votes
1answer
578 views

Meaning of “./” in Mac terminal

I am a new user of the Mac terminal. What is the meaning of "./"? What is the difference between the commands rm image.png rm ./image.png rm *./image.png
0
votes
1answer
194 views

Changing the command prompt of Terminal

I have found myself to grow fond to CentOS's command prompt which looks like the following: [user@host directory]$ cmd I, personally, do not like how Mac OS X Terminal is laid out, which is: ...
0
votes
1answer
177 views

How to auto run a simple python program when the terminal opens

Say I have a python program called foo.py that prints a line of text. How can I auto run that program when I boot up the terminal? I know you can, but I can't find the documentation. Also no third ...
2
votes
2answers
258 views

How do cope with a space when setting the $PATH

I want to add the sublime lib to my path but it has a space in it. I have tried the obvious like you would navigate in the terminal E.g /Applications/Sublime\ Text\ 2.app/Contents export ...
0
votes
1answer
393 views

Terminal bash commands stopped working

I was trying to install some stuff for scala development on my MAC, and probably I managed broke the shell/terminal while I was mindlessly running some scripts that I don't know. Now when I start the ...
2
votes
1answer
92 views

extract to a new folder with spl name

working on OS X 10.8.3, have part of what I want working, hoping for help with the rest #!/bin/bash # script accepts a path to base dir - base path to extract # also accepts second param - archive ...
4
votes
2answers
756 views

How to strip a filename of special characters?

I have a file with a name such as "Today's Date.txt" What I am interested in is stripping away all special characters using the terminal such as: " - , ' ' [ The reason for this is because I ...
0
votes
2answers
185 views

Reinstall bash on MacOS 10.7

I have a MacBook Air where someone attempted to install this version of bash over MacOS's native one unknowingly. I attempted to fix this by removing the files created by the installer (the readme was ...
4
votes
1answer
455 views

Can't run vi from terminal

Every time I execute these commands: vi or vim in the terminal, it gives me the following error: -bash: /usr/local/bin/vi: No such file or directory or -bash: /usr/local/bin/vim: No such ...
2
votes
1answer
143 views

OSX equivalent for ~/bin in Linux

When using Ubuntu I can save shell scripts in ~/bin. To launch them I just type the name of the script in the Terminal. Is there an equivalent solution for OSX?
2
votes
1answer
352 views

OS X Mountain Lion Terminal and tabs take ages to load

When I open a new Terminal tab I have to wait at least 10-20 seconds before I can work with it, I have followed previous suggestions here: How do I speed up new Terminal tab loading time? But so far ...
0
votes
2answers
2k views

How do I run VLC with command-line parameters when clicking the icon?

I've tried changing the Info.plist to point towards a bash script which runs the executable with the parameters that I want. This doesn't seem to work even though when I invoke it from Terminal.app ...
0
votes
1answer
1k views

Cleaning up my .bash_profile: Can I delete some of this?

I'm not a Unix guru. I'm running OS X 10.8.3 Mountain Lion. Today I removed Macports from my machine. I believe macports left some cruft in my `~/.bash_profile which I would like to remove (the ...
2
votes
3answers
2k views

Change file association in terminal?

Is there a method for associating file types with applications via terminal? I thought ~/Library/Preferences/com.apple.launchservices.plist might do it, and I also have seen: Why is a command line ...
1
vote
1answer
1k views

How to remove an environment variable on Snow Leopard

I'm running under Snow Leopard 10.6.8 and I recently added an environment variable which it seems to be messing my bash terminal (I guess). What I did is add the variable ...
0
votes
0answers
40 views

Making checks before rsyncing external drive on OSX

I have the following issue on OSX though I guess this could equally be filed under bash. I have several encrypted portable drives that I use to sync an offsite data store or as an on-the-go data store ...
1
vote
1answer
316 views

How do I make a bash script so that I can drag its input on top of the icon?

I need to make a bash script to that I can drag a .rar file on top of it and then the script will receive the pathname of that file as argument 1 ($1). I have made the bash script, but how do I make ...
0
votes
2answers
518 views

Compress files with the output name same as Parent Folder with Automator

I've been searching the internet for a solution to this. I would like to create an Automator workflow that will zip the selected files, name the zip the name of the Parent directory and save that zip ...
2
votes
0answers
77 views

Terminal configuration lost after booting up

On OS X 10.8.3, my Terminal.app is configured with my .bashrc file. In my .bash_profile I have: source .bashrc It works great, except when I let some Terminal windows opened and shut down the Mac. ...
0
votes
1answer
132 views

Why does shasum generate non-standard hashes?

As far as I can tell, the shasum that ships with os x doesn't generate the hashes that it's supposed to. $ echo "" | /usr/bin/shasum adc83b19e793491b1c6ea0fd8b46cd9f32e592fc ?- When I look up empty ...
3
votes
2answers
343 views

Are Bash, Bourne, and Korn shells compiled into one binary in OSX?

On OSX 10.8, if you compare the binaries for bash, sh, and ksh, a few different shell options, they are the same size. If you take it further and cmp the binaries, there seems to be only a ...