The default Unix shell used by Terminal in Mac OS X

learn more… | top users | synonyms

1
vote
1answer
1k 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
1k 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
961 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
246 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
1k 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 ...
1
vote
1answer
2k 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
109 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
3k 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
339 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
901 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
163 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
532 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
3k 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 ...
3
votes
3answers
4k 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
4k 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 ...
2
votes
1answer
686 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
843 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 ...
0
votes
1answer
221 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 ...
6
votes
2answers
1k 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 ...
0
votes
1answer
50 views

Python launching problems OS X

I'm trying to install python on mac OS X 10.7.5. I installed it from MacPort and I think before I did, I screwed up $PATH somehow. It seems to install fine but then when I try to run ipython I get ...
2
votes
2answers
1k views

How to enable Maven autocomplete on Mac OS X command-line?

When using Maven (mvn) on OS X Terminal, how can I get tab-completion for Maven goals, plugin names, etc? Things like this: mvn pa [TAB] -> mvn package mvn je [TAB][TAB] -> mvn jetty:run
2
votes
1answer
85 views

How to get inode from alias file?

In this MacWorld forum thread aliases are described as Aliases can reference an object in the file system either by a persistent ID or by path. Generally they will contain both pieces of ...
5
votes
1answer
3k views

How do I edit current shell command in VI

I have seen in blogs on Linux machines you can edit the current bash shell command in VI (or whatever the EDITOR is set to) by pressing ctrl-x,ctrl-e. This doesn't seem to work on 10.8. Any ideas on ...
5
votes
1answer
163 views

Weird line wrapping in terminal with a colored prompt

I have reason to think I've got improper escaping in my bash prompt (I get weird random line wrapping in Terminal). Can anyone point it out? It looks OK to me... export PS1="\033[0;35m\u\033[00m on ...
1
vote
1answer
377 views

Run script on networked user login

The computer lab is running 10.8. I would like to run a script when networked users login. As far as I can tell my choices are: launchd agents - Not meant for this. On the launchd.plist man page it ...
9
votes
5answers
615 views

How to share .bashrc files between two mac user accounts

I have set up two user logins on my computer, one for home and one for work. I would like to be able to share any of my bash and vim settings between the two users. Is there anyway to do this? Thus ...
2
votes
3answers
2k views

Find/Unrar/Delete Script

I'm a PC convert, and quite novice when it comes to shell/bash scripting, but I really want to learn/understand more. My need: I need to be able to scan a folder, find any .rar files, extract the ...
6
votes
2answers
702 views

“Airplane Mode” in OS X. Alternative command for `rfkill`?

This question is an exact duplicate of this post from superuser.exchange.com. I believe this is a valid question for both of sites and hope I am not (if any) violating stackexchange policies. ...
4
votes
1answer
248 views

Can an alias be added to the dock via the command line?

I found this article but it handles the GUI solution. I would like to automate the setup of a new machine, and do that I've created Dropbox shares of a number of my common configurations. (I could ...
1
vote
1answer
309 views

Alt-. and vertical bar (pipe) on terminal

On linux consoles I always use Alt + . to get the last argument of the previous command in history. for example if I had ls /tmp/test as last command, and if I type rm Alt - this will result ...
0
votes
1answer
39 views

Equivalent to Alt on terminal [duplicate]

On linux consoles I always use Alt + . to get the last argument of the previous command in history. for example if I had ls /tmp/test as last command, and if I type rm Alt - this will result ...
3
votes
1answer
297 views

how to get ls to list files in case-insensitive order?

How do I get the ls shell command to list my files in: case-insensitive order with the directories at the top? The reason I ask is: I want Aquamacs Emacs dired to list my files and directories ...
3
votes
3answers
562 views

Compare multi-digit version numbers in bash

Trying to write a script that searches for the version of the Application then returns the value. My problem is the value is three to four intergers long (example 4.3.2). I have searched for a while ...
2
votes
1answer
349 views

Paste <TAB> into Mac OS X command line

I want to paste <TAB> into command line, in order to execute cut command with <TAB> as the delimiter. Everytime I try to do it, it simulates clicking the tab key and completes the command ...
0
votes
1answer
720 views

Load .bash_profile automatically on Terminal.app startup?

I have seen various questions that ask something similar. They suggest changing .bash_profile to .profile. However this doesn't work either. I have aliases setup up in .bash_profile. I would like ...
1
vote
1answer
1k views

How to set up multiple PATHs in the user bash_profile in OSX 10.8?

I am looking to set up my laptop for both Python development and Phonegap Android development in OSX 10.8 using Eclipse. I installed the lastest version of Python (3.3) which added the code: # ...
0
votes
2answers
677 views

Applescript dialog, Bash alias/function

I'm trying to create a short alias for creating System dialogs from the Terminal. I tried to create a Bash function (since an alias didn't seem to take arguments) and add it to my .bash_profile, but ...
1
vote
1answer
51 views

How to change some information in a shell prompt.

I opened my terminal and saw a shell prompt. Last login: Fri Feb 15 15:28:16 on ttys000 john:~ voloda2$ How do I change john to alex?
3
votes
1answer
123 views

How to find delay when launching new Terminal (iTerm)

When I press CMD+N in iTerm2 to bring up a new iTerm window, sometimes it takes 10 seconds before I get my prompt. If I immediately repeat the process, the whole thing takes 1 second. To me this ...
0
votes
1answer
46 views

Terminal not logged in properly

I'm having a bit of an odd issue with my terminal. I'm used to the prompt being Joosts-Macbook:~ Joost$ or something of that nature, but all of a sudden it displays a number I don't recognise: ...
1
vote
0answers
71 views

Most efficient way to get all files in a directory

I have a million+ files spread across four fiber-connected arrays. I need to get the path, filesize, and last_modified date to insert into a mysql database. What would be the best way to do this? ...
4
votes
3answers
3k views

How to run a bash script from the desktop?

I have a .sh file with a #!/bin/bash header. I'm able to run it from the terminal, using chmod and ./ but is there a way to perform these two operations from the desktop (i.e. by clicking on it) ? ...
2
votes
2answers
1k views

Source a script from a URL in bash

I gather this should work in bash: source <(curl -s https://example.com/script.sh) or bash <(curl -s https://example.com/script.sh) or curl -s https://example.com/script.sh | source ...
1
vote
1answer
60 views

How to invoke a script when closing any file with a given extension

Is it possible to automatically invoke a given applescript when closing -any- file with a given extension in a specified folder (and subfolders)? If not in AS, is this possible in bash? (The AS I am ...
5
votes
4answers
5k views

How to reset $PATH?

I was trying to add something to $PATH and it went totally wrong. I now can't run any commands such as ls. I've looked at this answer and used the following lines: ...
0
votes
3answers
655 views

Setting a variable to the result of a terminal command within an applescript

I'm trying to make a script that ejects all connected external drives and does not move on until they are all disconnected. The main problem I'm having is being able to set the variable vol_count to ...
1
vote
1answer
136 views

How do I verify the integrity of my OSX installation? (Files, versions, and preferences)

I want to verify the files, and configuration settings for my OSX installation against a known good reference "base". Assuming I have two identical Macs (hardware), with one being factory installed ...
3
votes
2answers
375 views

How to drop a file onto a GUI app from command line?

I've got a tool to normalize WAV audio files, but it only works by dragging and dropping the file either onto the GUI or onto its dock's icon. As far as I know the app doesn't have any option to pass ...