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)

19
votes
5answers
6k views

How can I change a file or folder icon using the Terminal

How can I change or set the icon for a file or folder, in the terminal, do I need to use a scripting language?
24
votes
5answers
26k 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 ...
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 ...
16
votes
4answers
5k views

How do I speed up new Terminal tab loading time?

How can i speed up the terminal startup in Lion? I'm not referring to the startup of the Terminal application, but to the startup terminal windows, like when i open a new tab. I don't have anything ...
9
votes
2answers
10k 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 ...
5
votes
1answer
2k views

Why is a command line change to ~/Library/Preferences/com.apple.LaunchServices.plist not effective immediately?

When the Info window of Finder is used to associate files of a particular type with an application: the preference is effective immediately. When Terminal is used to make a comparable addition ...
4
votes
2answers
3k views

How to change tap to click using “defaults write” from command line?

I want to change the trackpad tap-to-click property from the command line. Graphically, I can do it by clicking System Preferences -> Trackpad -> Tap to Click. How can I do it from the command line? ...
2
votes
3answers
3k views

Change file association in terminal?

Is there a method for associating file types with applications via terminal? I thought ~/Library/Preferences/com.apple.launchservices.plist might do it, and I also have seen: Why is a command line ...
37
votes
8answers
71k 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 ...
5
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 ...
4
votes
5answers
2k views

Monitor a folder for changes, and run a command when a change is detected

Is there a simple way to automatically run a (Terminal) command every time a file is changed in a specific folder? This should be possible via the command line, or a system built-in application, no ...
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 ...
3
votes
2answers
521 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 ...
17
votes
7answers
9k views

Can home and end keys be mapped when using Terminal?

The home and end keys on a MacBook Pro can be emulated with fn + left arrow or fn + right arrow. Or when certain settings are changed, with the Command (Apple) key instead of fn. None of these ...
33
votes
2answers
709 views

Where should I store command line applications?

When I download command line applications they are located in my ~/Downloads/ directory. But I feel this is wrong place to have a command line application located. Where in the Mac OS X filesystem ...
19
votes
10answers
23k 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 ...
10
votes
2answers
1k views

why does OSX add extra '._<filename>' when I tar a directory?

I'd just like to know why if I "tar -czf" a file/directory, osx adds a: ._ for each file? I see these when I untar in linux. Or when I work with the uncompressed project in eclipse as it doesn't ...
17
votes
14answers
7k views

Lock Screen Command One-Liner

I'm trying to find out whether there is any kind of equivalent command line one-liner which replicates the exact identical functionality of the 'Lock Screen' menu option available via the Keychain app ...
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 ...
10
votes
4answers
2k views

Updating modifier key mappings through defaults command tool

I am trying to automate the inital setup of my macbook, that includes installing software and changing OS X configuration to my needs. I have tried to update the modifier keys with defaults, the ...
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 ...
10
votes
3answers
3k 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 ...
9
votes
2answers
2k views

How can I install the Command Line Tools completely from the command line?

I'd like to script the installation of the the Xcode Command Line Tools. On Mavericks, xcode-select --install will open a dialog prompting the user to install, but I'd like to trigger the install ...
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
4answers
1k views

Is there a better way to shutdown/restart OSX?

Whenever I want to shutdown/restart OSX I click on the menu, select shutdown, and then click the box for not saving the session, and then click OK. Then there's always at least one program that ...
4
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 ...
3
votes
1answer
11k 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 ...
7
votes
2answers
7k views

How does 'stuck' (in results of 'top') relate to 'not responding' (in Activity Monitor), 'spin' or 'hang'?

In results of top commands, I sometimes see stuck. Apple's top(1) OS X Manual Page does not explain this use of the word. How, if it all, does stuck relate to the following? not responding – ...
5
votes
3answers
113 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 ...
4
votes
0answers
158 views

“Open with” in Finder.app gives duplicate entries [duplicate]

Possible Duplicate: How to omit apps from external drives in “Open With” menu? in finder's open with menu are a lot of dups. I am running latest OX X and patches. I googled and found ...
3
votes
3answers
11k views

Use curl to download images from website using wildcard?

Is there a way to use curl to download non-sequential images with a wildcard? I want to download all the panoramas I upload to my account at 360 Panorama to a local folder so I don't have to do this ...
3
votes
3answers
2k views

.tar files on OS X Lion

How am I supposed to deal with .tar files with OS X Lion? I'm trying to install Ruby Version Manager, but Lion is throwing a fit about not being able to expand the tar file. This isn't the first time ...
2
votes
2answers
268 views

place text over image without imagemagick

I have a png image file which I would like to overlay text onto, via the command line (for use in a Makefile). The text to be overlaid is dynamic, decided at the time the image is modified. I am ...
2
votes
3answers
1k 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 ...
2
votes
1answer
207 views

How can I run a shell command at login time without showing a Dock entry? [duplicate]

Possible Duplicate: How to run something automatically when the system boots or a use logs on? I need to automatically run a command when I log in but I don't want to add an item to the ...
50
votes
3answers
19k views

git auto-complete for *branches* at the command line?

On my linux machine I have autocomplete for branches with git. For example I can type git checkout [TAB] and get a list of branches. Or I can type git checkout feb* [TAB] to get all branches that ...
60
votes
7answers
32k 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. ...
52
votes
5answers
81k 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?
35
votes
6answers
13k views

How to move files to trash from command line?

I do a lot of terminal work, and today had the experience of typing rm fileInQuestion.txt Before finding out that I did actually need fileInQuestion.txt. If I'd deleted in the GUI then I would have ...
9
votes
3answers
16k views

What steps are needed to create a new user from the command line on Mountain Lion?

What commands (or script) can create a fully functional user account on Mountain Lion, running only from the command line via terminal or ssh. It looks like an existing pair of answers might work, ...
23
votes
2answers
8k views

Linux' `ps f` (tree view) equivalent on OSX?

How can I get a tree view like the one below on OSX? vartec@some_server:~$ ps xf PID TTY STAT TIME COMMAND 11519 ? S 0:00 sshd: vartec@pts/0 11520 pts/0 Ss 0:00 \_ -bash ...
12
votes
2answers
6k views

How can I find the serial number on a mac programmatically from the terminal?

What command can I use to retrieve the system's serial number from the unix command line? As uname will output some information about the software and hardware, I would like to retrieve the serial ...
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 ...
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 ...
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, ...
8
votes
1answer
2k views

Why does it appear that I apparently “do not have access to Command Line Tools” in ML?

I just upgraded to Mountain Lion, and now gcc, make, g++, etc. are not found when trying to launch them in Terminal. So I went to Xcode Preferences, Downloads, and clicked "Install" next to Command ...
7
votes
3answers
4k views

How does Mountain Lion set the default text editor for the “open -t” terminal command?

OSX seem to offer open -t command line shortcut to open arbitrary files in the system default text editor. Where is this default text editor set? Can I change it from the command line (if possible) ...
5
votes
1answer
4k views

How to control AirPort wireless radio from the command line?

I want to know how to control (specifically turn off) the networking (specifically AirPort - I want to turn off the radio) from the command line (specifically from bash in Terminal.app, being run by ...
4
votes
3answers
871 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 ...
3
votes
1answer
178 views

How to kill the popup in OS X when a disk can't be ejected

With ZFS-OSX, sometimes when I try to force eject my HDD and it's failing, the following popup appears on my screen – floating on the top with all the buttons grayed out – and no possibility to close ...