A type of user interface for a computer. This can be both command line or graphical user interfaces. More commonly, shell often relates to the command line interface.

learn more… | top users | synonyms

2
votes
2answers
530 views

Exclude files from “central metadata store”

I'm fairly familiar with the mdfind utility. I find it's very useful when I can't find a file or when I need to find a file with certain contents. The problem is that I need to exclude some files from ...
6
votes
4answers
2k views

How to prevent Mac sleep from command line?

I have a long running script at the remote computer. I don't want terminate my ssh session, and need enter it into a shell script. How is it possible to prevent my Mac from falling into sleep from ...
5
votes
2answers
539 views

How can I have my shell always start in a certain directory that is not my home directory

I've tried putting cd /Users/my_name/my_directory/structure in both .bashrc and .bash_login but neither works, i.e. when I open a new terminal window I am in my home (/Users/my_name/) directory. ...
7
votes
1answer
2k views

How can I format the output of ping in bash?

I am using the following script to cycle through a list of IP addresses and report back on the % of packet loss. I'd also like to have the IP address printed first, then its % of packet loss. But I ...
1
vote
2answers
2k views

Change Date Created based on the filename

I've downloaded a bunch of my Instagram images but the Date Created of the files is set to the time that I initiated the download. What I do have though is the Date Created in the filename. What I ...
6
votes
2answers
2k views

How can I kill a process using top on OS X?

On other Unixe,s I can use top and then hit K and type the process ID. How can I do that in OS X? I can type kill [the_pid] on its own at the command line and that works. However, I was wondering if ...
1
vote
2answers
1k views

How to fix locate.updatedb not respecting directory excluded from /etc/locate.rc?

I wanted to exclude some directories from the results of /usr/libexec/locate.updatedb by editing /etc/locate.rc. Unfortunately if I edit locate.rc locate.updatedb runs forever and does not actually ...
3
votes
2answers
1k views

What terminal commands are new or updated in Mountain Lion?

Where can I find a list of new or updated terminal commands or features for Mountain Lion? Lacking any list, does anyone have a sugguestion on how to generate that list? (some combination of ls ...
31
votes
5answers
4k views

Is there a way to access a Mac's geolocation from terminal?

(Note the Mountain Lion update at end of question) Some GUI apps use OS X location services, but I want to retrieve a Mac's physical location from the command line. This could be useful for running ...
0
votes
2answers
395 views

How to get the path of the selected Image in Adobe Bridge via Applescript?

I am trying to get the parent file path of a selected image thumbnail in Adobe Bridge CS5.1 to pass it on to a shell script. An Applescript wraps a tiny javascript command in command like this: set ...
6
votes
2answers
206 views

How to automatically watch for file changes and perform a custom action inside shell?

For example, I'd like to automatically run YUI Compressor whenever I edit a JavaScript source file to output a compressed version. Ideally the process does not run in the background but in a ...
3
votes
1answer
3k views

How can I temporarily suspend some users, hiding them from the login screen?

I have to manage a shared OSX workstation that is used by a rotating cast of characters throughout the year. The login screen quickly becomes cumbersome when users that aren't even around for a while ...
5
votes
2answers
1k views

How to mount a RAM disk on startup?

I'm trying to mount a RAM disk on startup with this: /Users/Aram/Development/Tools/ramdisk.sh diskutil erasevolume HFS+ "RamDisk" `hdiutil attach -nomount ram://800000` com.aram.ramdisk.plist ...
1
vote
1answer
375 views

How can I set Last Modified Date of file after using HandbrakeCLI to convert a file?

Running this on OS X Lion. I'm batch converting several hundred home movies using Handbrake CLI. I'd like to set the last modified date and created date to that original file. I'm using the ...
61
votes
4answers
27k views

How can I trigger a Notification Center notification from an AppleScript or shell script?

I'd love to be able to take advantage of 10.8's Notification Center features in AppleScripts and shell scripts I write. Is there a built-in command or a third-party library I can use from either an ...
2
votes
3answers
501 views

How can I see how long my computer has been active (as in not idle)

I've seen a variety of solutions to check how long my machine has been idle, and I know I can check how long since last reboot with uptime, but I'm curious if there's a way to see how long since my ...
4
votes
3answers
634 views

pbpaste, pbcopy using wrong pasteboard?

I'm converting a shell script which xclip and similar tools on Linux, to use pbpaste and pbcopy on Mac. The problem is the default pasteboard ('general' according to the man-page) for these tools is ...
6
votes
2answers
752 views

Change my shell to a different bash version at /usr/local/bin/bash?

How can I set my /usr/local/bin/bash (which is the 4.2 version that allows auto-completion of 'cd to directory with directory name') to be my default bash for a new window instead of my regular ...
1
vote
2answers
2k views

How do I run an OS X command script on remote Xserves from a desktop OS X script?

The answer to an earlier question, Access and control home office network, iMacs, and Xserves, left me with a new problem. To review, I have a computing environment comprised of: 27" iMac with dual ...
11
votes
2answers
1k views

cd to a directory by typing its name?

For example if a directory 'blob' exists and I just type 'blob[return]' then the system cds into the blob directory for me. In Linux (Ubuntu) I can add shopt -s autocd to my .bashrc file, but on OS X ...
2
votes
4answers
987 views

Editing System/Library files with Property List Editor (PLE)

I want to update the schedule in /System/Library/LaunchDaemons/com.apple.locate.plist. I have unlocked the file in Finder but the Property List Editor is giving me: The file ...
20
votes
3answers
29k views

Can I get the CPU temperature and fan speed from the command line in OS X?

Is there a command I can run from the command line in OS X to get the current CPU temperature and/or the fan speed(s)? To be more specific, I'd like to be able to get the same info available in the ...
3
votes
1answer
364 views

How do I find where an environmental variable got set?

I installed a program to try it out, and decided I didn't like it so I moved the app to the trash. Today, in my shell, I noticed that there are a couple of PROGRAMNAME_BLAHBLAH environmental ...
1
vote
1answer
563 views

Open PDF in full screen from the command line

I've written a simple-minded "take a break" reminder which just opens a PDF notice. This works fine, but I wish I could open the PDF file in full screen mode from the command line. Does anyone know ...
3
votes
1answer
807 views

-bash: Applications/mvim: /bin/sh: bad interpreter: Operation not permitted

I am getting a weird error with the mvim script that is supposed to start the MacVim interface. See below for the issue. /bin/sh is just fine, mvim was chmod +x'd, other /bin/sh scripts run fine... ...
15
votes
2answers
10k views

Amending PATH so that /usr/local/bin is ahead of /usr/bin

I'm trying to install brew but get the following warning: Warning: /usr/bin occurs before /usr/local/bin This means that system-provided programs will be used instead of those provided by Homebrew. ...
2
votes
1answer
207 views

How to search files from command line under OS X?

It seems that Apple doesn't want us to use locate, at it is making it so hard to setup. If there a way to use finder database from the command line? Maybe I can make an alias. I would appreciate ...
8
votes
3answers
248 views

How can I automatically keep track of in-office hours when I connect to my office Wi-Fi?

I'm looking for a solution that starts a timer whenever I sign in to my office wifi and stops it when I've left. It should essentially log the hours I've spent at the office. I'm aware that there's ...
1
vote
5answers
4k views

How do I fix Terminal.app when my shell has been set to an illegal value?

Today I was mucking about trying to uninstall macports when I noticed an error being thrown up whenever I used sudo. I killed Terminal and tried to restart it which failed with the error message ...
0
votes
0answers
135 views

How to toggle closeViewZoomFollowsFocus in com.apple.universalaccess via shell script with instant activation?

I created a Service with Automator on a Mac running "Lion 10.7.3". The Service toggles via a shell script the visibility of hidden files in the Finder and works like a charm. Here's the script: ...
3
votes
1answer
544 views

What should the standard contents of $DYLD_LIBRARY_PATH be?

I'm trying to install CERN's root libraries on my mac os Lion. It needs me to set $DYLD_LIBRARY_PATH, but on checking echo $DYLD_LIBRARY_PATH it seems to be empty (before I'm adding to it). Is ...
2
votes
1answer
93 views

Apple command file exits early

I wrote an .command script that when I launch it, it just exits and it's to quick for me to see what's going on. How do I keep it open?
1
vote
1answer
485 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 ...
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 ...
1
vote
2answers
914 views

What is your preferred way to start a (shell) script from the GUI?

I was wondering what ways there are to start a (shell) script from the GUI, e.g. double-clicking an icon in Finder or launching via Spotlight. This is not about opening a terminal and "manually" ...
3
votes
1answer
3k views

Is there a way to minimize open windows from the command line in OS X Lion?

Just wondering if there is a way to retrieve open windows and minimize them from the command line in Lion? I have an AppleScript that does this, but it kind of slow, so wanted to know if there was ...
1
vote
2answers
2k views

How do I write an AppleScript which auto reconnects to Wi-Fi?

Sometimes I need to download very big files from the internet using torrents (I'm using Transmission) and the Wi-Fi always drops. I bought several routers and modems and none of them work. I've been ...
9
votes
2answers
4k 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
277 views

How do I set an icon for a directory via the CLI? [duplicate]

Possible Duplicate: Changing a file or folder icon using the Terminal This is a continuation of this thread from Super User. The question is how to set an icon on a directory. At first I ...
3
votes
2answers
235 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) ##
4
votes
4answers
3k views

Creating a virtual serial port

I'm trying to create a pair of virtual serial ports on my mac. This is fairly easy to do with many shareware programs on a PC. I figured there would be some uber-powerful shell command to do this in ...
0
votes
1answer
53 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) ...
3
votes
1answer
547 views

Printing the current date/time with sub-second precision

GNU date(1) understands the %N format spec, which outputs nanoseconds, so: $ date +%H:%m:%S.%N outputs 19:10:03.725196000 BSD date doesn't understand %N. How can I print the current time with ...
2
votes
3answers
1k views

Inserting shell script into .app bundle

I'm trying to shoe-horn a shell script into an application bundle so that the shell script will be run when I open the bundle, as opposed to the executable put in there. Specifically, I'm trying to ...
3
votes
4answers
2k views

Using locate.updatedb doesn't work in Lion

A week ago I upgraded to Lion from Snow Leopard. I want to use the locate command, but the locate database has not been built yet. So I tried running sudo launchctl -w ...
3
votes
1answer
1k views

Search through terminal history with up and down keys in OS X Lion

After I upgraded to OS X I am not able to use my ~/.inputrc bindings to search through the shell command history: # these allow you to start typing a command and # use the up/down arrow to auto ...
3
votes
2answers
5k views

How to manage tunnels as background processes from a shell script?

I need to set up a couple of ssh-tunnels from a shell script. I've tried running them as bg tasks using: #!/bin/sh ssh -L 3000:server1:5029 me@server2 & ssh -L 3001:server3:3306 me@server2 & ...
4
votes
2answers
287 views

Is there a way to provide a sort order to an mdfind query?

In trying to get a list of all music files from a particular album using mdfind I see that the files aren't necessarily returned in any order. I'd prefer album/track order if possible, but can't find ...
2
votes
2answers
1k 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. ...
1
vote
1answer
278 views

Is it possible to install both Xcode 3 and 4 side-by-side, alternate use either one or the other

I've got a handle on how to install Xcode 3 and 4 on the same machine (running OS X < 10.7), so I'm looking more how to manage this environment. Rather: is it possible to enter some shell command ...