An Introduction to Tiger Terminal
Pages: 1, 2, 3
Animate Your Desktop and Then kill It
Here's a fun trick to do with the Terminal that affects the GUI--the famous animated-desktop trick. In this Terminal hack, you can change your desktop from a static picture to an animation. Along the way, we'll learn a trick to save on long typing (and typos).
Go to the Finder and then to the Screen Saver preferences pane. Select an animated screen saver; the new RSS Visualizer included in Tiger is a good choice for this exercise. Mine is set for Slashdot RSS. (Did my latest review get accepted yet?)
Now, you have a couple of choices. You can type in this loooong command:
tigerbeta:~ tigerbeta1$ /System/Library/Frameworks/
ScreenSaver.framework/Resources/ScreenSaverEngine.app/
Contents/MacOS/ScreenSaverEngine -background
Note: There is one space before the -background (dash background). There are no other spaces in the entire command line.
or you can copy and paste the above command (cheater);
or you can use the Finder for a little help:
Open a new Terminal window.
Go back to the Finder and follow the path above up to ScreenSaverEngine.app.
Drag this app to your open Terminal window and drop it at your waiting command-line prompt.
Type (or copy/paste) in the last bit:
/Contents/MacOS/ScreenSaverEngine -backgroundHit
Enter.Hit
F11and look at your desktop!
One caveat is that this takes up a huge amount of processing power. Open a new Terminal window and type top and hit the Enter key. top gives a dynamic display of every program and background operation currently running by descending PID (Process ID) order. You'll see that the screensaver app is taking at least 10 percent of your system's attention.
To end the process, go back to the Terminal, where the desktop animation is still executing, and hit Control-C (^C). If the app turns psycho and won't quit, you can kill it using top and the Terminal. In the example below, the PID of the screensaver app is 223:

To kill the offending application is the equivalent of using the Force Quit command in the Finder:
tigerbeta:~ tigerbeta1$ kill 223
tigerbeta:~ tigerbeta1$
If the process still won't quite, enter kill -9 PID (the -9 signal means "non-ignorable" or "I really mean it!"):
tigerbeta:~ tigerbeta1$ kill -9 223
tigerbeta:~ tigerbeta1$
Empty the Trash
A common problem many users experience at one time or another is a file stuck in the trash that can't be deleted. An easy fix is to use the Terminal:
tigerbeta:~ tigerbeta1$ sudo chflags nouchg ~/.Trash/*
Password:
tigerbeta:~ tigerbeta1$
The nouchg option to the chflag command ("change file flags") unlocks the file. The nouchg keyword is actually the word no in front of the uchg option ("set the user immutable flag") so no turns the option off. You should now be able to delete everything in the Trash normally.
Conclusion
There are many things the Finder is good at and certainly for many users, a trip to the Terminal is a scary prospect. But I hope this article introduces some useful (and fun!) things the Terminal can do for you that give you some courage to try out more advanced commands.
|
Related Reading Mac OS X: The Missing Manual, Tiger Edition |
Mary Norbury-Glaser is the IT director at a University of Colorado affiliate center. She has over 15 years of experience in cross-platform systems administration in the education sector. She loves fast cars and geocaching.
Return to MacDevCenter.com.
You must be logged in to the O'Reilly Network to post a talkback.
Showing messages 1 through 41 of 41.
-
File names that contain spaces
2007-01-07 18:17:41 DMendoza [Reply | View]
Thanks for these tutorials, they are fun. One question on the rm command. I was using a file that had a space in the title and can't get the rm command to see it. If there are no spaces in the name, everything works fine. How can I get the terminal to recognize a file name that contains a space? I've been searching the man pages but can't seem to find the answer.
-
Escape from 'man' pages
2006-12-07 19:37:53 josephjames [Reply | View]
This series was great. Thank you.
One question. How do I escape the 'man' pages once I'm finished reading them and return to the usual normal Terminal prompt? I've searched all over scanning everything on the 'man' command and can't find the answer to this. Because I can't figure it out, I have to quit Terminal and restart it after each use of the 'man' command.
Thanks.
-
a tiny help.I am confussed
2006-09-08 16:05:51 Hellmuthchileno [Reply | View]
Great tutorial indeed!
However in spite that the man pico command indicates the manual for nano (just as the article indicates), this program is not installed and Terminal provides a list of the installed editors, xterm etc., defaulting to ansi an editor I do not know.
One question please:
Could you indicate how to install nano in the version 10.4.7 that seems to be absent from terminal?
Eventually how to use ansi as an editor?
is this a feature of Mac OSX 109.4.7 or what?
I would greatly appreciate your kind answer
A faithful reader and client of O´Reilly handbooks.
Kind regards
Hellmuth Stuven Lira -
a tiny help.I am confussed
2006-09-17 19:04:49 norburym [Reply | View]
To install nano:
www.nano-editor.org
The latest is nano-1.2.5.tar.gz
Type the following in terminal:
$tar xzf nano-1.2.5.tar.gz
$cd nano-1.2.5/
$./configure
#stuff comes out here
$make
$sudo make install
password:
#more stuff
The executable is installed into /usr/local/bin/nano and man pages will be in /usr/local/man
If you don't have /usr/local/bin in your search path, you'll have to add it or use the full path name when calling up nano.
To answer your other questions:
if your computer had pre-Tiger installed and you did an upgrade/archive install instead of a full clean install then you most likely didn't get nano (you probably don't have bash as the default shell, either).
I suspect that you have some localization issues here: from your name, I think you are Danish but your avatar looks like you are currently in Chile...?
If you have some localization settings at play, you may want to look at your Terminal - Window Setttings - Display - character set encoding. Mine is set to Unicode UTF-8.
Xterm runs under X11 (i.e. an X window application) so you may be running X11 and launching xterm rather than terminal.
Hope some of these hints help!
Cheers, Mary
-
Terminal problems
2006-03-02 00:24:12 Mystefier [Reply | View]
I was going through the terminal tutorial and for some reason everytime I type in the command to change the one file name and it prompts for my password, it will not except any letters. When I try to type my password it shows no reaction to my typing. Also I don't know what GUI and CLI are. I don't know if there's a tutorial I should have read first, but it's kind of difficult to tell what order to take these tutorials in. If you can help. Thanks.
-
Terminal problems
2006-03-02 17:57:58 norburym [Reply | View]
Start with Part One: http://www.macdevcenter.com/pub/a/mac/2005/05/20/terminal1.html
Then go on to Part Two: http://www.macdevcenter.com/pub/a/mac/2005/06/14/terminal2.html
Part Three: http://www.macdevcenter.com/pub/a/mac/2005/07/05/terminal3.html
Part Four: http://www.macdevcenter.com/pub/a/mac/2005/09/09/terminal4.html?page=1
Part Five: http://www.macdevcenter.com/pub/a/mac/2005/11/15/terminal5.html
GUI: Graphical User Interface
CLI: Command Line Interface
-
repairPermissions
2005-11-18 11:01:29 bfurlong [Reply | View]
I installed an application which someone apparently didn't write a very good uninstaller for. The result is that everytime I enter bash, my terminal trys to issue a sudo diskutil repairPermissions/ command, the only thing that stops it is the request for password.
Last Login: Friday Nov 18 13:33:13 on ttyp2
sudo diskutil repairPremissions /
Welcome to Darwin you Sea-Slug!
K:~b& sudo diskutil repairPermissions /
Password:
Please show me how to stop my terminal from repairing Permissions everytime I open it.
-
adding lines to a file
2005-09-11 15:49:57 alcamino [Reply | View]
since my last software update i am having trouble syncing my motorola v188 phone. i found the following post on the web:
V180 works with iSync but the V188 was not working for me. I added support for it by adding the folowing lines to /Applications: iSync.app: Contents: PlugIns: ApplePhoneConduit.syncdevice: Contents: PlugIns: PhoneModelsSync.phoneplugin: Contents: Resources: MetaClasses.plist:
<key>com.motorola.V188</key>
<dict>
<key>Identification</key>
<dict>
<key>com.apple.cgmi+cgmm</key>
<array>
<string>"Motorola CE, Copyright 2000"+"GSM900","GSM1800","GSM1900","MODEL=V188"</string>
<string>"Motorola CE, Copyright 2000"+"GSM900","GSM1800","GSM1900","GSM850","MODEL=V188"</string>
<string>"Motorola CE, Copyright 2000"+"GSM900","GSM1900","GSM850","MODEL=V188ENS"</string>
</array>
<key>com.apple.gmi+gmm</key>
<array>
<string>"Motorola CE, Copyright 2000"+"GSM900","GSM1800","GSM1900","MODEL=V188"</string>
<string>"Motorola CE, Copyright 2000"+"GSM900","GSM1800","GSM1900","GSM850","MODEL=V188"</string>
<string>"Motorola CE, Copyright 2000"+"GSM900","GSM1900","GSM850","MODEL=V188ENS"</string>
</array>
</dict>
<key>InheritsFrom</key>
<array>
<string>com.motorola.usb-bt.0x22B8/0x4902</string>
</array>
<key>Services</key>
<array>
<dict>
<key>ServiceName</key>
<string>com.apple.model</string>
<key>ServiceProperties</key>
<dict>
<key>ModelName</key>
<string>V188</string>
<key>PhoneIcon</key>
<string>MOTV188.tiff</string>
</dict>
</dict>
</array>
</dict>
how can i access the file?
thanks, al -
adding lines to a file
2005-10-18 22:24:39 haalandkramer [Reply | View]
Of course, iSync should not be open when you do this, but:
If you opened the MetaClasses.plist with a program like TextWrangler (free from BareBones) all you needed to do was find V180 and replace it with V188 (4x) then save and close the file. After that, rename the file MOTV180.tiff to MOTV188.tiff.
You will need to reactivate syncing on your mac then plug in your phone and launch iSync then add device. -
adding lines to a file
2005-09-11 17:39:50 norburym [Reply | View]
If you have Apple's developer's tools installed, you'll have Property List Editor.app (/Developer/Applications/Utilities/).
Other third party tools include BBEdit (barebones.com), Jedit (jedit.org) and PListEdit Pro (http://homepage.mac.com/bwebster/plisteditpro.html).
Cheers,
Mary
-
Terminal keys
2005-08-31 01:35:32 Scotties [Reply | View]
Can you help please: I am using terminal on Tiger 10.4. Connecting to host using SSH.
I get a message that the Host key has changed.
I have looked for a file called "known_hosts" so I can delete it but it is not there.
Does anybody know where Tiger is hiding the Host Keys now?
Thanks
Annie
-
Tiger Terminal
2005-07-15 09:43:42 manuelderieux [Reply | View]
There's no ScreenSaver.framework in my /System/Library/Frameworks directory. In fact, it's no where to be found.
Is there something I should be installing? -
Tiger Terminal
2005-08-14 09:02:54 quicklazydog [Reply | View]
This might work... instead of copying the command and pasting it directly on the terminal, paste it first on a TextEdit document and remove the spaces in the command. When this is done copy the command (now corrected) and paste it on the Terminal.
Hope this works :)
-
Password screen saver
2005-06-20 21:06:47 jamesreynolds [Reply | View]
I don't know if the background trick is safer with password on in Tiger than it was in Panther. In panther, if you did that trick with the password on, then you get a black screen and you have to force restart it or ssh in (if Remote Login is enabled) and kill the WindowServer (you can't kill the ScreenSaverEngine because it is the Security Agent that is doing the black screen thingy).
I was expecting a Tiger Terminal.app update article as well. Anyway, it was ok otherwise. You did mention korn shell. -
Password screen saver
2005-07-06 22:42:31 Qo'noS [Reply | View]
Workaround for the problem described here:
If you have a second administrator account set up, and you have "Require password to wake this computer from sleep or screen saver" enabled, you can log in to your second account and kill the process from there. To do this:
1) Type Control-Eject. This brings up the Shut Down/Restart/etc. confirmation dialog.
2) Type the letter S. That will activate the Sleep button in the dialog, putting the computer to sleep.
3) Wake the computer back up. When the password dialog appears, click Switch User, log into your other admin account, and kill the process from there.
HTH.
-
Password screen saver
2005-07-06 23:13:51 Qo'noS [Reply | View]
A few clarifications to my post:
1) Control-Eject assumes you are using an Apple keyboard. On the Apple Pro, Eject is the top right key.
2) You're doing this blind, of course, because your screen is black. But it does work... because I got into this very fix using Panther, and this is precisely how I got out of it.
-
Can I control system pref's from terminal?
2005-06-15 07:39:31 mr.nice [Reply | View]
I am looking for a form to post this question, please forgive me if this is too off topic.
I need to turn on Apple Remote Desktop on a mac with no monitor. I can start up and navigate with the keyboard to terminal and then carefully type commands.
I just wonder if it is possible to active ARD this way... anyone?
Thanks -
Can I control system pref's from terminal?
2005-06-15 17:34:23 norburym [Reply | View]
The way to go, I would think, is to create a custom client installer which will prepare the client settings for you. The ARD Admin Guide has detailed steps on how to accomplish this:
http://images.apple.com/remotedesktop/pdf/ARD_Admin_Guide22.pdf
There really isn't any reason you "have" to visit the client at all.
Caveat: I haven't tried this with Tiger so if that's what you're working with, let me know if how it goes. -
Can I control system pref's from terminal?
2005-06-16 06:28:44 mr.nice [Reply | View]
norburyn, As you suggested I can create a custom installer which will create a new user and activate ARD. I have done this. Now the question is how do I run the installer on the G3. I can copy the .mpkg to the desktop of the G3 and can get myself into terminal. What is the exact command to run the package? I spent some time trying to figure it out... so far I have (from memory) sudo installer -pkg </Users/adam/Desktop/Custom.mpkg> (I get stuck here, how do I tell the system the target? What is the target?
-
Cool
2005-06-05 14:23:33 Coolnat2004 [Reply | View]
Great intro, I've read the other ones and these are definitely helping me get into the terminal more and more - I just recently got a mac and I want to do cool stuff fast and look really geeky! :D
Anyway, I made an alias (bgsc) for that screensaver trick so that I can impress my not-so-geeky friends quickly. I'm lovin' it!
-
Nitpick about rm
2005-05-28 13:05:16 bonze [Reply | View]
You state:
To see the consequences of this, take a look in your Trash for the file you just removed. See it? Nope. The command rm deletes and empties the Trash.
Actually, rm deletes the file without ever putting it in the Trash. Anything that was in the Trash before is still there.
Just a nitpick.
-
DVD on Desktop?
2005-05-28 07:55:41 harttj [Reply | View]
By the way Mary, is there a way to run a DVD movie as my desktop?
-
Tiger Terminal
2005-05-28 07:49:01 harttj [Reply | View]
Yes, this has been covered before. However, things are a little different. Nano for example. I think that repetition is the mother of skill.
There are other differences as well. Ones that others, wiser than I, think the UNIX community should adopt.
Let's wait and see what other cool stuff we can find out about Tiger! :-)
-
rethink your title
2005-05-27 19:21:41 bammi [Reply | View]
mary, please rethink the title of your article. it has nothing to do with terminal.app that did not change in tiger . your article is about into to shell or something like that.
-
ScreenSaver Trick
2005-05-25 10:03:10 BenHur [Reply | View]
I didn't get this to work. I get command not found.
-
Rotating Backgrounds, oh my!
2005-05-22 20:36:23 mori57 [Reply | View]
It might be coincidence, but in any event, it's REALLY annoying: ever since I tried your trick in the Terminal of turning on the ScreenSaverEngine -background, my desktop background keeps changing on me! I did Ctrl-C out of the original process, so I'm not certain what the heck is going on, and I have looked at the Desktop/Screen Saver System Prefs pane and turned off rotation of backgrounds, and that doesn't seem to have made a difference.
Help?? -
Rotating Backgrounds, oh my!
2005-05-23 17:23:48 norburym [Reply | View]
The "trick" isn't permanent. Did you try a reboot? I wondered about a typo if you did type the entire command out but I can't see what you "might" have typed that would have caused what you described.
Log in as another user...still happening? Or you could just try dumping the com.apple.desktop.plist (spotlight it).
-
tiger Terminal
2005-05-22 00:41:05 MurrayBoyd [Reply | View]
I want to know why my terminals die as soon as they're opened half the time. -
tiger Terminal
2005-05-24 06:25:03 msporleder [Reply | View]
You might have something weird in your ~/Library/Caches, or if you can get one terminal working, try executing Terminal.app from that working term (or download another terminal program for that step) and see what messages it gives when it dies.
-
terminal.app
2005-05-21 06:35:33 msporleder [Reply | View]
This isn't really about the terminal







Last login: Thu Mar 1 13:26:02 on ttyp1
Welcome to Darwin!
-bash: {rtf1macansicpg10000cocoartf824cocoasubrtf420: command not found
-bash: /Users/Helgi/.bash_login: line 2: syntax error near unexpected token `}'
-bash: /Users/Helgi/.bash_login: line 2: `{\fonttbl\f0\fmodern\fcharset77 Courier;}'
jeff-helgersons-computer-2:~ Helgi$
this is what I get when I open terminal. Can anyone tell me how to fix it? thanks