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
228 views

How do I monitor the total physical and virtual memory usage of a process and all of its descendants?

From the command line, how would I get the total physical and virtual memory usage of a process and all of its descendants (not just 1st-level children)? This is useful when you want to monitor the ...
35
votes
8answers
66k views

Why doesn't .bashrc run automatically?

I put some alias commands in my .bashrc file, so that they might be loaded everytime I open a new Terminal window. Yet this doesn't happen. I have to select run script: in the ...
3
votes
1answer
215 views

List of GNU packages for homebrew

My team is working with Mountain Lion MacBook Pros, and we're using the GNU CLI tools, like wget and watch, intensively. Whenever a new team member joins us, we tell the new hire to install homebrew ...
1
vote
3answers
2k views

How do I change GNU Screen's meta-key to Cmd-a?

GNU Screen's default meta-key is Ctrl-a, which is really inconvenient for me because I frequently use Ctrl-a and Ctrl-e to move the cursor to the beginning or end of the line. I'd prefer to change ...
0
votes
2answers
573 views

Temporarily disable Notification Center in Mountain Lion from command line?

I've been trying to create a script to disable/enable the Notification Center, even if it's temporary. It should do the same as manually sliding the Notification Center, scrolling up, and toggling the ...
4
votes
1answer
455 views

How do I prevent the permissions denied message from being displayed when I do a find command?

I'm trying to run a find command, aka: find / -name "some_file" -print and my results are full of permission denied messages: find: /.DocumentRevisions-V100: Permission denied How do I prevent ...
7
votes
6answers
7k views

How to send an email from command line?

How to send an email from command line or script? I want to be able to run the script programmatically by passing the receiver and the message.
4
votes
2answers
4k views

How to change the creation (st_birthtime) date/time of a file in Lion?

touch(1) can only change modification and access times, but has no options for creation time. This does not work, at least not on Lion. So how do I change the creation time, also referred to as ...
1
vote
2answers
151 views

Is there a way to set an Application Shortcut in the Keyboard Preference Pane via Terminal?

I'd like to have a bootstrap for my custom keyboard shortcuts to use on multiple machines...
1
vote
2answers
277 views

Why do I keep getting this error message after updating to OS X 10.8.1?

After I updated to OS X 10.8.1, I keep getting this error message when I execute purge: [ERROR] The device-file for this operating system, 'osx-12.1.0.xml', was not found. An attempt to revert ...
4
votes
2answers
632 views

Is it possible to get the full suite of unix options for the command line tools on OS X?

I follow Unix Tool Tip on Twitter and it is interesting that many of the tips that are posted are not available on OS X. For example: cp - u will only copy files that don't exist, or are newer ...
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 ...
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 ...
6
votes
1answer
907 views

Adding a song file to iTunes via the command line without playing the file

I want to add song files to iTunes via the command line. open -a iTunes -g song.mp3 does exactly this. - However it starts playing the song, too. Any way to avoid this?
2
votes
1answer
337 views

Play .ogg on command line

How can I play a .ogg music file on the command line? On Linux I can use ogg123, but what about on Mac?
1
vote
1answer
408 views

Where do I find the full man page for afplay

In Terminal afplay -h shows full help text but the man page shows hardly nothing. Is there any way to get a longer help page for man afplay? I never use Terminal and it would be much easier if i ...
0
votes
1answer
126 views

Using dictation in the command line (e.g. transcribe an audio recording to a text file)

I have some audio recordings and would like to transcribe them into text files. I was wondering whether there is a command line tool that could use the built-in Dictation to do that? And if so, is ...
0
votes
1answer
823 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
1
vote
2answers
467 views

Converting Audio to AC-3 using afconvert?

I'm trying to use afconvert to convert an audio file to AC-3 format. It's 5.1 audio, having already been converted from DTS to WAV (using ffmpeg, since afconvert doesn't seem to deal with DTS). As ...
1
vote
3answers
464 views

Files synced by Synk Pro have wrong owner on both synchronized Macs – how can I fix it?

I sync some folders within my Home folder between two Macs (running Lion and Mountain Lion) using Synk Pro, a commercial live file sync application. I have the same account name on both computers. ...
3
votes
1answer
3k views

How to remove xattr com.apple.quarantine from all .webarchive files with that extended attribute?

Spread across multiple file system I have numerous .webarchive files that were saved by OmniWeb. So for example: sh-3.2$ ls -@ 2012-03-19.webarchive 2012-03-19.webarchive sh-3.2$ ls -@l ...
1
vote
1answer
388 views

What does it mean when a process is surrounded by parens in `ps`?

I sometimes try to kill -9 Finder.app when it's misbehaving and I'm in a Terminal. This normally works but every once in awhile it leaves behind the pid, even when run with sudo, and the COMMAND ...
0
votes
1answer
408 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 ...
3
votes
1answer
259 views

Using the apple wireless keyboard with an iPad with PC/Mac-like keyboard commands

I have jailbroken iPad2 (iOS5.1.1) and an apple wireless bluetooth keyboard that I use for typing on the iPad. Although the keyboard is a joy to use, I can't use it for much else other than typing ...
2
votes
4answers
2k views

How to run Wireshark in the background without the GUI?

I am trying to run Wireshark on Mac OS X in the background. I installed the command line utilities, and so I am able to start Wireshark and capture packets using the command line. The only thing I ...
3
votes
3answers
984 views

Can I list files ordered by date added to a folder from a command-line tool like ls?

I need to build a script that shows files in the same order as the default Downloads folder in the dock, ordered by Date Added, newest first. I can't seem to find the option in ls. Any other way to ...
0
votes
1answer
2k views

How do I install handbrake cli?

I've downloaded the Handbrake CLI. What's the best place to install a command line app on my Mac?
0
votes
1answer
1k views

How can I get tab completion back?

In terminal, if I try tab completion in a directory e.g. Movies, instead of the movies beginning with S (if I type S followed by tab, I see SetFile, Splitforks and SystemStarter. I suspect I installed ...
2
votes
0answers
97 views

“df” command making network requests?

I was watching Little Snitch for another process, and noticed df was making requests to various servers. I thought df was only for checking free disk space locally, but it appears to be doing more ...
2
votes
0answers
4k views

How do I force a partition and format on a USB key in OS X Mountain Lion Disk Utility or from CLI diskutil?

I have a brand new Memorex TravelDrive 64GB USB disk which is being troublesome. It's formatted FAT16 on MBR, which is not so nice, and I'd like to put it on HFS+. I've tried to do this through ...
2
votes
1answer
251 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 ...
8
votes
3answers
1k views

Copying files to the clipboard using applescript

Often I find myself at the command line wanting to copy files to the clipboard, so that I can paste them as attachments in Mail. If I have an image file, image1.png, I can accomplish this with ...
2
votes
1answer
187 views

Why do debuggers need an admin password?

Why does running LLDB or instruments require elevated privilages?
1
vote
2answers
1k views

Display dialog from command line (like xmessage does)

Background I'd like to be able to display a notification window in OS X from within a script. The script will be running in background, so the notification should not go to the terminal but instead ...
1
vote
2answers
434 views

Use Cmd as Ctrl key in vim

How can I input commands such as <Ctrl-W> and <Ctrl-]> in vim using Cmd instead of Ctrl? The reason why I want to do it is because it's more comfortable. When I need to switch to a ...
1
vote
1answer
90 views

Backing up individual files with encryption

In addition to local Time Machine backups, I would like to automatically backup my working data from my Macbook to a remote FTP space. Because it's a location I don't control and sensitive data, I ...
3
votes
1answer
10k views

Create new partition in unallocated space with diskutil

I have deleted the first partition on my external HD such that it now has 100GB of free space at the beginning of the partition. I'd like to reclaim that space, but Disk Utility doesn't let me create ...
6
votes
1answer
254 views

Incorrect Terminal.app output for long lines with tabs

When I run the following command in Terminal.app: echo -e "a\tb\tc\td\te\tf\tg\tyo" I should get the following output (using a 40-column window so that lines don't wrap here, and replacing tabs ...
6
votes
2answers
3k views

What is the preferred method of command line domain name lookup (DNS)?

What command line command do I use to lookup a domain address? When looking at the man pages for nslookup and dig I can see a section saying that these utilities do not use the Mac OS methods of ...
8
votes
2answers
1k views

Can user accounts be managed via the command line?

Is there any way to add, remove, or modify user accounts via the command line? I'm not talking about an account for a system process or daemon, I mean is there any way to add a user account, change, ...
2
votes
3answers
993 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 ...
15
votes
1answer
1k views

Why is lsof on OS X so ridiculously slow?

I can't figure out why lsof on my Mac (10.8.2, MacBook Pro) is so slow. On my Mac, lsof takes more than a minute: $ touch /tmp/testfile $ time lsof /tmp/testfile real 1m16.483s user 0m0.029s ...
1
vote
0answers
123 views

How to install Writer2LaTeX in command line

This is the app I want to install, in ubuntu it was done automatically, but somehow in Mac it seems that I have to install manually. Writer2LaTeX http://writer2latex.sourceforge.net/ In the ...
0
votes
0answers
20 views

How can I toggle internet sharing from the command line? [duplicate]

Possible Duplicate: Start/stop internet sharing from a script? There are applescripts / automator scripts that help to turn on / off internet sharing, but they do not work consistently ...
5
votes
6answers
5k views

Improved Terminal autocomplete funcionality (similar to Matlab's)

If any of you ever used Matlab, you might have noticed the command window functionality in that program. I wonder if it is possible to enable the same functionality in Mac Terminal. It works like ...
4
votes
1answer
6k views

Is there a Mac OS X equivalent of the Linux iwconfig command?

I'm looking for a command line tool in Mac OS X that performs the equivalent of the iwconfig command in Linux. Example: kirkland@x220:~/src/byobu/byobu$ iwconfig wlan0 wlan0 IEEE 802.11abgn ...
3
votes
1answer
517 views

Is it possible to open in default browser a URL from command line reusing same tab?

I know that I can use open command to open a URL in a default browser like: $ open http://google.com But what I would like is to execute a similar or same command to open different URLs one after ...
0
votes
1answer
65 views

Bug in 'file' command on 10.5.8? (Or am I doin' it wrong?)

On my OS X 10.5.8 system, the man page for 'file' says: -h, --no-dereference option causes symlinks not to be followed (on systems that support symbolic links). This is the default if ...
1
vote
1answer
478 views

What's the difference between device file and its raw version?

It's convenient to use dd to write image file to USB sticks. But I find sometimes people write dd of=/dev/disk1 and there is alos dd of=/dev/rdisk1. e.g. The arch wiki dd if=image.iso ...
3
votes
2answers
306 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 ...