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

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 ...
10
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
283 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
244 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
4k 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
55 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
581 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
6k 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
299 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
279 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 ...
1
vote
2answers
692 views

find video codec from terminal

I'm writing some shell scripts that automatically convert some video files. Except I don't want to run the conversion on files that are already h264 encoded. Is there a way I can tell via a terminal ...
4
votes
2answers
386 views

Make locator.updatedb run daily on Snow Leopard w/o hacking /System/Library?

On Snow Leopard, the locate database is updated once a week by a launchd job, /System/Library/LaunchDaemons/com.apple.locate.plist. I'd like to make the updater run daily, but AFAIK it's considered ...
2
votes
1answer
347 views

Add info to Dock/Menubar from Shell in macOSX

I'm working on MacOSX environnement, but I would like to tweak it a bit. I have a few bash scripts I used in Linux to retrieve infos such as IP, average ping and so, that I would like to be displayed ...
3
votes
2answers
570 views

Identify connected external disks programmatically

I want to write a shell script that ejects all currently-connected external drives (either USB or Firewire drives). I can use the disktuil eject <disk-path> to eject a specified drive. But I ...
1
vote
3answers
708 views

Make a screen-shot and upload with a script

I am not very good with AppleScript but I would imagine this is something quite easy for the AppleScript guru out there, I am looking to make a screenshot of a region like with doing Apple-Shift-s and ...
1
vote
3answers
2k views

How to dim (and un-dim) display in automator

For those that are interested in the final script you can get it here original question I am trying to make a alarmclock script to wake me up. but I can't figure out how to change the screen ...
3
votes
5answers
7k views

How can I write a script to open multiple terminal tabs and execute code in them?

I want to be able to open the terminal application and have it either automatically run a script that opens several tabs and run an arbitrary set of commands in each. For example I would like one tab ...
1
vote
2answers
2k views

Change Account Password to Blank

I recently changed an account password by accident, and was wondering how to set it back to a blank password via the shell. I have root privileges. Please help :) passwd USER doesn't accept blank ...
1
vote
1answer
825 views

How to automate execution locate.updatedb by using a bash script

I am looking for a bash set of commands that will enable me to schedule the execution of /usr/libexec/locate.updatedb once every day. Please respond only with a set of command line commands, because ...
5
votes
3answers
2k views

Opening a terminal window to a specific directory from a bash script

How can I write a bash script in Mac OS X that opens a Terminal window in a specific directory? I'd assume something like: open /Applications/Utilities/Terminal.app But that does nothing (maybe ...
1
vote
5answers
455 views

opening an app in a shell script with sudo

I'm trying to open an app that listens to port 25 within a shell script. In order to listen to port 25, I need to run the app with sudo. So I tried the following: sudo open appThatNeedsPort25 It ...
1
vote
2answers
603 views

Why does ssh log me in as the wrong user?

I am shelling into my Mac (ssh) and get logged in with the wrong userid. There are three unprivileged user accounts on the system, and when I log in, I give my password, and whoami gives me either of ...
2
votes
1answer
161 views

Porting Linux shell scripts

The command shell$ ls . -R works on Linux but not on OS X. This is because OS X command line options have to come before the arguments,and not just anywhere as in Linux. In particular, this ...
1
vote
1answer
827 views

AppleScript app started prompting to run or quit. How can I disable this?

I'm not entirely sure why this has started happening since this is completely new behaviour and I haven't done any system updates but I have a nice little toolbar app for my Snow Leopard Finder.app ...
8
votes
2answers
8k views

Reset your PATH variable

I stuffed up (basically wiped) my PATH variable. Is there any way to reset it to the default? I look at How do I reset the $PATH variable on Mac OS X?, but I find it very confusing. As far as I ...
3
votes
2answers
2k views

open new terminal tab in the same directory with the active tab

In GNOME Terminal of Ubuntu when you open a new tab the new shell will automatically start you in the current working directory of the active tab shell. E.g. if in the active tab shell I am on ...
2
votes
3answers
1k views

Check if a process is running, if not execute it again in Terminal

Is there a way to periodically check if a process is running with (probably with Apple script, or some other shell script) and if not then to execute it in Terminal? I have a PHP script that is needs ...
2
votes
1answer
978 views

Why won't wget work with cron?

I've been using the bashpodder script (http://lincgeek.org/bashpodder/) recently, and while the script works beautifully when I use it in the command line, the crontab I created for it doesn't work at ...
0
votes
2answers
7k views

Automator choose finder folder and run shell script

I've got a simple shell script that I would like to incorporate into an automator workflow. I just need to double click the application , pick a finder folder and run the command. At the moment it is ...
1
vote
2answers
764 views

How do I use a keyboard shortcut to execute a shell script I wrote, passing the file selected in Finder as an arg?

I suppose you could have it pass in whatever was selected in general in any app (such as text highlighted in a web browser).
9
votes
1answer
12k views

Bash or Zsh, what's the difference, why use one or the other?

So, the question pretty much says it all. I'm on Snow Leopard, and I do a lot of web development, particularly in Rails 3 which makes heavy use of the console. I've seen some notable bloggers etc. ...
11
votes
4answers
8k views

Is it possible to run Nautilus on OS X?

Is it possible to run Nautilus instead of Finder on Mac OS X Snow Leopard? How?
4
votes
2answers
238 views

Group running apps in OSX?

Since I'm working on several projects that require different resources (shells, files, chrome windows, etc), I'd like to organize them better. Is there a mac utility or something that will allow me ...
4
votes
3answers
1k views

Running .NET binary with mono

When I have abc.exe generated from C#/Mono source, I use 'mono abc.exe'. Is there a way to run abc.exe with 'abc.exe' not 'mono abc.exe'? I mean, when I run 'abc.exe', can I make 'mono abc.exe' ...