1
vote
1answer
39 views

skill -KILL -u $user Command on Max OS X?

Is there an alternative for the skill -KILL -u $user command on the Mac OSx. The basic requirement is I want to log out my current logged in user at end of shell script This program logs out Linux ...
3
votes
2answers
59 views

How to have locatedb created / updated automatically?

I ran locate blob.txt and I got: $ locate .bashrc WARNING: The locate database (/var/db/locate.database) does not exist. To create the database, run the following command: sudo launchctl load -w ...
2
votes
0answers
36 views

Why is Terminal.app corrupting my tcsh history?

I've had an ongoing problem that appears to be specific to OS X and Terminal.app: periodically, I get garbage in my tcsh history that looks like this: ^[[1m^[[4mcomputername:~/Code/emacs-source ( ...
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 ...
0
votes
0answers
11 views

Command Line Tips and Tricks [duplicate]

==>> What are the most useful Unix shell "one-liners" that you use? <<== Here are a couple of mine to get the conversation started: 1. Repeat the previous command with a substring replacement: ...
0
votes
1answer
159 views

In iTerm, why is a command shell's command not picking up things on my $PATH?

I've got a script in my ~/.bin directory that changes iTerm's background before starting an SSH session (as detailed here, script slightly modified from this version). If I start a regular login ...
0
votes
0answers
31 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
1answer
362 views

Why would SetFile be unavailable after upgrading to Mountain Lion?

I have Xcode installed, and have used the SetFile command (installed with Xcode) for some time. I just upgraded to Mountain Lion, though, and find that it is suddenly unavailable. I verified that ...
2
votes
3answers
810 views

How to determine the absolute path to a file in a shell script

I am writing a generic script that can get passed both absolute and relative (to the current working dir) paths to existing files. I need a fail-safe way to turn all those passed paths into absolute ...
1
vote
2answers
102 views

How can I do the equivalent of a Unix find / -print [under user permissions] under Mountain Lion?

I am doing, or trying to do, a 'find /' which I would like to recursively list every file the user has permission to access under the volume "Macintosh HD" and nothing else. I am presently filtering ...
2
votes
2answers
415 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
2answers
1k 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 ...
11
votes
2answers
863 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 ...
15
votes
3answers
20k 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
2k 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 ...
4
votes
1answer
263 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 ...
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 ...
3
votes
1answer
459 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 ...
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 ...
4
votes
2answers
263 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 ...