Learning the Terminal in Jaguar, Part 1
Pages: 1, 2
cp
Before you modify the system crontab, you should make a
backup copy in case you need to revert back to its default state. You'll
use the cp (copy) command to do this, which lets you copy and
rename a file in one step.
Normally to rename and copy a file into the
same directory, you would type cp, followed by the name of
the original file, and then the name of the copy:
[haru: /private/etc] chris% cp crontab crontab.bak
cp: crontab.bak: Permission denied
Hold on. It looks like you don't have permission to write to the
etc directory. In fact, only root can write to
/private/etc. Because you are not logged in as root, it seems
that there's no easy way to write to this directory. But there is.
sudo
The sudo utility ("substitute-user do") allows you to gain
temporary root privileges on a per-command basis. To use
sudo, simply preface the command you wish to run as root with
sudo and a space, and sudo will prompt you for
your password (not root's). If you have administrator privileges, entering
your password will run the sudo'ed command as if the root
user were doing it.
Warning: Use sudo with care. You can easily make
mistakes with sudo that could require a complete
re-installation of the OS to get going again. If that thought makes you
queasy, it would be wise for now to use sudo only as directed
in this article.
To perform the previous command successfully, preface it with
sudo:
[haru:/private/etc] chris% sudo cp crontab crontab.bak
Password:
[haru:/private/etc] chris%
Notes about sudo:
- The first time you run
sudo, you'll see another reminder to usesudowith care. - You'll only
need to enter your password when you haven't already used
sudowithin the last 5 minutes. - It's not
necessary to activate the root account to use
sudo.
Now that you have a backup, you'll want to know how to restore it should you make some kind of unrecoverable mistake when editing. The restore procedure is the reverse of the backup:
[haru:/private/etc] chris% sudo cp crontab.bak crontab
In this case, you're overwriting the non-working crontab
file with a fresh copy of the original you've saved previously as
crontab.bak, which remains unchanged. Notice that, by
default, cp will overwrite a file without warning. If you
would instead like to be prompted to approve such overwrites, include
cp's -i option flag.
Option flags allow you to modify the behavior of commands. The -i option flag for cp tells cp to display a prompt, asking you to allow the overwriting. Do so by typing y for yes or cancel it by typing n for no. To use the flag, simply type the cp command, add a space, type the -i flag, a space, and then the rest of the command:
[haru:/etc] chris% sudo cp -i crontab.bak crontab
overwrite crontab? y
[haru:/etc] chris%
What you need to do next, then, is edit this system
crontab file, and you'll learn how by using a command-line
text editor called pico. However, if you were to first
examine the privileges for /etc/crontab, you would see that
it's owned by root, and only root has write privileges. Sounds like
another job for sudo.
pico
Of the several CLI text editors included with Mac OS X,
pico is the easiest to learn. To open a text file in
pico, simply enter the file name after the pico
command. Used with sudo, the command to edit the
crontab file in the /etc directory looks like
this:
[haru:/private/etc] chris% sudo pico crontab
And this is what you'll see when you run it:

The document's text area lies between the black title bar at the top and the two rows of command prompts at the bottom. The Terminal window's scrollbar won't let you scroll through the document. Instead, you use the down-arrow to move the cursor down line by line, or use the Page commands.
All of the commands listed at the bottom are prefaced with the caret
character ("^"), representing the control key. So for example, to go to
the next "page" (or screenfull) of text, press the control and "V" keys as
indicated. For brief descriptions of all the commands, read the
pico help file by pressing control-G.
The numbers in the circled area specify the time cron runs
the scripts (there are actually three of them), and this is where you'll
make your changes.
Each of the three lines (numbered 1, 2, and 3) specifies one of the
three scripts cron runs by default. Each script is different,
performing its own appropriate set of maintenance procedures. The daily
script, specified on the line labeled 1, runs once each day. The weekly
script, specified on line 2, runs once each week. And the monthly script,
specified on line 3, runs -- you guessed it -- once each month.
The first five columns or fields of each line specify at exactly which interval the script will run. The fields specify, from left to right, the minute, hour (on a 24-hour clock), day of the month, month, and weekday (numerically, with Sunday as 7). Asterisks used instead of numbers in these fields mean "every".
For example, line 1 specifies a time of 3:15 a.m.:
15 3 * * * root periodic daily
Since the rest of the columns contain asterisks, the daily script will run at "3:15 a.m. on every day of the month, on every month, and every day of the week," that is "every day at 3:15 a.m.".
Line 2 specifies that the weekly script runs at 4:30 a.m. on every weekday number 6, or Saturday:
30 4 * * 6 root periodic weekly
And line 3 specifies that the monthly script runs at 5:30 a.m. on day 1 (the first) of each month.
30 5 1 * * root periodic monthly
By just changing these numbers, then, you can have these scripts run at more reasonable times. Of course, what counts as reasonable depends on your own situation, so consider these factors when deciding:
- Choose a time when your Mac is likely to be on (and not asleep).
- Choose a time when a few minutes of background activity won't disturb your work too much. On faster machines the activity is hardly noticeable, but it could cause some stuttering if, for example, you happened to be watching a DVD at the time.
- Choose a time that is unique for each script. You don't want to schedule scripts to run at the same time.
For example, these times might be good for a machine that's only on during normal work hours:
- Daily -- every day at 5:15 p.m.
- Weekly -- every Monday at 8:50 a.m.
- Monthly -- the first of every month at 9:30 a.m.
Regarding the monthly job, the first of the month sometimes falls on a weekend or holiday, but for now that's the best you can do.
To modify the crontab file to reflect these new times,
use the cursor keys (the four arrow keys) to move the cursor to the proper
field. Except for being unable to use the mouse, you'll find that editing
text with pico is similar to doing so with any GUI text
editor. Use the delete key as usual, and type in the new values.
First, change the 3 in the daily script line to 17:
15 17 * * * root periodic daily
Next, change the time in the weekly script line as shown; change the day from 6 to 2 (Saturday to Tuesday).
50 8 * * 2 root periodic weekly
Finally, change the time in the monthly script line as shown:
30 9 1 * * root periodic monthly
Once you've made the changes, save ("write out") the document by pressing control-O. You'll then be prompted to confirm the save. Just press Return to do so.

Finally, quit pico, by pressing control-X.
Once you've saved the crontab file, the new scheduling
takes effect; there's no need to restart. You won't yet receive
notification of the completed cron jobs, but in Part 2,
you'll learn how to make that happen, as well as learn more about the
scripts themselves.
Chris Stone is a Senior Macintosh Systems Administrator for O'Reilly, coauthor of Mac OS X in a Nutshell and contributing author to Mac OS X: The Missing Manual, which provides over 40 pages about the Mac OS X Terminal.
Read more Learning the Mac OS X Terminal columns.
Return to the Mac DevCenter.
You must be logged in to the O'Reilly Network to post a talkback.
Showing messages 1 through 141 of 141.
-
"crontab" does not exist
2008-11-27 20:03:47 Nora O'Neil [Reply | View]
when I type "sudo cp crontab crontab.bak," it says that the file does not exist...I am on OS X v. 10.5.4
-
vanila.r
2008-10-12 15:24:43 NMEfoofoo [Reply | View]
Hello,
I recently downloaded a comment tool called vanilla
http://tech.groups.yahoo.com/group/vanilla-pudding/
on my computer which can be used as a guest book, bulletin board, etc. I was expected to learn basic Terminal commands to finalize this installation and I am now wondering whether somebody can tell me if this software can be uploaded to a personal web page hosted by basic ISP providers like home.att.net and geocities.yahoo.com
-
vanila.r
2008-10-12 15:22:55 NMEfoofoo [Reply | View]
Hello,
I recently downloaded a comment tool called vanilla on my computer which can be used as a guest book, bulletin board, etc. I was expected to learn basic Terminal commands to finalize this installation and I am now wondering whether somebody can tell me if this software can be uploaded to a personal web page hosted by basic ISP providers like home.att.net and geocities.yahoo.com
-
cd/private/etc does not work
2008-05-14 08:09:00 beata2 [Reply | View]
Hello,
I am new to the terminal utility and have gotten stuck at the beginning of your article. here's what I see after typing in cd/ private/etc:
Kathy-Kelers-Computer:~ kathykeler$ pwd
/Users/kathykeler
Kathy-Kelers-Computer:~ kathykeler$ cd/ private/etc
-bash: cd/: No such file or directory
Kathy-Kelers-Computer:~ kathykeler$ -
cd/private/etc does not work
2008-05-14 08:52:38 Chris Stone |
[Reply | View]
First, this article is quite old and only applies to Jaguar. So, if you are using Jaguar, your issue is a simple mistyping:
You want to enter the command (cd), a space, and then the path, thus:
cd /private/etc
and not
cd/ private/etc.
If you aren't using Jaguar, however, then you really should be looking at this series of articles instead:
http://www.macdevcenter.com/pub/a/mac/2005/05/20/terminal1.html?page=1
Hope that helps,
--Chris
-
help
2008-02-27 18:19:51 duß#8706; unverified 349845 [Reply | View]
my dad made it so i cant go on the internet on my computer with terminal do you know how to fix this?
-
tcsh: 1s: Command not found.
2007-04-03 20:15:05 andresoueu [Reply | View]
Went well untill...
[andreshitarab:/private/etc] andre% cd /private/etc
[andreshitarab:/private/etc] andre% 1s
tcsh: 1s: Command not found.
What's happening?
-
downloads
2007-02-22 16:36:14 soookinky [Reply | View]
once you download. how do you open and use apps
-
Cannot edit/find "crontab" to edit
2007-02-22 08:46:42 rupertreid [Reply | View]
I followed the instructions to backup the crontab file. The next step was to edit the file. Unfortunately, pico text editor returned a message to the effect that crontab files had been moved elswhere. I am reluctant to continue because I do not wish to make any mistakes. I would be grateful if you would direct me how I should deal with this problem so that i may continue with the tutorial
Thnks and krgds Rupert
-
Creating invisable files/folders using terminal
2006-07-24 11:59:40 Billymac2 [Reply | View]
how do I do this?
Please advise
Thanks
Billymac2
-
Command Line PHP Version?????
2006-05-28 09:00:53 VectorSalad [Reply | View]
Hi,
When I type "php -v" in the command line, it gives me a response of "PHP 4.4.1 (cli) (built: Mar 5 2006 10:30:50)".... yet, when I do a PHP Info check from my Sites directory, it suggests that I'm using PHP 5.x.x....
How can I find/use the command line to perform functions using my (apparently) installed php 5?
When I type the php -v command in the terminal, which/what php could it possibly be looking at?
Thanks for your time!
-
not executable
2006-04-16 17:05:36 busdriverneal [Reply | View]
i was trying to use fink to install xfree86.. this is what i get:
/Users/fink 8-} fink install xfree86
Password:
/usr/libexec/gcc/darwin/ppc/3.3/cc1plus is not executable!
Information about 2306 packages read in 4 seconds.
Failed: Can't resolve dependency "gcc3.1" for package "xfree86-4.5.0-14" (no matching packages/versions found)
there is nothing in the path after :
/usr/libexec/gcc/darwin
so.. why isnt something there? how do i fix this? is it a file i dont have because i have not done anything with/in darwin? or did fink put the proper file here when it installed?
so far i cant use fink to update anything without getting this error:
/usr/libexec/gcc/darwin/ppc/3.3/cc1plus is not executable!
about 200 times during the install..
-
Great!
2006-03-18 17:39:46 mmsomekid [Reply | View]
Everything worked great for me. I'm so glad I finally got my clean up schedule changed.
-
Thanks!
2006-03-18 17:39:38 mmsomekid [Reply | View]
Everything worked great for me. I'm so glad I finally got my clean up schedule changed.
-
Creating encrypted passwords for htpasswd
2006-02-10 09:34:27 buzcajun [Reply | View]
I've done this before but I forgot the syntax. I want to create the htpasswd file with username : passwords for a web directory.
Thanks
buzcajun
-
immediate problems
2006-02-06 07:44:38 Granger [Reply | View]
Hi
when I type: 'pwd' it returns correct '/Users/cannalope'
but when I type: 'cd /private/ect' it returns: no such file or directory
If you could help me out in any way it would be greatly appreciated
Im trying to open: 'httpd.conf' in the location '/ect/httpd/httpd.conf
and im pulling my hair out
Kind regards
Theobald Granger -
immediate problems
2006-02-06 08:02:31 Chris Stone |
[Reply | View]
Hi Theobald,
You've just typed the pathname in incorrectly. The path begins with "etc" (for "et cetera"), not "ect"...
--Chris
-
Wont let type password
2006-01-13 16:00:26 Skindc [Reply | View]
I am new to this termianl and unix lark and am trying to follow your tutorial yet when trying to run the command
sudo cp crontab crontab.bak
it is asking for password which is obviously the password for account but when promting for password terminal will not let me type anything.
Any ideas? -
Wont let type password
2006-02-06 08:05:27 Chris Stone |
[Reply | View]
Hi Skindc,
If you mean that you see nothing when typing, that is the expected behavior. Sudo does this to prevent over the should snoopers of your password. So even though you see nothing, type in your password and press return and you should be able to continue...
--Chris
-
crontab moved
2005-08-24 14:02:29 WinterLavigne [Reply | View]
Hello,
I'm trying to learn a thing or two about using the terminal.
As I was following the tutorial, after giving the command sudo pico crontab I see this message: "The periodic and atrun jobs have moved to lauchd jobs
See /system/lybrairy/LaunchDaemons"
This probably has something to do with the fact that I working with Tiger and not Jaguar, but if anyone can give me a hand in locating this file????
Thanks
-
crontab moved
2007-08-14 02:23:28 Semiotikus [Reply | View]
Hi
First of all, this is not a message from pico as some of the users suggest. It is a comment in the crontab file.
Since Tiger the system it self does not use cron to launch processes. This is now done by 'launchd'.
You can still use cron to launch you periodic tasks.
In my case i use it to make sure, a by cron launched php-script will work, since i need it to run on a linux webserver and develop on my local mac. -
crontab moved
2005-09-07 01:41:04 andrewf [Reply | View]
I recieved that exact same message. Its obviously because we are using tiger. I tried going to the advised directory (/system/library/launchdaemons) but coudnt find crontab or anything about cron
could someone experienced in tiger terminal please help us? -
crontab moved
2005-10-24 06:28:24 hausmeister [Reply | View]
I had the same problem but after some guessing I found the files. It's not a crontab file anymore but instead they're in plist format (that's described in one of the later tutorials but can also be edited with pico). The files in question are called:
com.apple.periodic-daily.plist
com.apple.periodic-weekly.plist
com.apple.periodic-monthly.plist
The time format is still the same as in the original tutorial. -
crontab moved
2007-02-23 16:31:41 rupertreid [Reply | View]
I tried to find the .plist files but could not. I am using OSX 10.4.8. I would be grateful if someone would detail exactly how I can locate the .plist files and edit them in pico.
Rgds Rupert -
crontab moved
2007-08-28 17:44:40 Jonny81 [Reply | View]
Rupert,
type the following and it should get you there (I'm using OSX 10.4.10 so hopefully it is the same!)
cd /system/library/launchdaemons
This will bring you to the correct directory. If you do an ls you can see the list of files, the three which are important are:
com.apple.periodic-daily.plist
com.apple.periodic-monthly.plist
com.apple.periodic-weekly.plist
Type:
sudo cp com.apple.periodic-daily.plist com.apple.periodic-daily.plist.bak
sudo cp com.apple.periodic-monthly.plist com.apple.periodic-monthly.plist.bak
sudo cp com.apple.periodic-weekly.plist com.apple.periodic-weekly.plist.bak
in order to make backups of the files. If you look at the contents of the daily file through cat:
cat com.apple.periodic-daily.plist
you should get something like this:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>com.apple.periodic-daily</string>
<key>ProgramArguments</key>
<array>
<string>/usr/sbin/periodic</string>
<string>daily</string>
</array>
<key>LowPriorityIO</key>
<true/>
<key>Nice</key>
<integer>1</integer>
<key>StartCalendarInterval</key>
<dict>
<key>Hour</key>
<integer>3</integer>
<key>Minute</key>
<integer>15</integer>
</dict>
</dict>
</plist>
We find out that the files are now in XML (I have no clue why). Anyway, there are two KEY tags, one is Hour and the other is Minute. Under each of these is the associated INTEGER tag (which in this case is 3 for HOUR and 15 for MINUTE). I changed my HOUR integer tag from 3 to 20 (so it would run at 8:15pm). Haven't had any problems.
The other two files should be the same (with perhaps slightly different times).
Hope this helps and sorry if it isnt the same in OSX 10.4.8. Just make sure to backup your files! -
crontab moved
2007-08-28 17:55:55 Jonny81 [Reply | View]
Oh, sorry forgot. To edit the file, of course:
pico com.apple.periodic-daily.plist
or
sudo pico com.apple.periodic-daily.plist
if need be. You'll do the same for the other two files, just replacing the part of the filename 'daily' above with 'weekly' or 'monthly'.
-
Finding A Hidden Folder
2005-06-15 15:34:48 immisumord [Reply | View]
I hid a folder using eyeHide and it when I tried to open it, it said "The folder ".Jim" could not be open because you do not have sufficient acess privileges" and the read me on eyehide said if I was a little familiar with Terminal I could find the folder and I was wondering how I could do that. The folder is called ".Jim".
Thanks.
-Jim -
Finding A Hidden Folder
2007-08-28 18:07:14 Jonny81 [Reply | View]
you could try
sudo cd .Jim
That might work. Or you could use chmod to alter the permissions for the directory.
chmod u=rwx .Jim
The chmod command used in this way will make sure you (u) have read (r), write (w), and execute (x) permission on the directory/file that follows.
These are pretty basic so not sure if either of these will work, but I suppose it is worth a shot.
-
crontab: No such file or directory
2005-02-04 06:21:14 Whitmor [Reply | View]
I'm following your tutorial and I'm stuck. When I type: sudo cp crontab crontab.bak, I get the response
cp: crontab: No such file or directory
Am I doing something wrong?
-
compiling c with terminal
2005-01-24 18:40:52 johnwoodruff [Reply | View]
hello, i'm new to unix and c programming and am trying to execute some simple code from a book on the c language. i'm getting stuck at the point...compile the program using the cc command. i've tried using the cc and gcc command in terminal, but i just get "tcsh: gcc: Command not found." any ideas?
-
How can I cancel a command?
2005-01-06 07:36:22 juf [Reply | View]
Hi. I had never used Terminal before, but I wanted to modifiy an app. which is called mlmac. I tried to follow the instructions given on a forum to do it. It was pretty clear but I did not pay attention, and I think I must have done something wrong... because now, each time I launch Terminal, it opens the application (mlmac) and when I close the window, it closes the app.
Here is what I can see in the main window when I lauch Terminal:
Last login: Thu Jan 6 16:25:15 on ttyp2
Welcome to Darwin!
/Applications/mlMac.app/Contents/MacOS/mlMac; exit
[jufs-iMac:~] julienfr% /Applications/mlMac.app/Contents/MacOS/mlMac; exit
And the window's called: Terminal - mlmac - 80x24
Could someone help me, because I really don't know what to do to cancel the command I created...
Thank you for your help!!
-
Safari
2005-01-04 17:59:23 yizzle123 [Reply | View]
Can I open safari with the terminal? Also can I read whats happening when I go to a website, from the terminal, in code? -
Using terminal to "see" a web request
2005-06-07 14:24:23 xurizaemon [Reply | View]
Ok, you can do this. (Damn, I wish I hadn't run out of ttys so I could test it!)
## opens telnet connection to webserver on port 80 (HTTP)
$ telnet webserver.com 80
## webserver prints connection open message here
HEAD /file.html HTTP/1.1
Host: webserver.com
## webserver prints headers returned from URL
## webserver.com/file.html
## or you can retrieve the file like so
GET /file.html HTTP/1.1
Host: webserver.com
## webserver prints the raw HTML (or other) file
## to your terminal
Using the HTTP Headers extension in Mozilla is easier though ;)
-
Safari
2005-06-07 14:18:59 xurizaemon [Reply | View]
Yes. In Terminal, you can use the "open" command to open files, URLs, or applications.
## launches a specific application
## (maybe can give URL or file as argument?)
$ open /Applications/Safari.app
## goes to www.oreillynet.com
## in your preferred browser
$ open http://oreillynet.com/
## opens /Documents/MyFile.txt in your home dir
## using default text editor
$ open ~/Documents/MyFile.txt
## opens your Pictures folder in Finder
open ~/Pictures
Pretty easy, huh? Basically, the 'open' command simulates what you'd normally do with a double-click or CMD+O.
-
Commands not found in Terminal
2004-12-21 10:13:12 jamiekravitz [Reply | View]
I've been trying to udpate my MOXAMP configuration on my Powerbook using 10.2.8, and was having trouble with Terminal, so came back to these great tutorials to see if redoing them would refresh my memory.
But I think there's something wrong with my Terminal program. It doesn't recognize 'pico' as a command. In my PHP drama it also doesn't recognize 'grep', 'egrep' and some others. When I try to open crontab for the tutorial, i get:
pico: Command not found.
I installed the Developer Tools. Is there anything else I should do??
This used to work for me before, but I had to reinstall the whole system a while back because of a fatal problem.
-
Running a simple C program
2004-12-16 22:39:20 JoshO [Reply | View]
HI Chris,
I have just purchased "Programming In C" by Stephen G. Kochan and am trying to run a simple C program in the Terminal.
I haved compiled it using the gcc command. Now I am having trouble running the final program.
-
Terminal window in micro size
2004-11-18 17:46:14 Sinchee [Reply | View]
Hi - I use PsyncX to run backups which generates the Terminal windows. But lately the Terminal window pop up in micro size (about 8mm x 10 mm in size) and the only clickable part is the red Close button. I can't increase the size of the window.
I didn't have any problem with this until after I started running WindowShade - I'm not sure if these are related issues.
How can I get back normal-sized windows? I have tried deleting the prefs for Terminal and WindowShade, but still stuck with the problem.
Thanks in advance,
Sinchee
-
can't use cp or mv commands!
2004-05-28 13:18:27 macmanjws@earthlink.net [Reply | View]
I am trying to use Terminal in Jaguar 10.2.7 to copy folders onto a server directory, but the cp or mv commands don't exist! What do I do?
-
Logging into CVS through Terminal
2004-03-02 13:41:42 dmc [Reply | View]
Hi. I'm pretty new to terminal. Does anybody know how to go about logging into a CVS system? I have my URL, username and password ready but I don't have a protocol. I've tried "connect to server" blah blah blah to no avail. Can someone please get me started? Thanks so much. -
Logging into CVS through Terminal
2004-05-06 12:21:58 CaptainMikee [Reply | View]
Do you have the CVS command line utility installed? I got it from fink.
Once you have that, you can use the cvs command like so:
cvs -d :pserver:your.project.org:/usr/local/cvsroot checkout yourproject
You can read the rest of the documentation in the CVS Manual.
-
disk utility at the command line
2004-02-17 11:37:15 bobbyb [Reply | View]
What does diskarb couldn't be activated when i try to run diskutil
-
fix Filemaker with script
2004-01-21 11:19:49 rf10 [Reply | View]
Filemaker Pro does a very evil thing - it allows only 10 web users, and keeps them as users for 12 hours! I would like to write a script that will quit Filemaker and then re-open the right file every hour. That way it forgets its supposed list of users. I've got
osascript -e 'tell app "Filemaker" to quit'
open EvalsReport.fp5
and then I need to save this as a text file (or a script file?) and then get cron to run it every hour. Does this sound right?
-
Won't let me telnet
2004-01-10 23:33:51 anonymous2 [Reply | View]
hi Chris.
When I try to use my terminal to log into MUDS, it says it doesn't recognize the "telnet" command. It's odd. How can I fix that problem?
This is what I get:
Last login: Sun Jan 11 02:48:29 on ttyp1
telnet prowlers.com 1313
[foo-Computer:~] foo% telnet prowlers.com 1313
telnet: Command not found.
-
Is there or will ther be an update for 10.3.2?
2004-01-06 17:12:11 macnut [Reply | View]
Or is this even needed?
-
maintenance script vs macjanitor
2003-12-29 19:14:19 anonymous2 [Reply | View]
Hi, I'm a 56-yr old newcomer to much of this technology. I swallowed hard and followed your instructions and was able to edit the script which controls the timing of system maintenance programs. I guess it's working because nothing has crashed. While surfing around the various MAC sites (understanding about 5% of what I read), I came across a program called macjanitor. My question--does this do the same maintenance that your script editing tutorial (Learning the Terminal..) does? If so, is there an advantage to one way over the other? thank you. mike schwinden -
maintenance script vs macjanitor
2004-01-11 07:26:33 anonymous2 [Reply | View]
MacJanitor simply puts a front end on these tasks, allowing you to press a button for 'Daily', 'Weekly' or 'Monthly'. However, under Mac OS 10.2 (Jaguar) you can acheive exactly the same by typing the following into the terminal:
sudo periodic daily
(or - instead of 'daily' - 'weekly', or 'monthly'); or run them all at once by typing:
sudo periodic daily weekly monthly
but the tutorial allows all this to occur automatically. You don't really need MacJanitior.
- Dave Everitt
-
Taming the Terrifying Terminal
2003-12-03 17:58:53 anonymous2 [Reply | View]
Chris--what a skillful teacher you are! You've done what thousands of 5- to 10-year olds couldn't do in 15 years, viz., made a 55-year old elementary school principal hold his breath for 25 minutes while he tampered with the root language of his family's eMac! Thanks for taking the time to provide this starter kit.
Mike
-
Terminal "hijacked"
2003-11-12 15:42:05 anonymous2 [Reply | View]
I have Terminal running a Quark license server on my Jaguar server. I works fine, except that if I try to open another terminal window it tells me the port is in use and exits. So far the only way I can run anything in terminal on the server is to close the license server, which is really not an option. This is the message I am getting:
"The port the server is configured to use is currently in use by another application.
Please re-download the QLALicense.dat file for another port which is free or shut down the other application.
Please press the ENTER key (Command -Q on mac) to exit this process."
At this point any key pressed exits to a frozen terminal. How do I get two terminals open?
Thank you for your tutorials, I am learning alot.
-Rob
mckenzie@cdnet.cod.edu
-
Help-Can I run this in Terminal ?
2003-11-04 09:30:28 anonymous2 [Reply | View]
Hello-
The tutorials are great, I think I am learning but I need some help running this before I get kicked off the network !
Is this executable in terminal ?
I have the file "sectools.sh" on my desktop.
# cd directory containing security tools
# chmod 755 desktop-sectools.sh
# ./desktop-sectools.sh --install -class <your-email-address>
Thanks in advance, RK
-
how do i type in a command, comp keeps repeating my user name and saying command not found
2003-10-27 08:32:02 anonymous2 [Reply | View]
I am having a prob with my dvd player. ON the apple site they suggest a fix:
You can fix this by renaming the old framework.
In Terminal, type the following two lines (pressing the return key after each line):
cd /System/Library/PrivateFrameworks
sudo mv HIServices.framework HIServices.framework.old
Be aware that this will ask you for your administrative password.
So I open the program and try to type the two lines, but after the first I hit return and it just repeats my computer name and then says "command not found" How do I enter text so that it accepts it. Sorry for the stupid question.,
Thanks
David
-
Crontab running time??
2003-10-24 13:44:22 anonymous2 [Reply | View]
Dear Chris Stone
How long is the crontab running. I have set mine to 8.15-8.30-8.45. Is 15 minutes lang enough between the daily and the week and the montly scedule.
Jan Bjerremann
-
after changing my cleanup schedule
2003-10-09 16:47:00 anonymous2 [Reply | View]
after changing my cleanup schedule I'm trying to setup sendmail and when I type cat /etc/mal/sendmail.cf itdisplays the content but when I attempted to
sudo cp -p sendmail.cf sendmail.cf.bak
it says theres no such file or directory......
why?? -
after changing my cleanup schedule
2003-10-15 01:57:57 anonymous2 [Reply | View]
You're probably still in your home directory and NOT in the /etc/mail/ directory (where the sendmail.cf file lives).
You have two options, either:
1) Enter "cd /etc/mail" and then try again "sudo cp -p sendmail.cf sendmail.cf.bak".
2) Use the full path name in your command: "sudo cp -p /etc/mail/sendmail.cf /etc/mail/sendmail.cf.bak"
Michael.
-
best terminal tutorial
2003-10-09 11:30:08 anonymous2 [Reply | View]
I must thank Chris for such a simple and practical tutorial about the terminal. this is a first time I used terminal and pico and changed my tuneup timing. many tutorials miss such an important details like "you need to type space and then type command..." they assume that you konw?! then I dont need a tut. if I did know.
thnaks again!
-
The mechanics of tcsh & csh
2003-09-20 09:27:06 anonymous2 [Reply | View]
If I wanted to learn more about shell scripting and config files (like history setup, aliases, Path variables, etc), what can I read, book to buy, web site to visit?
TIA,
Dion
-
Terminal Not Working
2003-09-13 11:16:51 tfanning [Reply | View]
When I open the terminal window, it's blank and the status bar says, "Completed Command."
I can't type anything in it. I tried putting my com.apple.Terminal.plist in the trash and re-opening but I got the same thing? Help.
-
De-Fanged Terminal
2003-09-12 00:08:05 empass [Reply | View]
Chris,
I was modifying these hidden files through OS9, File Buddy, BBE Edit and replacing them.
I was REALLY scared of "The Terminal". How's that for avoidance?!
Thanks for making it so easy! Now I'm off to hack everything using "sudo" with reckless abandon.
(just kidding, I'm not that daring!)
Thanks again!
-
nowhere man
2003-08-21 21:17:40 anonymous2 [Reply | View]
My man command doen't seem to exist. If I type, for example, 'man ls' I get command not found or something like that. What gives? Other simple commands like 'ls' do work.
-
message warning
2003-08-12 07:59:08 anonymous2 [Reply | View]
what's mean ?: warning : field "tress" occurs more than one in "/sw/etc/fink.conf".
newer in terminal ,mac os 10.2.6
-
cron
2003-07-10 02:46:00 anonymous2 [Reply | View]
hello :
I have a problem with the cron that I must misunderstand I would like to know why my change on the crontab is not working : /2 * * * * echo "hello";
I don't see anything happening when I save that in the crontab private
-
Great stuff
2003-05-19 02:05:52 anonymous2 [Reply | View]
I'm glad that this information is available. I hope to learn enough to enable SSI on my Mac. It's been easy to follow and makes me feel more confident about the Terminal.
-
Screenshots in JPEG
2003-05-15 13:23:18 anonymous2 [Reply | View]
Screenshots are currently saved as a PDF file. (OSX 10.2.6) I need them to be saved in JPEG. I tried entering the terminal command (defaults write NSGlobalDomain AppleScreenShotFormat JPEG) from David Pogue's book "Mac OSX The Missing Manual" but it dosen't work. Any suggestions?
-
deleting large numbers of files
2003-05-02 16:32:48 anonymous2 [Reply | View]
I somehow managed to DL 266,561 files that are all zero K in size and end in .mov. This was the result using a bulk downloading program.
I am wondering if I can delete a range of files using rm.
ex: rm 0.mov-99999.mov
or something?
Finder freezes if I try and open the folder containing the 266,000 files, so I can not drag them to the trash.
Thanks -
deleting large numbers of files
2003-06-03 15:48:58 anonymous2 [Reply | View]
I have had success with "rm -rf" for many "untrashable" files.Open terminal
sudo rm -rf
Leave the cursor one space from end of -rf .Then drag the folder containing the files onto the terminal window and it will automatically enter path. The cool thing is the -rf modifier will recursively delete all the files and folders!
-
HELP with pico
2003-04-16 22:29:56 cpbjr [Reply | View]
I have follwed to the letter the instructions in the article, but when I try to open the "crontab" file, as instructed, I get the following message:
dyld: pico Undefined symbols:
pico undefined reference to _AL expected to be defined in /usr/lib/libSystem.B.dylib
pico undefined reference to _CE expected to be defined in /usr/lib/libSystem.B.dylib
pico undefined reference to _CL expected to be defined in /usr/lib/libSystem.B.dylib
pico undefined reference to _CM expected to be defined in /usr/lib/libSystem.B.dylib
pico undefined reference to _CS expected to be defined in /usr/lib/libSystem.B.dylib
pico undefined reference to _DC expected to be defined in /usr/lib/libSystem.B.dylib
pico undefined reference to _DL expected to be defined in /usr/lib/libSystem.B.dylib
pico undefined reference to _DM expected to be defined in /usr/lib/libSystem.B.dylib
pico undefined reference to _ED expected to be defined in /usr/lib/libSystem.B.dylib
pico undefined reference to _EI expected to be defined in /usr/lib/libSystem.B.dylib
pico undefined reference to _IC expected to be defined in /usr/lib/libSystem.B.dylib
pico undefined reference to _IM exTrace/BPT trap
Any help at all would be GREATLY appreciated.
Thanks in advance -
HELP with pico
2005-03-18 14:47:41 suhuba [Reply | View]
I am having difficulty with terminal.
when I enter "sudo pico /etc/httpd/httpd.conf" I am prompted for a password. When I enter my password, I receive the following info. I have installed Developer Tools an do not know what else to do. Please help.
dyld: pico Undefined symbols:
pico undefined reference to _AL expected to be defined in /usr/lib/libSystem.B.dylib
pico undefined reference to _CE expected to be defined in /usr/lib/libSystem.B.dylib
pico undefined reference to _CL expected to be defined in /usr/lib/libSystem.B.dylib
pico undefined reference to _CM expected to be defined in /usr/lib/libSystem.B.dylib
pico undefined reference to _CS expected to be defined in /usr/lib/libSystem.B.dylib
pico undefined reference to _DC expected to be defined in /usr/lib/libSystem.B.dylib
pico undefined reference to _DL expected to be defined in /usr/lib/libSystem.B.dylib
pico undefined reference to _DM expected to be defined in /usr/lib/libSystem.B.dylib
pico undefined reference to _ED expected to be defined in /usr/lib/libSystem.B.dylib
pico undefined reference to _EI expected to be defined in /usr/lib/libSystem.B.dylib
pico undefined reference to _IC expected to be defined in /usr/lib/libSystem.B.dylib
pico undefined reference to _IM exTrace/BPT trap
[Michael-Liverpools-Computer:~] admin% sudo pico /etc/httpd/httpd.conf
dyld: pico Undefined symbols:
pico undefined reference to _AL expected to be defined in /usr/lib/libSystem.B.dylib
pico undefined reference to _CE expected to be defined in /usr/lib/libSystem.B.dylib
pico undefined reference to _CL expected to be defined in /usr/lib/libSystem.B.dylib
pico undefined reference to _CM expected to be defined in /usr/lib/libSystem.B.dylib
pico undefined reference to _CS expected to be defined in /usr/lib/libSystem.B.dylib
pico undefined reference to _DC expected to be defined in /usr/lib/libSystem.B.dylib
pico undefined reference to _DL expected to be defined in /usr/lib/libSystem.B.dylib
pico undefined reference to _DM expected to be defined in /usr/lib/libSystem.B.dylib
pico undefined reference to _ED expected to be defined in /usr/lib/libSystem.B.dylib
pico undefined reference to _EI expected to be defined in /usr/lib/libSystem.B.dylib
pico undefined reference to _IC expected to be defined in /usr/lib/libSystem.B.dylib
pico undefined reference to _IM exTrace/BPT trap -
I had the same result.
2003-04-23 20:31:12 anonymous2 [Reply | View]
My terminal message looks just like yours. I have no idea why. I was hoping someone would answer to help us. -
I had the same result.
2003-04-24 08:50:13 Chris Stone |
[Reply | View]
If that's the case, you probably need to install the Developer Tools. If you didn't receive a Developer Tools CD with your Mac or Mac OS X box, you can download an image for free (after registering for a free ADC membership) from: http://connect.apple.com
Hope that helps...
--Chris -
I had the same result.
2003-10-15 01:47:41 anonymous2 [Reply | View]
For newer macs that came with OS X pre-installed, the developer tools package is already on the hard drive. It can be installed from:
/Applications/Installers/Developer\ Tools/Developer.mpkg
Michael. -
You must be psychic!
2003-04-24 11:27:29 anonymous2 [Reply | View]
I was sitting here troubleshooting this and voila - you replied. Thanks. I found another response you gave someone and it solved this problem. I installed the BSD subsystem pkg off the CD. This got pico up and running for me. Thanks again.
It seems to be running well. Love your tutorials and will get the book too now just from seeing how easy you explain things.
-
1s does not work??
2003-03-28 01:37:54 ijasont [Reply | View]
it looks strange on this page but it is actually LS (ls) not ONE S.
This should fix your problem.
Jason
-
1s does not work??
2003-03-28 00:03:08 anonymous2 [Reply | View]
I went through this tutorial for Jaguar yesterday, then I had to do a system dump and reinstall OS X (for otehr reasons)
I am now going through it again as a brush up and pwd is fine
cd /private/etc works
the 1s does not. 1s: Command not found
What is this?
Also I can no longer use
bbedit /etc/httpd/httpd.conf
I get bbedit: Command not found
Any help would be great.
-
Kudos
2003-03-21 18:20:48 anonymous2 [Reply | View]
Thank you for such simplicity and clarity
silvio tavernise
siltav@map.com
-
Learning Jag Terminal
2003-03-16 10:15:54 buz [Reply | View]
cd private/etc: returns 'No such file or directory'.
this is my first venture into the terminal. -
Learning Jag Terminal
2003-08-20 18:09:27 anonymous2 [Reply | View]
The command must be cd /private/etc unless you are already in the root dirctory. Without the "/" the command looks for a file namde etc in a folder named private in whateve directory you are currently in
-
cannot open file for writing
2003-03-01 08:57:49 anonymous2 [Reply | View]
Hi,
I'm trying to edit the httpd.conf file to allow .asp files for SSI
(i will be hosting my site on an NT server, but want to work on it on my mac at home)
using the Terminal i open the 'etc/httpd/httpd.conf' with pico & edit the relevant lines to:
AddType text/html .asp
AddHandler server-parsed .asp
But when I try to 'write out' or 'exit' i get the msg " [ Cannot open file for writing ]"
what am i doing wrong?
-
JDBC Data Sources
2003-02-09 22:47:45 anonymous2 [Reply | View]
Hello: could you give an script for part
5) of Start the compass (tutorial) database
(Linux/Unix)Run the compassdb shell script
Please what is this scripts and is it only
for PC?, Can it be run in Mac OS 10.2
I cannot seem to find the solution.
2nd What's the jar tar cannot be deploy it
miss a Main Manifesto when starting ColdFusion
If you could clarifie some of this point or
point to some sources it will be greatlly
appreciated Rene. Thanks a million.
-
mail gives no error, yet recipient never gets
2003-02-06 15:44:50 anonymous2 [Reply | View]
The mail program "fools" me into thinking its
working: I go through the following intereraction:
%mail johnsmith@anywhere.com
Subject: your fly is unzipped
Don't look now, but...
.
%
but the recipeint gets nothing at all.
Further newsgroups fail to work, something like
"nntp not available"
pops up
Finally, whe I try to run Pine for Jaguar, I see
you can't run Pine: you have a "dumb" terminal.
Is there anything I CAN do with terminal????
seems NOT!
-
Terminal to access remote server
2003-02-05 20:05:47 anonymous2 [Reply | View]
Can terminal be used to access a remote server like a telnet client?
How is login accomplished?
I am not seeing examples of this, only how to used terminal to work with the local disk.
-
Terminal to access remote server
2003-02-05 20:05:07 anonymous2 [Reply | View]
Can terminal be used to access a remote server like a telnet client?
How is login accomplished?
I am not seeing examples of this, only how to used terminal to work with the local disk.
-
Terminal not working
2003-01-31 09:53:36 Chris Stone |
[Reply | View]
You know, I saw this once before, I think. And I wonder if the same thing has happened to you: A really badly designed software installer modified the ~/Library/Preferences/com.apple.Terminal.plist file so that it would run the command file "6871078.command" to finish off some part of the installation. But then for some reason it doesn't revert the plist file back.
The easiest fix would be to just remove com.apple.Terminal.plist from Preferences and let Terminal create a new when it starts next.
You could also edit the plist file (it's just an XML text file) and remove the offending startup command line from it.
Hope that helps...
--Chris
-
I can not find periodic
2003-01-29 00:04:10 anonymous2 [Reply | View]
Sorry to ask this question but I can not find periodic command. No in /etc/. No in any folder.
Where can I find this command and how to install this?
Thanks. -
I can not find periodic
2003-01-31 09:44:49 Chris Stone |
[Reply | View]
You needn't worry about where peridoic exists since just typing it as a command will run it, and it comes installed with OS X.
But if you run the "which periodic" command you would find that it lives in /usr/sbin/periodic .
--Chris
-
sudo: pico: command not found
2003-01-28 11:32:51 alphaville [Reply | View]
Greetings,
Following along with your excellent articles here, but have hit a roadblock.
sudo: pico: command not found
A 'search' (in aqua) for 'pico' reveals nothing, but I wouldn't really expect it to.
Any hints, tips, experience, advice will be much appreciated.
TIA, mm
-
sudo: pico: command not found
2003-01-28 11:47:29 Chris Stone |
[Reply | View]
Any luck if you try this?
/usr/bin/pico
If not, did you by chance deselect the "BSD Subsystem" item of the custom install screen when installing OS X?
If so, just insert your Jaguar CD -- no need to boot
off of it. Find the Welcome to Mac OS X/Optional Installs/BSD Subsystem file and double-click it. That should install what you need...
Hope that helps,
--Chris
-
sudo: pico: command not found
2003-01-28 12:24:33 alphaville [Reply | View]
Chris,
Mondo Thanks & kudo's on positively the fastest turn around reply I've ever experienced.
for reference...
/usr/bin/pico ..no progress
Installing BSD pkg (& thanks for your incredibly concise direction), has put it, & me back on the rails.
Thanks again
best,
mm
-
Pilot error & Pico help.
2003-01-27 10:40:41 anonymous2 [Reply | View]
To: MR.CHRIS O'REILLY,
Without incident, I reached the "pico stage" of Jaguar, Part 1, without incident when I made a mistake I am not sure how to cure.
I opted for attempting to create my own schedule and in doing so a mistake was made. Can I somehow reset to the default configuration and start over?
Current system: G4,running as fine usual, it is my unfamiliarity with the command line that has me concerned. Although obviously a command line novice, this is not my first BBQ. (yes, I will buy book) so if you respond it should be fairly painless.
Thank you for your time,
M.S.
M.S
-
Pilot error & Pico help.
2003-01-28 11:43:27 Chris Stone |
[Reply | View]
If you followed each step of the tutorial, including the one which backed up your crontab file, you can restore it with:
sudo cp /etc/crontab.bak /etc/crontab
Otherwise, you might try repairing yours by looking at the screenshot in the article, or pasting this in:
# /etc/crontab
SHELL=/bin/sh
PATH=/etc:/bin:/sbin:/usr/bin:/usr/sbin
HOME=/var/log
#
#minute hour mday month wday who command
#
#*/5 * * * * root /usr/libexec/atrun
#
# Run daily/weekly/monthly jobs.
15 3 * * * root periodic daily
30 4 * * 6 root periodic weekly
30 5 1 * * root periodic monthly
Hope that helps...
--Chris
-
what is sudo?
2003-01-24 14:51:35 anonymous2 [Reply | View]
i always see this when i look at tutorials in apache and tomcat...
im a newbie trying to install apache and tomcat in my jag
-
terminal usage for apache?
2003-01-23 14:04:04 anonymous2 [Reply | View]
Hello Chris,
I just sent you an e-mail regarding a hard reference guide for clueless beginners. Also, I "think" I downloaded the latest code for "php" for OS10.2 in an attempt to set up my computer as a server. I don't know what the hell I was doing. So, I need some help before I screw something up. My adventurousness could cost me -
terminal usage for apache?
2003-01-23 14:25:58 Chris Stone |
[Reply | View]
Well, before you continue, I would recommend working through this excellent apache tutorial, which begins here:
http://www.macdevcenter.com/pub/a/mac/2001/12/07/apache.html
--Chris
-
shutdown and restart
2003-01-19 07:54:37 anonymous2 [Reply | View]
hi chris!
is it possible to create a (crontab?)-script that brings back the "scheduled shutdown, restart"-function from OS 9 to MacOS X Server (10.2) ?!
please don´t link me to such alternatives like "EnergyX" or "Kudown" which can be downloaded on the versiontracker homepage.
thanx!
-
shutdown and restart
2003-12-11 08:31:39 anonymous2 [Reply | View]
for scheduled shutdown yes (I have only done this using 10.2.8, not the server version but I'm assuming it is the same). edit the crontab file with this as an entry:
30<tab>17<tab>*<tab>*<tab>*<tab>root<tab>/sbin/shutdown -h now
(that should all be on one line, and you can change 30 and 17 to whatever time you want, in 24hour time) hope this helps!
-this is not chris
-
installed Fink, now terminal starts in 'dselect'
2003-01-14 11:44:51 anonymous2 [Reply | View]
I know nothing about Unix (obviously). How do I modify terminal so that it doesn't start in 'dselect' every time.
thanks,
-
tcsh or bash
2002-12-24 00:19:55 anonymous2 [Reply | View]
As far as I know, it's a matter of speed (tcsh is known to be faster) — important mostly if processes are resources demanding. The scripting lingo is also slightly different. Some other features seem to be more sophisticated under tcsh (word completion, etc.)
-
Korn shell
2002-12-24 00:13:47 anonymous2 [Reply | View]
You can download the Korn Shell via Fink (adapted for Mac OS X — download the package from Sourceforge http://fink.sourceforge.net/) and follow the get-apt procedure to install it on your machine.
-
Korn shell under OS X?
2002-12-23 07:46:36 anonymous2 [Reply | View]
I have a number of ksh scripts running on a UNIX system at my office that I would like to use on my OS X system. Does one of the shells supplied with OS X include Korn Shell-specific syntax and commands? Is the Korn shell available for use with OS X?
Thanks
-
crontab under /etc and /private/etc
2002-12-22 15:21:38 anonymous2 [Reply | View]
Chris,
There must be a bit more to the story than a ln from /etc/crontab to
/private/etc/crontab. I say this because there was a crontab.bak when I got to that part of the tutorial so: sudo cp crontab crontab.bak2
Just now, while in /etc I did the following:
$ ls -l cron*
-r--r--r-- 1 root wheel 296 Jul 14 13:57 crontab
-r--r--r-- 1 root wheel 296 Oct 14 19:50 crontab.bak
-r--r--r-- 1 root wheel 296 Dec 22 15:32 crontab.bk2
$
How did crontab.bk2 show up in /etc?
Kind Regards, Joe Walters, yardbird@fastq.com
-
Missing features of 10.2 ???
2002-12-22 08:51:17 anonymous2 [Reply | View]
I don't know what has happened, but really handy short cuts, like using the tab-completion seem to be missing from 10.2. I used to be able to double tab to see the contents of a folder while using cd. All that happens now is an annoying system alert!
-
Help Personalizing the CLI?
2002-12-21 16:36:20 anonymous2 [Reply | View]
Chris, can you give some assistance on personalizing the CLI? For instance, I would really like to shorten my prompt. Also can you discuss adding paths? I use bash, but would like to know for the default tcsh.
-
tcsh or bash?
2002-12-21 11:13:26 anonymous2 [Reply | View]
Chris:
Thanks for your helpful article.
I am a novice user of unix, and have been using linux lately at work. There, I have been using the bash shell, like most linux users. I knwo the differences between the two shelIs are not huge, but as a novice, even small differences really slow me down. I am wondering if it is adviasable to install bash on my mac as well, or are there osx specific tweaks to tcsh on osx that I will miss the advantage of, or is there functionality accessible only through tcsh.
Any insight would be helpful.
Thanks,
-
Apple Laptop Keyboards Unsuitable for Unix Users
2002-12-18 09:41:18 anonymous2 [Reply | View]
Apple laptops are effectively unusable for unix users.
I am a long-time Unix user. That means I need to have the Ctrl key to the left of the A key. This is a genuine need, not merely a want; it is based upon ergonomics. The Ctrl key is heavily used in unix, and it must be easily accessable. It cannot be off in the lower left corner of the keyboard where it is difficult to get at, and where it distorts the position of your left hand such that you can't easily type other keys while holding the Ctrl key down.
Apple desktop keyboards are now all USB. They are all OK. The CapsLock key can be re-mapped into a Ctrl key.
Unfortunately, even in this modern age, all Apple laptops have built-in ADB keyboards. The ADB keyboard is broken-by-design. It is, in general, not possible to remap the CapsLock key into a Ctrl key.
There are some exceptions, but they are horrible kludges. They are horrible kludges because the original design of the ADB keyboard was a horrible kludge. The correct solution would be for Apple to re-design their laptop motherboards to use built-in USB keyboards. This hasn't happened yet. If you run Linux, use Debian's solution. For Mac OS X users, uControl works. There are no solutions (that I know of) for either NetBSD or OpenBSD. Please note once again that the "solutions" above are in fact kludges, because of the original bad design of the ADB keyboard.
Apple provides a technical note on how to remap the keyboard, but provides no solution to the hardware problems caused by the design of the ADB keyboard. This tech note helps foreign language users, but does nothing for the CapsLock/Ctrl problem.
Apple is (currently) ignoring Unix users! This is not merely speculation on my part. In an on-going email exchange I am having with an Apple employee (whom I won't name) in their marketing department, the Apple marketing person directly stated to me that Apple was catering to their historic Mac customers, and is purposely ignoring the Unix market. He also claimed that Apple would soon start paying more attention to the Unix market. I won't hold my breath. Apple has been ignoring Unix users for more than 12 years. I expect that trend to continue. (Also note that my Apple contact indicated that Macs would never ship with a 3-button mouse, even though Apple intended to port almost all X-window software and deliver it either on a CD/DVD or installed directly on each Mac's hard drive. How Unix friendly is a 1-button mouse with X programs that often require 3 buttons?)
Apple has now lost two opportunities to sell me hardware. I really wanted an Apple laptop for their superior battery life, and for the PowerPC with Altivec CPU. (The Altivec is vastly superior to the x86 line for DSP.) Because I can't live with the broken-by-design built-in ADB keyboard in all Apple laptops, Sony and IBM sold me laptops instead. If Apple fixes this problem, they will sell me a PowerBook next year; if they don't, I'll still be running OpenBSD on x86 hardware, and wishing I could use a Mac.
-
Using Terminal in Jag to help update router firmware
2002-12-16 12:25:50 anonymous2 [Reply | View]
The manufacturer of my DSL/Cable router wants to update the router's firmware remotely and wants me to do the following: "first use terminal program on your MAC , telnet into your router, enable the WEB management function in your router. Then we remotely update the firmware for your router." I have not used the terminal program in my Jaguar operating system, so I really don't know how to accomplish what they are asking me to do. Can someone please help. -
Using Terminal in Jag to help update router firmware
2002-12-21 05:48:08 maniabug [Reply | View]
You need to make sure first that your Mac and the router are on the same IP network, since telnet is a TCP/IP protocol (for what it's worth, telnet typically operates on TCP port 23). Your router's documentation should say what its default IP address is. If you set up for DHCP and get an address other than 169.254.x.x you should be ok.
The command in terminal is simply "telnet". Your command line should look something like:
[athena:~] jason% telnet 192.168.1.1
then press return to send the command to the shell, which will invoke the telnet command and pass the single argument (the IP address) to it. telnet is engineered to interperet that argument to be the host you want to connect to, so it tries a connection. if the connection is successful, and the host at that IP address is listening for telnet connections, you'll be prompted to authenticate.
Once you authenticate, you'll be presented with the router's text-based user interface. it may be rudimentary menus that let you explore the options using arrows, enter, and escape. Or it may be just another prompt expecting you to know commands to use. In the latter case, it's probably best to hit the manufacturer's web site for a PDF explaining how to use the router's command line interface; they vary and there's no one consistent syntax. If you're lost, try typing help or ? at the prompt. The basic structure of commands will probably be the same: you enter the name of a command and the router responds appopriately; commands may require arguments to give the router something to work with.
Once you're done, use the router's exit command (or equivalent) to end the session gracefully. This will normally also end your telnet session too and give you your Mac OS X terminal prompt. Noting how your prompt changes as you use interactive programs like telnet will help you keep track of where you are as you use the terminal.
If you don't get a response when trying to connect, or need to get out of telnet because it keeps prompting for a password you don't know, you can make telnet give up the connection attempt by typing ctrl-]. Hold down the control key and press ]. The prompt then shows that you're still in the telnet program. To get back to your shell, type quit. If you're curious what other commands you can type at that telnet prompt, type help instead:
telnet> help
Commands may be abbreviated. Commands are:
close close current connection
logout forcibly logout remote user and close the connection
display display operating parameters
mode try to enter line or character mode ('mode ?' for more)
(etc...)
Hope this helps. -- Jason
-
crontab under /etc and /private/etc
2002-12-16 12:24:55 anonymous2 [Reply | View]
hi Chris,
first, i want to let you know how great those articles are! thank you very much for them.
i was just wondering, why there are several places, where crontab can be edited in Mac OS X 10.2.x. if the super-user-crontab is in /private/etc, what is it then in /etc ??? i mean, which one do i have to edit and which one not? and if i edited both with identical settings, would this mess my system up?
according to the older series (10.1), it had to be modified in /etc... i am just a bit confused now.
thanks in advance!
-
crontab under /etc and /private/etc
2002-12-20 10:36:21 Chris Stone |
[Reply | View]
Ah...good question! :-)
Actually, /etc is just a symbolic link (like a Finder alias) that points to /private/etc. Therefore /etc/crontab and /private/etc/crontab is one and the same file.
So, you can specify either path without problem...
--Chris
-
print from pine using mac os X terminal
2002-12-14 16:04:15 fishclamor [Reply | View]
hi chris,
i use mac 10.2.2, terminal, and pine mail. when i try to print a message, it doesn't work!
but if i use better telnet fat in os 9, printing from pine works just fine.
it doesn't matter if i'm using pine locally on my own computer or if i'm connected to my unix account at school- with terminal in jaguar, printing from pine doesn't work.
do you have any ideas? this is hugely important to me since i write about 10 pages i need to print everyday and forwarding to another account, then copy/paste/print with microsoft word is just way too hard and makes me want to quit writing and start doing math all over again.
thanks very much if you can help!
sincerely,
f. clamor -
print from pine using mac os X terminal
2003-10-02 09:52:15 anonymous2 [Reply | View]
I, too, need to print from Pine when using Terminal in 10.2.6.
Has anyone found a solution? I've tried using Pine's "Setup" to no avail.
This would help not only me, but the rest of the teachers in my district who use OS X and haven't switched over to the evil empire yet.
Thanks!
Bruce
zeus42371@yahoo.com
-
password??
2002-12-14 07:22:25 anonymous2 [Reply | View]
I have log in as admin, but when I come to the password part, I can go any further.
this is what I type:
Password:
[JansComputer:/private/etc] jan% sudo cp -i crontab.bak crontab
We trust you have received the usual lecture from the local System
Administrator. It usually boils down to these two things:
#1) Respect the privacy of others.
#2) Think before you type.
Password:
Sorry, try again.
Password:
Sorry, try again.
Password:
sudo: 2 incorrect password attempts
I can't type anything after password:
so what am I doing wrong???
Jan
-
Answer From Chris_Stone
2003-01-18 16:41:16 pixm [Reply | View]
When typing a password for sudo, nothing will appear at the prompt for security reasons, but your keystrokes will still be seen by sudo once you press the final return. -
password??
2003-01-17 13:00:22 pixm [Reply | View]
same for me until I realised that you just need to type the password on your keyboard and hit the return key... you don't and can't see the characters on the screen!
Cheers
-
Are you using root's password ?
2002-12-14 17:57:56 mike_dowe [Reply | View]
I don't know if you enabled the root account but with sudo you should use your administrator (login) password.
Don't use root's password.
Otherwise check the case of your password. Does it contain any unusual characters ?
Good luck.
-
part 2?
2002-12-11 18:19:50 anonymous2 [Reply | View]
will part 2 be here? -
part 2?
2002-12-12 10:39:21 Chris Stone |
[Reply | View]
I'm working on Part 2 now, and it should be up within the next couple of weeks, and part 3 shortly thereafter.
--Chris
-
What about "crontab -e"?
2002-12-10 12:01:42 anonymous2 [Reply | View]
I have always used "crontab -e" to edit my crontab. Shouldn't this be used instead of directly editing the files (and manually maintaining backups)? -
What about "crontab -e"?
2002-12-10 16:44:52 Chris Stone |
[Reply | View]
You are correct in using crontab -e to edit *your* user crontab (those in /var/cron/tabs). However, the crontab command is not for the *system* crontab, (/etc/crontab), which is edited directly.
--Chris -
What about "crontab -e"?
2002-12-14 23:46:21 dillera [Reply | View]
HI:
try:
$ sudo crontab -e
this will edit the system crontab in one step.
-andy -
What about "crontab -e"?
2002-12-20 10:32:21 Chris Stone |
[Reply | View]
Actually, that is not correct.
sudo crontab -e will edit the *root* crontab -- the user crontab for the user *root*, which is /private/var/cron/tabs/root.
This is a different file than the *system* crontab, which is /etc/crontab. It is this system crontab which holds the schedule for the regular maintenance jobs, not the root crontab.
-
log files just getting longer and bigger in 10.2.
2002-12-07 13:55:58 anonymous2 [Reply | View]
I noticed that the log files such as daily.out, weekly.out, and monthly.out are just getting bigger. Instead overwriting the old put as in 10.1, the outputs are added to the end of the log files, making them longer every day.
Anything I can do to change that ?
Thanks
Bryan -
log files just getting longer and bigger in 10.2.
2002-12-09 07:52:46 charlesa1 [Reply | View]
Under 10.1, daily.out was created using...
# /etc/daily 2>&1 | tee /var/log/daily.out | mail -s "`hostname` daily output" root
... with daily.out being overwritten each day.
With Jaguar, this has changed to:
# periodic daily
Periodic's config file is located in /etc/defaults/periodic.conf - it executes the scripts in /etc/periodic/daily in order and appends to the file specified in the periodic.conf file. You can override the default behavior with /etc/periodic.conf, but I'm not sure how you'd go about configuring periodic.conf to overwrite the output log each day.
-
What about startup items?
2002-12-07 05:10:38 astromac [Reply | View]
Does crontab have the capability to schedule things to launch upon startup? For instance, if I were on a Linux machine how would I arrange it so that apache was launched upon startup?
Great article. I'm a long time Mac guy that's really appreciating the Unix underneath. -
What about startup items?
2002-12-09 07:32:39 charlesa1 [Reply | View]
You should be able to use @reboot in place of the first five fields - just like most BSD systems. Well, at least you can in 10.1 - I haven't verified it in 10.2. (For some reason, the crontab(5) manpage doesn't appear to be on my Jaguar system, so I can't be sure.)
Of course, the OS X-ish way is to create detailed scripts in /Library/StartupItems that will be scheduled and run in the proper order by /sbin/SystemStarter, according to which services they require and provide. Generally, these are turned on and off by setting flags in /etc/hostconfig. See /System/Library/StartupItems for Apple-supplied scripts.
-
Request intermediate-level info
2002-12-06 19:53:14 myacavone [Reply | View]
I think it's great this series will be updated for 10.2. I also think using a specific project like cron is very helpful as a launching point.
However, what I'm really interested in is a more intermediate set of articles. For instance, last weekend I spent hours building LAME 3.93 from source. There was a lot to learn, including how the heck to update the shell path so that I could actually use the app. That was a real PITA, and frankly I probably hit it with a too-big hammer and could have done something more elegant had I known what I was doing.
It seems like there's so much to learn about the Terminal, and much of it is specific to OS X - every shell is different, commands have different syntax, etc. I'd like to see a 25-part series on the Terminal. -
Request intermediate-level info
2002-12-09 12:58:40 rainwadj [Reply | View]
Actually, most of the things you would do at a shell prompt are not all that specific to OS X. Some of the files are in different places, but that is (mostly) predictable - /Library instead of /usr/local/lib, for example.
A couple of decent books:
- Learning Unix for Mac OS X
- Mac OS X for Unix Geeks
-
and a book
2002-12-08 12:15:05 Daniel H. Steinberg |
[Reply | View]
I agree and would love to see Chris write a book on this topic. His examples are well chosen and explanations are always helpful.
D





