Using programs and commands that do not have a graphical user interface (GUI) but are rather controlled by typing text commands into a terminal program, or shell.

learn more… | top users | synonyms (1)

4
votes
1answer
2k views

How can I add all users to Print Administrator group but not full administrator?

Gordon Davisson offered a solution to a "standalone user" in another question I'm facing the same issue in an office environment. Printer paused and System Administrator needs to be called to enter ...
1
vote
2answers
585 views

How do you list items with and without labels from the terminal?

Is there a command that can tell the label status (labels as applied in the info menu in the finder cmd+i) of an item from the command-line in OS X? Essentially, I just want to list all the items with ...
4
votes
1answer
273 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 ...
13
votes
5answers
45k views

How can I list all user accounts in the terminal?

How can I list all local user accounts (whether logged in or NOT so 'users' or 'who' is no good) in the terminal on a mac? OS X version is 10.6.8. I have seen this suggested - dscacheutil -q group ...
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
514 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 ...
1
vote
0answers
200 views

Signals sent to command-line programs when exiting terminal.app

When using tmux, if I CMD-W, or otherwise quite out of terminal, my tmux session persists, as it should. However, it still lists itself as "attached", whereas on other platforms, (e.g. Ubuntu) when ...
4
votes
1answer
201 views

Command line utility to create screenshot

Is there some command line utility to create a screenshot of the my screen and store it as png? (Preferably one in the system, without need to install anything new)
4
votes
1answer
551 views

How do I find the current Mission Control space number from the command line?

Is there any way to determine the number of the currently active Mission Control space/desktop in Mac OS X Lion from the command line?
1
vote
1answer
328 views

Correct syntax for bash grep function?

I'm trying to set up a function to make certain grep command easier. gr() { grep -r --include=*.\{m,h,xib\} $1 \* ; } The end result should be a recursive grep of all *.m, *.h, and *.xib files, for ...
7
votes
1answer
2k views

Ubuntu-like bash completion in Mac OS X?

I work in the terminal a fair bit, and one thing I really miss from the servers I usually work on is the comprehensive autocompletion bash provides on Ubuntu servers. Are there any readymade tools ...
10
votes
3answers
1k views

What is the “+” mark at the end of file description?

When I execute 'ls -al~', I see + marks, and it prevents me from moving/deleting files. drwxr-xr-x+ 5 prosseek admin 170 Oct 5 03:43 Desktop drwxr-xr-x+ 17 prosseek admin 578 Sep 25 ...
1
vote
3answers
1k views

Matlab on the command line error in Lion

I constantly get this warning in Matlab, which I run on the command line: This process is attempting to exclude an item from Time Machine by path without administrator privileges. This is not ...
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
4answers
2k views

Copy to network share using local disk cache in Mac OS X Lion

I'm using rsync in Mac OS X Lion to copy a backup directory from my local HD to a network mounted share (local LAN). My goal is to archive the local backup to the network drive, thereby freeing up ...
7
votes
2answers
1k views

AirDrop: How to access AirDrop from command line?

I was looking for an option to use Airdrop to sync a set of directories between two computers. I want to achieve this wirelessly(hence chose Airdrop w/o having the computers connect on a network or ...
46
votes
5answers
74k views

Can I open files in TextEdit from the Terminal in Mac OS X?

I frequently find that a terminal command to open a file in TextEdit would be very handy. Does such a command exist on Mac OS X?
7
votes
1answer
329 views

How can I log into the desktop environment as Root on a new mac running 10.6 or 10.7 without creating a user account?

Under Mac OS 10.5, you could boot a fresh-out-of-the-box Mac into single user mode, mount /, set the root password, and touch .AppleSetupDone - this would allow you to log into the desktop environment ...
57
votes
7answers
29k views

What is the difference between iTerm2 and Terminal?

I keep hearing that iTerm2 is much better than Terminal. I downloaded iTerm2 today and played around with it, but I couldn't see what is so much better about iTerm2. iTerm2 seemed just like Terminal. ...
5
votes
2answers
2k views

How do you record audio from command line with osx?

I've tried ffmpeg but there is no /dev/dsp device.
11
votes
2answers
4k views

What is the difference between .command, .tool, and .sh file extensions?

I saw a couple of questions about executing command line scripts? I saw that the .command and .tool extensions were mentioned. I have always used .sh. What is the difference between these different ...
3
votes
2answers
2k views

Disk utility in command line

I'm looking for the CLI equivalent of "Check disk" and "repair disk" in Disk Utility. I think fsck is involved but I don't know with which options, and if it's the only program run.
5
votes
1answer
15k views

How do I remove a user via single user mode in 10.7?

I occasionally will setup a user's machine that has been in for repair beyond the simple re-install of the OS. For example: install a new hd, install the OS, create a user, install updates and then ...
5
votes
1answer
4k views

How do I change back from MacPorts Python to system default version?

I used MacPorts to install a newer version of Python on my system (10.5.8 PPC), and then used the MacPorts select command to change the default invoked version of Python to the MP version. Now I want ...
4
votes
2answers
277 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 ...
0
votes
1answer
670 views

Is it possible to switch from Safe Mode to Normal and back without a reboot?

Since 10.6.3, Apple has decided change the AppleIntelCPUManagement kexts, which leave me stuck with a kernel_task that pegs out at 135-185%, generating a lot of heat. Anyway, since I doubt anyone has ...
4
votes
3answers
851 views

How do I delete a locked, invisible file in the Trash?

On an external disk (that contains a clone), the /.Trashes/501/Users/myusername/Desktop folder contains (within some subfolders) a locked invisible file that I cannot delete. The whole folder starting ...
6
votes
1answer
6k views

How to initiate VPN conection from command line?

I would like to save some mouse clicks and keystrokes by initiating VPN connection from command line. Is there tool for this in Mac OS X? Ideally, it should accept VPN connection name and password and ...
2
votes
3answers
288 views

How to determine out what Wi-Fi channel is used from the command line?

If I hold Alt/Option and click the Airport icon at the top, I get a bunch of extra data about the access point I'm connected to. Most interestingly for me right now is the Wi-Fi channel. ifconfig ...
5
votes
3answers
702 views

How can I initiate a modem connection from the command line?

I am looking for a way to initiate a PPP connection with my EVDO modem from the command line instead of having to go to System Preferences -> Network and hit "Connect".
7
votes
4answers
1k views

What's the best way to install command line utilities such as GIT?

I'm a Windows/Linux guy that just got my Macbook Air. I do web dev, and am currently trying to setup this machine for some on-the-go development. After some research attempts, I'm wondering: what's ...
7
votes
3answers
2k views

Can Finder and the “open” command treat files with .sh or other typical extensions just like .command files?

I am looking for a way to inject some more extensions into the OS X launch services database systematically so that when clicked, they execute in the terminal app just like .command files do by ...
4
votes
6answers
8k views

How do I execute command line scripts?

In Windows, I can create .bat files. I double click it and all lines are interpreted as if I had entered it into the console. In OS X, what file or program do I have to use? If I want write a file ...
7
votes
7answers
2k views

How to list all available .plist keys on a certain domain application by defaults command?

I want to know all keys (property list) which available on certain domain application, as example i could list available key for com.apple.dock by entering this command: $ defaults read ...
5
votes
3answers
109 views

Can command-line commands be made insensitive to order of filenames and options?

I'm new to Mac usage. It seems that most commands trip over options given after the file names. In linux, which I've used for years, it doesn't matter. On Apple, it does. Is there some setting ...
22
votes
5answers
25k views

How to always show menubar with fullscreen apps?

Does anyone know if it is possible to keep the menubar in Mac OS Lion visible for fullscreen apps instead of hidden until hovered over with a mouse or trackpad? I imagine there's some Terminal ...
0
votes
1answer
136 views

How do I list the plugged memory sticks on Mac OS

How can I list all the currently memory devices on MacOS X? I need to do this by command, because I have an Java application that needs this information. Thanks
4
votes
4answers
1k views

Temporary files listed by lsof don't exist

I like copying flash videos for offline viewing later. I used to do this by loading the video in the browser (Firefox or Google Chrome), then running this command to see where the flash file was being ...
18
votes
10answers
20k views

Password dialog appears when SSH private key permissions are set to 0600

I installed my SSH private key in ~/.ssh/id_rsa and set its permissions to 0600. When I connect to an SSH server which uses my private key in Terminal.app via ssh, a dialog pops up and asks me to ...
9
votes
4answers
8k views

How do I take a steathy picture with my iSight camera from the command line?

Is there a command line utility that allows me to take a picture from the built in camera? Something like screencapture allows for, well, screen captures. The reasoning for a command line tool is I ...
3
votes
2answers
1k views

Package command line tools into an automator script or app?

I'd like to know if there's a way I could package compiled command line tools together as part of an automator script or an app. Let's say, for example, I want to use a command line tool called foo ...
9
votes
3answers
2k views

How can I force command-line arguments to a program shortcut in the dock?

I have Chrome installed in Applications, and a shortcut to it in the Dock. How can I achieve to force some command-line arguments to each start-up of this app? Let me be clearer, in the Terminal, I ...
2
votes
1answer
399 views

Mac Terminal: emacs-style command editing messed up

This has been a "quality of life" issue for me for a while now- command-line editing in the Mac terminal is messed up for me. If I type a few chars, and then hit CTRL-A to move to the beginning of ...
3
votes
2answers
496 views

How do I set the creation time of a file?

I have a script that converts a file to another format, and I want the resulting file to have the same timestamps as the original, including the creation time (as shown by ls -lU). I can use touch to ...
1
vote
1answer
123 views

Adding Mac-specific directory to PATH when home is shared

My /home/myusername/ directory is provided through a network, and looks exactly the same on my Linux machine and my Mac Mini. I'd like to add to PATH a directory of Mac-specific software in my home, ...
4
votes
2answers
440 views

Using grep on Mac-style text files

When I run grep on a text file, I get nonsense results. It seems as if the whole file is printed out but on one line overwriting itself. I read that on the Mac, text files use \r instead of the ...
18
votes
6answers
36k views

How do I start TextEditor from the command line?

I work a lot at the command line in a Terminal and would like to start a text editor on a certain file. I'm from Linux Land and normally use kwrite or gedit from a bash shell. Trying to find the Mac ...
1
vote
2answers
84 views

Regarding groff - where is the config file and will this work?

I've been reading Terminal Tips and Tricks For Mac OS X when I came across this. bman () { gunzip < `man -w $@` | groff -Thtml -man | bcat } Apparently I should be able to view man pages ...
10
votes
8answers
7k views

How to retrieve current wattage info on OS X?

Is there a way to retrieve the current watt usage info on OS X Snow Leopard? I'm using mid-2010 iMac, so I'm not looking for just battery-related apps. Does OS X even monitor power usage? Do I need ...
0
votes
2answers
291 views

command line ps has stopped working correctly after an update

I use to be able to run this ps command from the terminal: ps -u whoami -o pid,rss,command But recently the RSS size returned are all 0! ps -u `whoami` -o pid,rss,command 158 0 ...