| Frequently Asked Questions | ||||||||||||||||||||||
| ||||||||||||||||||||||
| Why is this FAQ page so short? Where is all the good stuff? | ||||||||||||||||||||||
|
Many of the answers to your questions are in the course materials such as the lecture notes, labs, homework assignments, and answers. I do not want to give all the good stuff away too easily! Jump over to the Calendar section and check out the downloads for any of the courses. | ||||||||||||||||||||||
| How to logout of your shell session | ||||||||||||||||||||||
|
The exit command is used to exit from a shell, including your login shell. The csh shell also has the built-in command logout that also exits the shell. | ||||||||||||||||||||||
| Are my files available on any machine? | ||||||||||||||||||||||
|
All of your files are available on any of the systems that you can log into. Your home directory is automatically NFS mounted from a file server each time you login, no matter where you login. If you do not know what this means, don't worry - just login and be happy - you will learn soon enough. | ||||||||||||||||||||||
| Are my files backed up for me? | ||||||||||||||||||||||
|
Don't count on it. The system admins do perform some backups, but the real question is, can they restore your files? If you lose your files, there is a good chance they are gone. You should perform you own backups using FTP or some other mechanism. | ||||||||||||||||||||||
| How to change your UNIX Password | ||||||||||||||||||||||
|
Because the CTIS department is using NIS+, you must perform a one-time setup before you can use the passwd command to change your password. Follow these instructions very carefully - if you are not sure how to do this, ask someone for help. If you fail to do this correctly, you may not be able to log in again! To complete the one-time setup for changing your password, enter the command below: chkey -p When the system asks you for your password, enter: nisplus The system will then ask you for a second password. This time, enter the password you were given on your account slip. Once you have completed this successfully, you can use the passwd command to change your password from now on. You do not need to use chkey again. | ||||||||||||||||||||||
| How to change your default shell | ||||||||||||||||||||||
|
You can change your default shell for your Foothill UNIX account to any of the shells listed in the file /etc/shells. First, examine the file to be sure the shell you want is allowed as your default login shell. If so, note the full path of the shell as listed in the file. Now run the command: passwd -r nisplus -e and enter the full path of the new shell. It will take a short amount of time before the NIS+ databases are updated (they are updated only periodically). Once updated though, your login sessions will use the new shell you selected. | ||||||||||||||||||||||
| How to set the erase character for your login session | ||||||||||||||||||||||
|
Have you noticed sometimes when you login via telnet, your backspace or delete key does not erase characters, but instead prints out funny ^H characters? You can fix this using the stty command. The stty command assigns the special characters that are used for your login session. These special tty processing characters are not set correctly when you use some telnet clients to login - the problem occurs because the Solaris systems we are using assume a certain setting, but your telnet session is using another. To fix the problem, run the command: stty erase key where you replace key with the key that you want to use for backspace. For example, if you want to use the Delete key as your backspace key, type the Delete key to replace key. Your command would be stty erase <DeleteKey> Once you have done this, your erase character should work as you expect. As an alternative, most telnet clients allow you to set or swap the backspace and delete keys. Examine the preferences or options for you telnet client. This will allow you to set the backspace and delete keys according to the UNIX system you are using. | ||||||||||||||||||||||
| How to enable shell command line and history editing | ||||||||||||||||||||||
|
The popular shells ksh, bash, and tcsh provide support that allows you to edit your command line and recall previously executed commands. This helps minimize the amount of retyping you do, especially when testing a long command line. Enabling and using command line and history editing is simple, and is similar in the various shells. A brief overview for the ksh is present below. See the appropriate man pages for remaining shells To enable command line editing in ksh, give the command: set -o emacs This enables command line editing for the current login session. You can place this command in your ~/.profile file to permanently enable support. Various key bindings allow you to perform the editing operations. The following is a table of useful key bindings and the function each performs.
| ||||||||||||||||||||||
| How to get your prompt back | ||||||||||||||||||||||
|
Have you forgotten to supply a filename to a program such as cat, only to find that you are stuck in the program? Try typing the interrupt key Control-C (the control key held down then the C key) or the End of File key Control-D to get out. Many programs read from STDIN and unless you supply a filename, they are waiting for you to input your data directly from the keyboard. You end your input with a Control-D to indicate your data is finished. If this does not work, try typing the q key, to see if that causes the program to terminate. If all else fails, you can log onto another session, run ps to find the stuck process, and kill it. | ||||||||||||||||||||||
| What is WHOIS and how do I use it? | ||||||||||||||||||||||
|
The WHOIS database has undergone some changes several years ago, requiring various techniques for looking up information. First it is essential to understand what the WHOIS database is, how it is used, and its relationship with DNS. When initially developed, the WHOIS database was the "netwide directory service" for internet users. A little history. Back in 1982 (RFC 812), and then later updated in 1985 (RFC 954), the WHOIS database was designed to include the full name, U.S. mailing address, telephone number, and email address for anyone "capable of passing traffic" on the nascent internet. Translated, this essentially meant any administrator managing one of the relatively few internet hosts available on the ARPANET, or MILNET, and any user who needed access to the MILNET through a TAC (DDN Terminal Access Controller). It was the intent that all users be registered in WHOIS, and access via a TAC was only authorized if the user was in the WHOIS database. As the database grew larger over time with the number of internet users and domains, the database was not necessary up to date, or accurate. It was impossible to monitor and ensure that the information is valid. Still, the database was useful. Fast forward to today, after the NIC relinquished control of the internet to authorized registrars, and the WHOIS database takes on a new meaning. No longer is there a single point of control, nor a single WHOIS database. In addition, registrars require much more information about domain owners. This information is now contained in today's modern WHOIS database. Today, the database includes:
How the WHOIS database is updated today, partly depends on which WHOIS database is being used. When a domain is obtained through a registrar, the registrar 1) creates the essential zone file entries for the domain within its zone files and in the TLD, and 2) sends a request to the administrator of the WHOIS database to include an entry for the user. Thus, registering or modifying a domain updates two databases, DNS and WHOIS. It is important to understand that DNS does not use the WHOIS database to resolve host name information. The name servers listed in the WHOIS database are essentially redundant, but provide some means of verifying that the servers listed for a domain (NS records in DNS) are correct. To find information from the WHOIS database, the UNIX whois program can be used. WHOIS servers can be queried in a variety of ways (a good tutorial that also helps track down SPAMMERs can be found at: www.netdemon.net/tutorials/whois.txt). But here is a simple example lookup on the domain johndoe.com:
$ whois johndoe.com
Whois Server Version 1.3
Domain names in the .com, .net, and .org domains can now be registered
with many different competing registrars. Go to http://www.internic.net
for detailed information.
Domain Name: JOHNDOE.COM
Registrar: NETWORK SOLUTIONS, INC.
Whois Server: whois.networksolutions.com
Referral URL: http://www.networksolutions.com
Name Server: NS.AVIDHOSTING.COM
Name Server: NS2.AVIDHOSTING.COM
Updated Date: 05-nov-2001
>>> Last update of whois database: Fri, 14 Jun 2002 04:52:13 EDT <<<
The Registry database contains ONLY .COM, .NET, .ORG, .EDU domains and
Registrars.
The WHOIS server provided information, but which WHOIS server was actually used? The default server for WHOIS is whois.crsnic.net, and this server, as mentioned in the last line of the output only supports domains under the .com, .net, .org, and .edu TLDs. To find out the actual WHOIS information, the correct WHOIS server must be used, and it is listed in the output above as: Whois Server: whois.networksolutions.com Running whois again, this time using the -h option on Solaris gives the real WHOIS information for the domain johndoe.com:
$ whois -h whois.networksolutions.com johndoe.com
The Data in the VeriSign Registrar WHOIS database is provided by VeriSign for
information purposes only, and to assist persons in obtaining information about
or related to a domain name registration record. VeriSign does not guarantee
its accuracy. Additionally, the data may not reflect updates to billing contact
information. By submitting a WHOIS query, you agree to use this Data only
for lawful purposes and that under no circumstances will you use this Data to:
(1) allow, enable, or otherwise support the transmission of mass unsolicited,
commercial advertising or solicitations via e-mail, telephone, or facsimile; or
(2) enable high volume, automated, electronic processes that apply to VeriSign
(or its computer systems). The compilation, repackaging, dissemination or
other use of this Data is expressly prohibited without the prior written
consent of VeriSign. VeriSign reserves the right to terminate your access to
the VeriSign Registrar WHOIS database in its sole discretion, including
without limitation, for excessive querying of the WHOIS database or for failure
to otherwise abide by this policy. VeriSign reserves the right to modify these
terms at any time. By submitting this query, you agree to abide by this policy.
Registrant:
John Doe Creative (JOHNDOE-DOM)
11778 Melones Circle
Gold River, CA 95670
US
Domain Name: JOHNDOE.COM
Administrative Contact:
Warren, Vivian (VWZ39) vivian@JVSTUDIOS.COM
JV Studios
2744 Tierra Grande Cir.
Sacramento, CA 95827
US
916-361-2011 775-860-3926
Technical Contact:
Hosting, Avid (AHS861) support@AVIDHOSTING.COM
Avid Hosting
367 W. Irving Park Rd. Suite 392
Wood Dale, IL 60191
US
000-000-0000
Record expires on 09-Aug-2003.
Record created on 08-Aug-1995.
Database last updated on 14-Jun-2002 15:13:11 EDT.
Domain servers in listed order:
NS.AVIDHOSTING.COM 208.56.139.153
NS2.AVIDHOSTING.COM 208.56.138.140
To prevent you from trying to obtain too many WHOIS records, some servers only allow a certain number of queries. For example, the WHOIS server for joedoe.com reports:
$ whois -h whois.srsplus.com joedoe.com
joedoe.com
Registrant:
B. Azevedo (hotline@bridge.com.br)
B. Azevedo
Caixa Postal 10870 Copacabana
Rio de Janeiro - RJ, 22022-970
BR
+55-21-9982-9099
Domain Name: joedoe.com
Administrative, Billing Contact:
B. Azevedo (hotline@bridge.com.br)
B. Azevedo
Caixa Postal 10870 Copacabana
Rio de Janeiro - RJ, 22022-970
BR
+55-21-9982-9099
Technical Contact:
B. Azevedo (bsoares@bridge.com.br)
B. Azevedo
Caixa Postal 10870 Copacabana
Rio de Janeiro - RJ, NONE 22022-970
BR
+55-21-9982-9099
Record created on Jan 23 2002.
Record expires on Jan 23 2003.
You have used the whois service 5 / 20
suggesting that we only have 15 more uses of that server for some unspecified amount of time. There are also many web implementations as well, that will automate the search for you, re-directing your query to the appropriate WHOIS server for a given TLD. UWhois.com at www.uwhois.com is one such example of a universal WHOIS lookup mechanism. | ||||||||||||||||||||||
| Are you asked to login to the UNIX Forum whenever you click a link? | ||||||||||||||||||||||
|
If you are using Internet Explorer 6, you may find that the UNIX Forum asks you to login each time you click on a link. The problem occurs because of IE6's new privacy support for cookie handling. To solve the problem, perform the following: In Internet Explorer 6, select the menu item Tools->Internet Options and then select the Privacy tab. Click the Edit button towards the bottom of the dialog box. Enter: unixforum.mikecappella.com into the Address of Web site field and click the Allow button, followed by the OK button. | ||||||||||||||||||||||
| How to capture UNIX command output | ||||||||||||||||||||||
|
There are several ways to capture your command input and output from your UNIX terminal session. You can:
The first method is the simplest both to describe and to implement. Most reasonable telnet clients provide copy/paste support from their session windows. Simply select the text you want to copy, and paste it into some document. You may need to check the client's preferences to increase the number of lines saved that scroll off the screen. Another method is to use the UNIX utility called script. The script utility will capture literally everything that is input or output from your session. To start capturing input and output, just type the command: script Now, all input/output from that telnet or xterm session will be captured in a file name named typescript. If you supply a filename as an argument to script, filename will be used instead of typescript. You can stop the capture by issuing the exit command, or by typing ^D (control-D). There is one annoying problem with script. It literally captures everything that is input and output; this includes all the end-of-line ^M characters, backspace characters used to erase your typos, and various terminal control sequences used for highlighting, bolding, etc. Thus, every line in the script file will end with ^M, and each time you used the backspace key, there will be ^H characters. You will most likely not want these characters to remain in your file, and thus would then need to remove them using various UNIX commands or an editor. Despite this limitation, the script command is quite valuable for capturing very long output or sessions, especially since it is not difficult to clean the file using commands such as ul and the vi editor. The third method for capturing input and output into a file is more advanced, but is very powerful. This method uses the vi editor's built-in support for shell escapes. You can type a command into vi and then execute it, capturing the output of the command directly within the buffer (file) being edited. From within vi, move the cursor to a blank line and type !! and you will see that vi immediately places the cursor at the bottom of the screen in what is called the status area. Now, enter the command you wish to run, just like you would on the command line and press Enter to execute the command. The output from your command will appear in the buffer you are now editing! What is happening is that vi is replacing the current line where the cursor was (the blank line) with the output of your command. | ||||||||||||||||||||||
| How to download and install vim for Windows | ||||||||||||||||||||||
|
Vim is an excellent and extremely powerful replacement for the venerable vi editor. The vim website www.vim.org contains links to vim source and downloadable, precompiled binaries. The site is geared more towards technical folks, so I will make the process of downloading and installing vim easier for you. vim is freeware, and falls under the GNU public license; this means you can freely download source code and binaries for your use. For those of you who want to compile or download for other operating systems, there are links to source and binary versions for most operating systems on the vim site. The current version of vim is 6.0.x. To install vim to run on Windows, you have to download the gvim61.exe vim installer file. You actually will be installing gvim, which is vim, but in a nice graphical window, complete with menus and toolbars... all pre-compiled and built for Windows. Download and run the installer file to install gvim on your system. Some words of advice. Although gvim is the graphical interface for Windows, I recommend ignoring the menus and buttons. Instead, learn vim from the keyboard, because these skills will be transferable to vi and vim on UNIX. Later on, you can certainly decide to use more of the bells and whistles. Also, Windows users have a tendency to want to use arrow keys and other keys not on the standard home row of keys (End, Home, PageUp, etc.). For touch typists, I would recommend that you learn to use vim's hjkl navigation keys instead of arrow keys - once you have become proficient using them, you will increase your overall editing speed tremendously. The philosophy is that you do not want to constantly move your fingers to and from the home row on the keyboard - doing so slows you down significantly. I promise - with just a little practice, the hjkl keys will be come second nature. Vim has online help - to start learning, type :help<CR> and vim will split the window; the top window will be the help window. Type :q<CR> to close the help window to continue editing. Split screens are yet another major improvement in vim over vi - and there are many more. So, have fun - there's a lot to learn! | ||||||||||||||||||||||
| How to install the Cygwin UNIX Environment on your PC | ||||||||||||||||||||||
|
Cygwin is a GNU UNIX-like environment that runs on your PC. The package includes several shells (bash, tcsh, zsh) and the many of the standard GNU tools including the development tools (gcc, etc.). If you want to use a UNIX environment on your PC, this package may be of interest to you. Installing the Cygwin tools (now maintained and distributed by Red Hat) is fairly easy. You will need a fast internet connection, since there is a lot of software to download. First you need to download the Cygwin installer setup.exe program from the Red Hat site. Click on the previous link to start the download. Once the setup.exe installer is downloaded, run it to continue the download process. The installer will give you a chance to select all the different packages you want. When given the option, select Install from Internet, and click Next. Set your Local Package Directory to C:\cygwin on the next dialog box, and click next when you are done. In the Select Install Root Directory, enter C:/cygwin, select Unix as the Default Text File Type and if you are running Windows NT/2000, select your choice for Install For. After clicking Next again, select Direct Connection or Use IE5 Settings as your connection settings, and click Next again. This will present you with a list of servers (called mirrors) from which the installer download Cygwin. Select one of mirrors at the top of the list, and not one of those located in another country. After making your selection, click Next, and setup will download a list of packages to be installed. If you are not sure which packages to select, just let the installer choose for you, and Click Next. Cygwin will start the download which will take while. When the installer is finished, it will ask you if you want a shortcut added on your Desktop and to your Start menu - select Yes for both of these. That's it! To start Cygwin, just launch the shortcut either on the Start menu or on your Desktop. This will open a shell for you, and you can start exploring. Note that while the environment is UNIX-like, it is not UNIX, but acts a lot like UNIX. There is more complete documentation available at the Cygwin site. | ||||||||||||||||||||||
| How to Install Linux onto your PC | ||||||||||||||||||||||
|
You can install Linux on your PC in one of three configurations. Listed below are the three configurations in increasing order of difficulty:
Option 1 is useful if you want to replace, for example, an existing Windows installation, and you want Linux to be the only operating system on your PC. If this is the case, just follow the Linux installation instructions you received with your Linux, or the installation instructions on the RedHat site. Option 2 allows you to use your existing FAT partition to install Linux. You are not required to re-partition anything, but it does require enough free space on your partition. Additionally, performance will not be as good as that of an installation with Linux into its own partition(s), and you will need to boot Linux from a boot floppy. Still, this is a reasonable option for those who want to try to install Linux, without the hassle of re-partitioning. The RedHat site provides instructions on how to perform this type of installation. Refer to the Official Red Hat Linux Installation Guide for RedHat 6.2, RedHat 7.0, RedHat 7.1, or RedHat 7.2. Although you will need to read the entire installation guide, the section you want in particular is Installing Without Partitioning. Option 3 allows you to install Linux into a separate partition, so that at boot time, you choose which system is booted. This multi-boot configuration allows you to run the operating system of your choice without requiring several machines. Probably the most common setup is a dual boot Windows/Linux system that allows booting either into Windows or Linux - but of course, not both at the same time! While setting up a dual boot system is not for the faint of heart, it is not terribly difficult either. I will give you a brief overview of the steps involved. However, I cannot begin to deal with all the issues here, since there are far too many considerations, and volumes of documentation and help is already available. For more complete information, and before you begin the process, be sure to review the material at the following sites:
The basic requirements for setting up a dual boot Windows/Linux system are:
Assuming that you already have Windows installed on your system, the main steps for installing a second operating system are:
RequirementsIn order to install another operating system, you will need sufficient free hard disk space - at least 500 megabytes, and as much as 2 gigabytes depending on what you wish to install and how much free space you wish to make available for Linux. If you do not have enough space available, you will need to either free up enough space in Windows, or add a second hard disk. To re-partition your disk, you will need to use a re-partitioning utility. The utility must be able to safely move the data on an existing partition (unless you already have at least one large free partition). There are both free and commercial versions of re-partitioning utilities. You will have to select the one that meets your needs and budget. I personally use a commercial product, as the extra time required to deal with the free tools is not worthwhile for me. You will have to learn more about partitions and hard disks to use the free utilities such as fips. I have used both Partition Magic 5 and System Commander 2000, and both are good tools. Currently I'm using System Commander 2000, and have used it to multi-boot Windows 98, NT, 2000, Linux, and SCO's UnixWare 7. These commercial tools come with OS installation wizards to help you re-partition and install Linux, which you will probably find very helpful. You can purchase System Commander, Partition Commander or Partition Magic online at various e-stores for about $35-$50, at your local retail store, or from the vendor's store front. The documentation for these utilities will explain how they are installed and how to proceed to the next steps. Note that these tools also provide a graphical means to select the operating system of choice at boot time. While Windows provides a native means to boot into various operating systems, the graphical tools are nice and easier to use. There are many pre-bundled Linux distributions packages available; RedHat, Debian, SuSE, are just a few. You will have to select the one that you like the best. I use RedHat, as their installer is very good, and it includes as much as I need - anything beyond that is available on the web. Besides, the installation CDs came free with a book I purchased. A Linux installation CD costs about $25-$30. You can also download an entire distribution online and burn your own CD if you wish, but you're on your here. Whichever route or bundle you choose, you will need CD(s) before you can install Linux. Once you have the requirements from above, it is very important that you backup your Windows data before you start the re-partitioning or installation process. This process usually works just fine, but anything can go wrong, and sometimes does. Recall Murphy's laws. If you do not care about losing data, feel free to skip this step. You've been forewarned! Once you have installed your re-partitioning software, you will need to run the wizard to begin the re-partitioning process. The re-partitioning utility will move and coalesce any used data on your Windows partitions to the beginning of the partition, making a large contiguous free block of disk space available for the creation of a new partition. Use the documentation that came with your software to complete this process. When this has been accomplished, the wizard will ask you to install the Linux installation CD and reboot. Depending on the age, capabilities, and setup of your BIOS and system, you may require the use of floppy boot diskettes to boot the Linux installer. It is always safe to use them, but the installer CD may not be recognized if you do not. So, it is probably best to use them if you are not sure. You may have to create these floppy disks yourself, depending on which Linux installation you purchased. The Linux distribution documentation should tell you how to create these - the images for the floppy boot disk are available on the CDs themselves in a Windows partition. After inserting the Linux boot floppies and rebooting, the Linux installer will run. You will have to cycle through the boot floppies (2 or 3 usually) and the Linux installer will ask a series of questions. Refer to your documentation to answer these questions. The installer is pretty good about helping you through the installation. After the installation is complete, you will be able to reboot and if you have a boot manager installed, you can select the operating system you wish to boot. Good luck! | ||||||||||||||||||||||
FAQSat, Dec 14 2002, 4:56pm
Need help? Here are some answers to frequently asked questions about the course. Just select one of the topics
below. If you have a question
that is relevant to the course material, and you want others to benefit
from the question/answer, send me your question via email, and I'll post it
and the answer below. Of course, most of the good information is in the course lecture notes, labs and homework assignments.



