1
vote
3answers
145 views

How do I undo “export PATH='/usr/local/bin:$PATH' >> ~/.bash_profile”

I was trying to install homebrew, which wasn't working. It told me to do echo export PATH='/usr/local/bin:$PATH' >> ~/.bash_profile. However this wasn't having any affect, and I thought maybe it ...
1
vote
1answer
36 views

How can I fix my $PATH variable?

I need to revert my $PATH back to the default. The catch here is that I broke it so bad that the echo $PATH command returns: /usr/ that's it, which means I can't use any of the methods described in ...
1
vote
1answer
29 views

Bash script to run command with prompt for input

How can I create a script using the following command? mmap -sn -n x.x.x.x/8, /16, /24 and so on. I would like the script to run the command when I type in "sweep" and then prompt me for the subnet ...
3
votes
1answer
44 views

Terminal not displaying colors for directory listings

I don't know why my bash session doesn't show colors. I have tried Terminal as well as iTerm. I have tried: ls -G Setting export CLICOLOR=1 and export LSCOLORS=GxFxCxDxBxegedabagaced Using ...
1
vote
1answer
47 views

odd behavior of pgrep in bash script

I have a script to kill a process tree that works fine in linux but I am experiencing some odd behaviour on osx. It actually works fine with my unit tests and also when trying to run it manually on ...
1
vote
1answer
48 views

Why does my path not get saved even after editing ~/.bashrc? [duplicate]

I've added maven to my path, but it doesn't seem to be persisting to the path beyond the lifetime of the terminal application. I've modified my ~/.bashrc, but it still isn't storing the modified ...
1
vote
1answer
47 views

How to open shell scripts in editor when double clicking on them

I'm trying to migrate to OS X. One thing what I find really strange / dangerous that by double clicking on shell scripts, I launch them in Terminal. I would like to change this behaviour to open them ...
1
vote
1answer
61 views

Vim like terminal

I recently discovered terminal's feature, you can set the keys emacs or vi style I prefer the second. so if you do set -o vi You can use k j l h keys to navigate on the command line. And you can ...
3
votes
1answer
146 views

How to restore my deleted .bash_profile?

I have deleted my .bash_profile with rm command and copied another one to use. But now i remember there is some PATH thing in the previous file :(. Can i find the deleted .bash_profile in some place ...
1
vote
1answer
43 views

How to share .bash_profile between different users in the same group? [duplicate]

I have searched by google but cannot find a right solution.The scenario is like this: in my mac, there are two users, lets say user1, user2. these two users are in the same group, which is staff ...
2
votes
1answer
102 views

Forward slash doesn't work when in terminal… works in every other application

I'm trying to use terminal and in every tab I open, when I try to change directory such as cd / I get a beep and am unable to type the character. I am on the same computer and am able to ...
0
votes
1answer
54 views

Rsync exclude-from not working

I have created a rsync script which has been working fine until I made recent modifications adding exclude-from clause to it. When running the script it returns the following error: rsync error: ...
1
vote
1answer
60 views

Root crontab won't save

I'm trying to add a crontab entry to my root user's crontab. I'm able to add an entry without issue to my regular user's crontab, but when I su to root user and try adding a crontab entry it does not ...
2
votes
2answers
208 views

Does Mac OS X's bash read scripts for all users (tab-completion scripts) from /opt/local/etc/bash_completion.d path?

I stumbled upon some instructions in the book "Pro Git" It suggests: Download this file : https://github.com/git/git/blob/master/contrib/completion/git-completion.bash If you use the Bash ...
1
vote
0answers
59 views

What is multi user mode in MAC and how to boot in multi user mode in MAC Mavericks [closed]

What is multi user mode in MAC operatins system and how to boot in multi user mode in MAC Mavericks
8
votes
2answers
2k views

Why Mac OS X don't source ~/.bashrc [duplicate]

I found a lot of people figuring out why instruction similar to this : Put X to your ~/.bashrc and you can do Y don't work. It always turns out that Mac OS X's bash's startup files (or Mac's ...
2
votes
2answers
63 views

Can't open a file in sublime text using bash_rc

My bash_profile function looks like: function st() { /Applications/Sublime\ Text.app/Contents/SharedSupport/bin/subl /Users/ishan/workspace/nltk_engine/index.py;} However, when I do st in terminal, ...
0
votes
1answer
51 views

What is the proper way to use the cut command on ps command output

This question is related to a question I posted on rogue firefox procesess. It relates to firefox processes following image uploads that I have been having for a while. I am trying to get to the ...
2
votes
2answers
44 views

How do I change $PATH and set it to the default directory?

For some reason when I run echo $PATHI get the following directory: /Users/<home>/Library/Applications/. How do I set it back to its default location so that I don't have to run this command, ...
2
votes
1answer
759 views

Mac OS X Mavericks - add to path

I'm trying to set up a phonegap project and while trying to add a platform it outputs the following error: Error: The command "android" failed. Make sure you have the latest Android SDK installed, ...
2
votes
3answers
88 views

Behavior of login shell vs. Linux, 'sh -c'

I have a seemingly-valid command that works fine on Linux boxes but fails on OSX, and I would like to know why. sudo su - validusername sh -c 'whoami' On Linux, this will echo 'validusername' on ...
0
votes
1answer
382 views

TERMINAL ~/.profile does not contain source ~/.bashrc MAC OSX 10.9.1

terminal shows below on this stage on gerris installation page : http://gfs.sourceforge.net/wiki/index.php/Mac_OSX_Installation Note: make sure that the file ~/.profile contains the line source ...
1
vote
1answer
2k views

`LSOpenURLsWithRole() failed with error -1712 for the file </path/to/folder>` when I attempt `open .`

I suddenly came across this error when I attempted to do open . to open the current directory in Finder, a command that I use quite frequently: ysim:~/Downloads$ open . LSOpenURLsWithRole() failed ...
0
votes
1answer
130 views

In Terminal, when the the “cd” command is called, libwww-perl's “head” command is also executed

Currently, in Terminal, when I execute a cd command, it also executes LWP's head command. A copy of the Terminal output follows: laptop:bin user$ cd ~ Unknown option: n Usage: head [-options] ...
8
votes
2answers
157 views

Piping multiple commands

I would like to run the following command and pipe stout of both to TextEdit: pmset -g; echo; pmset -g assertions | open -f -a TextEdit This doesn't work, it only executes the latter: How?
9
votes
2answers
2k views

Using terminal to get current fan speed?

I would like to view the current fan speeds of my MacBook and iMac using terminal. I've found that running spindump then cat /tmp/spindump.txt | grep "Fan speed" will show it, but that's very slow and ...
0
votes
2answers
311 views

Set the master password from terminal

I am trying to set a master password from the terminal (using a shell script). I see the passwd function and the master.passwd function, however I don't see any documentation on either of these to set ...
1
vote
1answer
166 views

Setting a firmware password

Currently trying to use a script (preferably shell) to setup the firmware password on a fresh OSX install. I obviously found this: http://osxdaily.com/2014/01/06/set-firmware-password-mac/ which ...
2
votes
3answers
460 views

Find all executable files within a folder in terminal

I have a folder myfolder that contains a huge hierarchy of files/folders. How to find all executable files within this folder? On Ubuntu this works: find . -executable -type f But Mac OS X Mavericks ...
1
vote
1answer
72 views

Locating an app by its bundle identifier from the command line

I am looking for a way to find an app's location on the system from the command line using its bundle identifier. I can open it like this: open -b 'com.zerotier.ZeroTierOne' ... where ...
0
votes
0answers
44 views

Opening Terminal shows a list of ttys - unable to use

Having the latest Mavericks installed, I tried to update PATH using nano and creating a .bash_profile file. I'm not sure what happened, but now when trying to run Terminal all that shows is a list of ...
5
votes
5answers
776 views

OSX Bash for loop - issues with spaces in folder names?

I'm getting a bit confused on how to handle spaces in path names when returned in a for loop. Rationale: I'm cleaning up the permissions on folders and files that I copy over from Windows. Most of ...
1
vote
1answer
48 views

Mavericks - strange behavior creating simlink in root directory

I want to create a simlink called /home, that points to /Users. The command sudo ln -s Users home (executed in /) should work; at least, I've demonstrated that the syntax is correct by creating a ...
0
votes
0answers
9 views

How can I customise the Terminal.app prompt [duplicate]

I have been using Terminal with xterm-256color emulation. I want to set the prompt to display the current directory in colour, as I used to under Linux. I have set the PS1 environment variable, but ...
0
votes
1answer
32 views

install libsoup on macbook pro

I have a shell script from a open source project, when I run it in terminal, I get the following error: ./configure: line 17678: syntax error near unexpected token `soup,' ./configure: line 17678: ` ...
1
vote
1answer
229 views

Mount .sparseimage from .bash_profile

I need to mount a .sparseimage from .bash_profile but I don't get how to do it. I tried: alias of22='hdiutil attach "Documents/OF.sparseimage" -mountpoint "$HOME/OpenFOAM" > /dev/null ; . ...
1
vote
1answer
353 views

terminal starts with `no such file or directory` message

I removed Enthought Canopy from my Mac and now when I start terminal there's this warning message says -bash: /Users/myname/Library/Enthought/Canopy_64bit/User/bin/activate: No such file or ...
2
votes
1answer
191 views

Bash not running script at /opt/local/etc/bash_completion.d/

I wanted to have bash autocompletion for git commands, so I dropped a bash script file into /opt/local/etc/bash_completion.d/. When I open a new Terminal, the script file in ...
6
votes
2answers
3k views

Run AppleScript from bash script

If I wanted to run an AppleScript from within a bash script I could call a file with the list of commands that I require to execute. #!/bin/bash {some commands} osascript file.scpt {other commands} ...
4
votes
2answers
251 views

What does -HUP do when used with killall?

Sometimes when I'm running a killall command from Terminal, a co-worker would suggest or edit my scripts to show killall -HUP. What does the -HUP part do?
4
votes
2answers
702 views

Bash Script that will start up second Terminal process?

I need a script that will be able to fire up a second Terminal instance and pass a command directly to that one whilst it continues it's own executions. It's to start up Python script that will host ...
0
votes
0answers
86 views

Bash Commands and Terminal problems [duplicate]

Hello I open my terminal window on Mac Os 10.6.8 as I am trying to update my ruby to 1.9.3 and the terminal gives me this response immediately as I open it: -bash: export: ...
2
votes
1answer
147 views

Homebrew: Easy way to add 'gnubin' to path for multiple packages?

I would like to use Homebrew to install GNU versions of several utilities, and use the GNU versions by default with their usual names. From the output of brew install gnu-tar and by reading How to ...
1
vote
2answers
235 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 ...
2
votes
2answers
248 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
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 ...
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
10k 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 ...