The default Unix shell used by Terminal in Mac OS X

learn more… | top users | synonyms

1
vote
1answer
138 views

More colors than ls -G in file extensions

In the output of ls -G, I can see some extensions get colors like symbolic links or .sh files. What if I also want .jpg, .xml, .wav or .log to have different colors too? Also, is there any way I can ...
0
votes
0answers
30 views

.bash_profile dont recognises commands even after some editings

Can someone tell me when I open a Terminal window if my .bash_profile is loaded (or readed). Each time now (dont know why) some cmds (ie: ls, man) are unknow. When I edit the file (I add : export ...
1
vote
2answers
329 views

How to recover from “chown -R $USER /usr/”?

I ran a 'chown' on everything under /usr to a non root user. Meant to run it for /usr/local/ Now I get the error below on opening terminal login(89809,0x7fff7bac5960) malloc: *** error for object ...
1
vote
0answers
10 views

Access the GPS from Terminal [duplicate]

Is it possible to find out the location of a computer similar to the "set time by location" feature via command line? I'm working on a little script that would update my network location settings ...
2
votes
2answers
284 views

How do I get Automator to process images using ImageMagick in a command script?

I'm making an Automator workflow that uses the shell script action to process a selection of images with the imagemagick composite command. Only I'm having issues getting it going. According to the ...
13
votes
2answers
3k 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
58 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
113 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
173 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
41 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
2answers
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 ...
9
votes
3answers
16k 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
99 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
1k 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
14 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 ...
2
votes
3answers
11k 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
355 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 ...
9
votes
3answers
2k 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
2k 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
247 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
1k 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
181 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
45 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
126 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
237 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
94 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
263 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 ...
1
vote
2answers
659 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
182 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
127 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
33 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
399 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 ...
1
vote
1answer
878 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
872 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
629 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
204 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 ...
3
votes
2answers
592 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
740 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
101 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
2k 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
213 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
624 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
151 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
406 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
2k 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
3k 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
2k 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 ...
1
vote
1answer
465 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 ...