Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!

Using UNIX aliases to save keystrokes UNIX
If you're a complete beginner to UNIX (as I still consider myself), you can use something called aliases to save yourself a lot of typing at the command line.

In the Mac OS, an alias is simply a pointer to another file. In the UNIX world, an alias is similar in concept, except that it's a command that points at another command. There are a few pre-defined aliases in the tcsh shell (the program that runs when you open a terminal). You can see these by typing
alias
at the command line. One of the more useful pre-defined aliases is ll which replaces ls -lag for complete file listings.

Although the pre-defined aliases are useful, the real power is in creating your own aliases for your often-used commands. If you're new to UNIX and you'd like to learn about aliases and how to use them, read the rest of this article.
read more (363 words)   Post a comment  •  Comments (4)  
  • Currently 2.67 / 5
  You rated: 1 / 5 (6 votes cast)
 
[21,729 views] Email Article To a Friend View Printable Version
Building the newest PHP and Apache UNIX
I just wanted to let everyone know that I have successfully built Apache 1.3.17 and PHP 4.04pl1 as a DSO on Mac OS X Public Beta 1H39 (AKA Darwin).

The problem was that the configure script for PHP was trying to create a file in the ./pear directory named 'pear' where a directory named 'PEAR' already exists. Of course, since Mac OS X uses the HFS+ disk format by default (case preserving, case insensitive) this is not allowed. Read the rest of the article if you'd like to see how to modify the configure file to successfully build the latest versions of PHP and Apache.

Michael.

[Editor's note: This process requires the developer's tools, as you'll need the compiler to build the applications after editing the files.]
read more (142 words)   Post a comment  •  Comments (0)  
  • Currently 2.50 / 5
  You rated: 1 / 5 (4 votes cast)
 
[4,043 views] Email Article To a Friend View Printable Version
Scripting ftp transfers UNIX
If you often transfer the same file to/from an FTP server (or do anything repetitively with an FTP server), you can use UNIX and a simple script to automate the process. Although similar things are probably possible with grapical clients, this will teach you a bit about UNIX and a very basic shell script.

I use two such scripts on my OS X box. Since my home machine is occasinally out of OS X, that means that my family's OS X hosted website is not accessible. Before I shut down OS X, I upload a "Our server is down" page to my ISP-hosted site. When I return to OS X, I upload a "Our server is up" page. This way, our family and friends can tell easily if the site is up or not. I manage both these tasks with a double-click on an icon in the finder, thanks to these scripts.

This tutorial requires some basic understanding of the command line and an OS X text editor such as vi or pico. Read the rest if you'd like to see how to set up a simple automated FTP script.
read more (547 words)   Post a comment  •  Comments (5)  
  • Currently 3.00 / 5
  You rated: 4 / 5 (4 votes cast)
 
[15,788 views] Email Article To a Friend View Printable Version
Use the 'bash' shell in the terminal UNIX
The default shell (the program that runs when you open a terminal window) is called tcsh. Bash is an alternative with a superset of features that many UNIX users prefer; you can read about it on the Bash information page. Jim Weisbin of savagetranscendental.com has written a great set of instructions for installing the Bash shell in OS X.

You can download Bash from Jim's site, and the installation instructions are included. It's quite simple; if you've used the terminal much at all, it should be fairly straightforward. You can also view the instructions online prior to downloading to get some idea of the process.
  Post a comment  •  Comments (1)  
  • Currently 3.25 / 5
  You rated: 2 / 5 (4 votes cast)
 
[5,853 views] Email Article To a Friend View Printable Version
Modify your terminal shell prompt UNIX
The tcsh shell (the one that launches when you start a terminal) has a prompt which looks like this:

[machinename:~] username%

You can modify the prompt with the set prompt = command (subtle, I know!). Over on the MacNN forums, this thread includes a great tutorial (written by blanalex) on how to generate some unique and useful prompt strings, including those with colored foregrounds and backgrounds.

I've reproduced the final how-to from the discussion in the remainder of this article, in case the MacNN posting goes away anytime soon.
read more (546 words)   Post a comment  •  Comments (9)  
  • Currently 2.00 / 5
  You rated: 2 / 5 (7 votes cast)
 
[57,468 views] Email Article To a Friend View Printable Version
An intro to UNIX file permissions UNIX
If you're new to UNIX, the concept of file permissions can be somewhat daunting, to say the least. In a nutshell, permissions control who is able to do what to any given file or directory. It's important that they're properly set, otherwise certain things (such as CGI's for your web server, or shell scripts) may not work as you expect them to.

Read the rest of this article if you'd like an introduction to managing permissions in UNIX. Although quite detailed, this is not intended to be a complete education on file permissions; a good UNIX book is still recommended as the best way to further increase your knowledge.
read more (923 words)   Post a comment  •  Comments (4)  
  • Currently 1.63 / 5
  You rated: 1 / 5 (8 votes cast)
 
[18,450 views] Email Article To a Friend View Printable Version
Adding users from the shell UNIX
"JasonB" has written two shell scripts which enable the addition and deletion of users to your OS X system from the command line. Normally this would be done in Netinfo, but the command line option is nice if you ever want to do this remotely.

His scripts and instructions can be found on this page of his web site.

I have not tried these yet personally, but there's no reason to believe they won't work.
  Post a comment  •  Comments (4)  
  • Currently 1.75 / 5
  You rated: 2 / 5 (8 votes cast)
 
[5,557 views] Email Article To a Friend View Printable Version
Problems compiling UNIX
[Editor's note: See the comments for suggestions on making this work.]

What does it mean when running "make" gives lots of "nothing to be done for all" messages? I'm trying to compile Windowmaker-0.62.1 (Xfree86 for Darwin is installed and works) ...
./configure --host=powerpc-apple-nextstep
works, but "make" seems to fail.
  Post a comment  •  Comments (3)  
  • Currently 1.89 / 5
  You rated: 3 / 5 (9 votes cast)
 
[3,666 views] Email Article To a Friend View Printable Version
Customize your SSH/telnet message UNIX
If you use SSH or telnet to connect to your OS X box remotely, you'll notice that you see Welcome to Darwin! every time you connect.

If you'd like it to say something more meaningful or entertaining, simply pick your favorite editor and edit
/etc/motd
Insert the message of your choice and save your changes. Now you'll be connecting to "Tom's Terrific G4 Tower of Terror!" instead of boring old Darwin!
  Post a comment  •  Comments (0)  
  • Currently 1.63 / 5
  You rated: 1 / 5 (8 votes cast)
 
[8,068 views] Email Article To a Friend View Printable Version
GUI for UNIX crontab UNIX
crontab is a program that is used to schedule programs to run at certain intervals. It's used in OS X to schedule things like the updating of the index that makes "locate" and "whereis" function. You update crontab through a terminal session.

"anothermacguy" posted on the MacNN forums that he had found a GUI front-end for crontab. Sven Schmidt is the author, and you can find information and the program on his homepage.
  Post a comment  •  Comments (0)  
  • Currently 1.78 / 5
  You rated: 1 / 5 (9 votes cast)
 
[11,027 views] Email Article To a Friend View Printable Version