Archive for May, 2007

Cedant web hosting - Directory Description dev Either or both of these

Tuesday, May 8th, 2007

Directory Description dev Either or both of these will exist. They contain device files, often including devices cdrom(CD-ROM drive), eth0 (Ethernet interface), and fd0 (floppy drive). (The devices are often named differently in the different Unix systems.) etc Contains system configuration files such as passwd (holds user account information and is not to be confused with /bin/passwd); hosts (contains information about host resolution); and shadow (contains encrypted passwords). export Often contains remote file systems (those external to the physical system), such as home directories exported from another system to save space and centralize home directories. home Contains the home directory for users and other accounts (specified in /etc/passwd, for example). kernel Contains kernel files. lib Contains shared library files and sometimes other kernel-related files. mnt Used to mount other temporary file systems, such as cdrom and floppy for the CD-ROM drive and floppy diskette drive, respectively. proc Contains all processes marked as a file by process number or other information that is dynamic to the system. sbin Contains binary (executable) files, usually for system administration. Examples include fdisk (for partitioning physical disks) and ifconfig (for configuring network interfaces). tmp Holds temporary files used between system boots (some Unix systems do not delete the contents of the tmp directory between boots). usr Used for miscellaneous purposes, or can be used by many users (such as for man pages). Can include administrative commands, shared files, library files, and others. var Typically contains variable-length files such as log and print files and any other type of file that may contain a variable amount of data. For instance, the log files (typically in /var/log) range in size from very small to very large, depending on the system configuration. Your Unix system may contain more than, fewer than, or all of these directories, but it will generally contain five or six of them plus subdirectories that vary from implementation to implementation. Paths and Case There are two other important concepts you should know about before moving on: paths (absolute and relative) and case sensitivity. Every file has an absolute path and a relative path. The absolute path refers to the exact location of the file in its file system, such as /etc/passwd. The relative path refers to the location of a file or directory 56 Chapter 4
Note: In case you are looking for affordable webhost to host and run your web application check Vision http web server services

Figure 4-1 Root s Basic Directories Remembering that root (Yahoo web space)

Tuesday, May 8th, 2007

Figure 4-1 Root s Basic Directories Remembering that root is the base of the file system, there are some core directories that generally exist on most Unix systems. The directories have specific purposes and generally hold the same types of information for easily locating files. Following are the directories that exist on the major versions of Unix: Directory Description / Root should contain only the directories needed at the top level of the file structure (or that come already installed in it). Unnecessary subdirectories under root can clutter your system, making administration more difficult and, depending on the system, filling up the space allocated for /. bin Usually contains binary (executable) files critical for system use, and often contains essential system programs, such as vi (for editing files), passwd (for changing passwords), and sh (the Bourne shell). boot Contains files for booting the system. Table continued on following page /boot /dev or /devices (or both) /bin / /etc /home /kernel /lib /mnt /opt /proc /sbin /tmp /usr /var 55 File System Concepts
Note: In case you are looking for affordable and reliable webhost to host and run your j2ee application check Vision web and email hosting services

Photography web hosting - can be manipulated. A slice of pie is

Monday, May 7th, 2007

can be manipulated. A slice of pie is akin to a partition on a drive, and the whole pie could represent a single partition that takes up a whole disk. There are more advanced meanings as well, but for this chapter, only a hard drive or the systematic division of a hard drive is considered to be a partition. A partition usually contains only one file system, such as one file system housing the / file system or another containing the /home file system. One file system per partition allows for the logical maintenance and management of differing file systems. These partitions are invisible to users, who can move effortlessly among any number of file systems on their Unix systems without even knowing they ve gone from one to another. Everything in Unix is considered to be a file, including physical devices such as DVD-ROMs, USB devices, floppy drives, and so forth. This use of files allows Unix to be consistent in its treatment of resources and gives the user a consistent mechanism of interaction with the system. It s easy to understand, then, why file systems are an integral part of a Unix operating system. Unix uses a hierarchical structure to organize files, providing a from-the-top approach to finding information by drilling down through successive layers in an organized fashion to locate what s needed. It s similar to the way that a filing cabinet works. The file cabinet itself is the holder of all information in other words, it s the base of the filing system. To find hiring information about a certain employee, for example, you need to locate the correct file cabinet, the correct drawer in the cabinet, the correct folder in the drawer, and the correct page of information inside the folder. In Unix, everything starts with the root directory, often designated only by /. (This directory is not to be confused with the user account named root, which was discussed in Chapter 3.) All other files and directories originate there. The root directory generally includes a set of commonplace directories (see the Root s Basic Directories section of this chapter), then subdirectories within those directories, and so on. To find specific information in Unix, you need to locate the correct directory, the correct subdirectories, and the correct file. Directory Structure Unix uses a hierarchical file system structure, much like an upside-down tree, with root (/) at the base of the file system and all other directories spreading from there. The vast majority of Unix systems use the directories shown in Figure 4-1 and described in the next table. (For information about the directory structure on Mac OS X, see Chapter 20.) Not every version of Unix will have all the directories listed, nor is this an all-inclusive list, because Unix vendors may incorporate their own directories. Every vendor s Unix systems implement their own directory structures as needed by the vendor and its customers. No system has the exact same directory structure as another, but they generally have the directories described in this chapter and usually follow the conventions outlined as well. Essentially, you always start with the root directory to find any other directory or file. If the hiring information you wanted to find earlier is stored in your Unix computer, you might find the specific information (let s call the employee John Doe) in /home/hr/A_J/John_Doe, where / is the root directory, home is a subdirectory of root, hr is a subdirectory of home, A_J is a subdirectory of hr, and John_Doe, the file you want, is in the A_J directory. 54 Chapter 4
Note: If you are looking for cheap and reliable webhost to host and run your mysql application check Vision professional web hosting services

4 File System Concepts A file system is (Web design software)

Monday, May 7th, 2007

4 File System Concepts A file system is a component of Unix that enables the user to view, organize, secure, and interact with files and directories that are located on storage devices. There are different types of file systems within Unix: disk-oriented, network-oriented, and special, or virtual. . Disk-oriented (or local) file system Physically accessible file systems residing on a hard drive, CD-ROM, DVD ROM, USB drive, or other device. Examples include UFS (Unix File System), FAT (File Allocation Table, typically Windows and DOS systems), NTFS (New Technology File System, usually Windows NT, 2000, and XP systems), UDF (Universal Disk Format, typically DVD), HFS+ (Hierarchical File System, such as Mac OS X), ISO9660 (typically CD-ROM), and EXT2 (Extended Filesystem 2). . Network-oriented (or network-based) file system A file system accessed from a remote location. These are usually disk-oriented on the server side, and the clients access the data remotely over the network. Examples include Network File System (NFS), Samba (SMB/CIFS), AFP (Apple Filing Protocol), and WebDAV. . Special, or virtual, file system A file system that typically doesn t physically reside on disk, such as the TMPFS (temporary file system), PROCFS (Process File System), and LOOPBACKFS (the Loopback File System). This chapter discusses disk-oriented file systems in depth and briefly covers the network-oriented and special file systems. Mac OS X users should keep in mind that, although their file system layout differs sharply from that of a traditional Unix system, all of the utilities mentioned in this chapter are available and useful on a Mac OS X system. Also, Unix is a case-sensitive operating system, but Mac OS X is a case-insensitive/case-preserving operating system. The significance of this difference will be discussed later in this chapter. File System Basics A file system is a logical collection of files on a partition or disk. A partition is a container for information and can span an entire hard drive if desired. An apple pie, for example, can be eaten whole or it can be cut into slices, which is similar to how a hard drive or other physical storage device
Note: In case you are looking for affordable webhost to host and run your servlet application check Vision make web site services

Web design rates - the employees, info_tech_1, info_tech_2, and info_tech_5 groups. Her

Monday, May 7th, 2007

the employees, info_tech_1, info_tech_2, and info_tech_5 groups. Her contract with the company ends 31 days from her start date. Create the account using useradd. Here s additional information you ll need: Standard users are created with an inactive account timeout of 10 days, and are assigned the Korn shell. A username (account name) is created using the person s firstinitial- and-last-name combination (up to eight characters for the account name). In this company, all accounts have the employee name in the /etc/passwd file as well as a designation of E for full-time employees or C for contractors before the name, with one space between the designator and the employee name. The system uses the /export/home directory for home directories. Assign Jane s account the userid 1000 because the most recent account UID created was 999. You are already logged in as root. 51 Understanding Users and Groups
Note: If you are looking for best quality webspace to host and run your tomcat application check Vision personal web hosting services

Figure 3-16 All of these commands will help (Web space)

Sunday, May 6th, 2007

Figure 3-16 All of these commands will help you manage your accounts and the systems. Summary In this chapter, you learned what accounts and groups are and how to manage them. You explored switching users and other important administrative commands that can help you build your Unix knowledge base as you progress into later chapters. Now that you understand accounts and groups, put your new knowledge to work on the following exercises. Exercises 1. What are the three primary files that deal with user and group administration? What are they for? 2. Jane Doe is a new contractor who will be joining your company May 1, 2005, to work on an Information Technology project and also to assist in some end-of-fiscal-year Human Resources work. Jane s manager has requested that you create an account for Jane, who will need access to 50 Chapter 3
Note: In case you are looking for affordable webhost to host and run your servlet application check Vision servlet hosting services

Figure 3-15 Everything after the uid= (Web hosting plans) and before

Sunday, May 6th, 2007

Figure 3-15 Everything after the uid= and before the gid= is the user ID information, and everything after the gid= pertains to primary and secondary (supplemental) groups to which the account belongs. The groups command can identify the groups to which a user or your account belongs. Run by itself, it identifies the groups of the currently logged-in user. Supply an account name as an argument, and groups reports on that user s groups. Figure 3-16 shows examples of both. 49 Understanding Users and Groups
Note: In case you are looking for affordable webhost to host and run your servlet application check Vision make web site services

Free web hosting music - Sometimes you will be logging in to different

Saturday, May 5th, 2007

Sometimes you will be logging in to different machines or will have switched users so much that you aren t sure what user you currently are. To do so, use the whoami or who am i command. These commands look almost the same, but the spaces make a big difference. whoami shows who you are currently logged in as, whereas who am i shows who you originally logged on to the system as. Figure 3-14 shows examples of the two commands. Figure 3-14 The first time the whoami command is run, it shows the user as beginningunix, which is the user who logged in to this system. Then the who am i command also shows that the user is beginning unix, along with the other information that appears with the who command. Following the sudo sh command in Figure 3-14, taking beginningunix to a root shell, whoami shows the user as root. The id command shows information about the user logged in and about the user s groups. An example of id displaying the beginningunix account s information is shown in Figure 3-15, followed by an id after sudo sh, which shows the root user s information. 48 Chapter 3
Note: If you are looking for best quality webspace to host and run your tomcat application check Vision personal web hosting services

To list all the commands available for the (Hosting your own web site)

Saturday, May 5th, 2007

To list all the commands available for the user to run with sudo, type: sudo -l Before you can run any commands, the system generally requires you to enter your password so it can validate your credentials. On Mac OS X, you cannot easily log in as the root user using the su command, but you can use the sudo command to achieve the same functionality by typing: sudo /bin/sh This command takes you to a root shell, which is equivalent to running su by itself with no arguments (this works with other versions of Unix as well). User- and Group-Related Commands Anumber of commands can give you important user and group information to help you manage your accounts and the systems. The who command, for example, identifies who is currently logged in to the system. To use it, just type who at the command line. Its output is similar to what is shown in Figure 3-13. Figure 3-13 The output is in four columns: login name, terminal, login time, and remote hostname or X display. In Figure 3-13, three users are logged in: beginnin (beginningunix, but the name was truncated for space reasons on the output) twice and jdoe. The console is the terminal (screen display) as well as the ttyp1 and ttyp2, which are terminals (devices to identify what terminal the user is on). The next field identifies the date and time when each the user logged in, and you can see that jdoe came in from a remote connection (192.168.1.2). 47 Understanding Users and Groups
Note: If you are looking for cheap webhost to host and run your apache application check Vision jboss web hosting services

Unlimited web hosting - Solaris Solaris provides a tool called admintool, which

Friday, May 4th, 2007

Solaris Solaris provides a tool called admintool, which allows for granular management of accounts and groups. To access admintool, type the following at the command line: admintool & The ampersand (&) after the command puts the command process in the background so you can continue using the terminal window for other operations. It has many features and can manage devices as well as users. To learn more about the capabilities of this tool, visit Sun Microsystems Web site (www.sun.com) and search for admintool. Becoming Another User There are times when you will need to log into another account without logging out of the system. There are two commands that enable you to do this: su and sudo. The su (switch user) command is available on all versions of Unix. It enables you to remain logged in as yourself while accessing another account. You must know the password for the account you are trying to access using su unless you are the root user, in which case you don t need a password (on the local system). Here s the syntax for su: su accountname If you are logged in as jdoe, for example, and want to log in as jsmith, type: su jsmith When using su, you continue to use your own environment variables and profile (which you ll learn in Chapter 5). If you want to use the account s user environment, put a dash (-) between the su and the account name: su - jsmith You will be asked for the password of the account to which you are switching unless you are the root user, in which case you are immediately logged in to the account. If you type the su command with no account name (with or without the -), you are attempting to log in to the root account and will be asked for the root password. (Many people think su stands for superuser because running the su command by itself takes you to the root, or superuser, account). When you have completed the tasks requiring the account you ve su d to, type exit. You re returned to your original account (and environment, if applicable). The sudo (superuser do) command enables the superuser, or root administrator, to delegate commands that can be run by others. It is not available on all Unix systems but can be downloaded from http://courtesan.com/sudo/. Here s the command s syntax: sudo command to run 46 Chapter 3
Note: If you are looking for cheap and reliable webhost to host and run your mysql application check Vision professional web hosting services