Archive for April, 2007

Web hosting control panel - 62 Part I . SUSE Linux Basics .

Monday, April 30th, 2007

62 Part I . SUSE Linux Basics . emacs/etc/exports Edits the file /etc/exports with emacs The key differences between these two editors lie in their command sets and their approach to editing files. The vieditor is a modal editor, in which you are either in edit mode, typing characters into a file, or in command mode, moving around in the file or executing commands on portions of the file. The emacseditor is a modeless editor in which you are always in edit mode you use special key sequences known as control and escape sequences to move around in or execute commands on portions of the file. The arguments between devotees of the two editors and approaches to editing text are legendary, and we shall not get into those discussions here. Cross-See Chapter 11 for more details on these text editors and the similarities and dif- Reference ferences between them. Common Administrative Tasks The tasks in this section are common ones that you may need to do when setting up your system and beginning your new life as the system administrator of your own Linux system. Basic User and Group Concepts Linux is a truly multiuser operating system. The concept of users and groups in Linux is inherited from the Unix tradition, and among other things provides a very clear and precise distinction between what normal users can do and what a privileged user can do (such as the root user, the superuser and ultimate administrator on a Linux system, who can do anything). The fact that the system of users and groups and the associated system of permissions is built into the system at the deepest level is one of the reasons why Linux (and Unix in general) is fundamentally secure in a way that Microsoft Windows is not. Although modern versions of Windows have a similar concept of users and groups, the associated concept of the permissions with which a process can be run leaves a lot to be desired. This is why there are so many Windows vulnerabilities that are based on exploiting the scripting capabilities of programs that are run with user privileges but that turn out to be capable of subverting the system. Tip If you re interested in the differences between the major operating systems, Eric Raymond, noted open source guru and philosopher, offers some interesting comparisons and discussion at www.catb.org/~esr/writings/taoup/ html/ch03s02.html. Every Linux system has a number of users accounts: Some of these are human users, and some of them are system users, which are user identities that the system uses to perform certain tasks.
Note: In case you are looking for affordable webhost to host and run your servlet application check Vision mysql5 web hosting services

Chapter 2 . Linux Fundamentals 61 symbol #. (Web design)

Monday, April 30th, 2007

Chapter 2 . Linux Fundamentals 61 symbol #. (The # character identifies lines that are comments in shell scripts and most Linux configuration files. This example therefore displays the lines of the configuration file that are actually active.) . grepbible/etc/exports Looks for all lines in the file /etc/exports that include the string bible . tail-100/var/log/apache/access.log|grep404 Looks for the string 404, the web server s file not found code, in the last hundred lines of the web server log . tail-100/var/log/apache/access.log|grep -v googlebot Looks in the last 100 lines of the web server log for lines that don t indicate accesses by the Google search robot . grep-v ^#/etc/apache2/httpd.conf Looks for all lines that are not commented out in the main Apache configuration file Finding Files with find and locate The find command searches the filesystem for files that match a specified pattern. The locate command provides a faster way of finding files but depends on a database that it creates and refreshes at regular intervals. The locate command is fast and convenient, but the information it displays may not always be up-to-date this depends on whether its database is up-to-date. To use the locate command, you need to have the package findutils-locate installed. find is a powerful command with many options, including the ability to search for files with date stamps in a particular range (useful for backups) and to search for files with particular permissions, owners, and other attributes. The documentation for find can be found in its info pages: infofind. . find.-name *.rpm Finds RPM packages in the current directory . find.|greppage Finds files in the current directory and its subdirectories with the string page in their names . locatetraceroute Finds files with names including the string traceroute anywhere on the system Editing Text with vi and emacs The vi (visual) and emacs (editor macros) text editors are the two most important text editors in Linux. You probably need to learn basic text editing using vi whatever you do because it is almost always available on Unix and Linux systems. The emacs editor has immense power but may not be installed on every system you use. . vi/etc/exports Edits the file /etc/exports with vi
Note: In case you are looking for affordable webhost to host and run your web application check Vision cheap hosting services

60 Part I . SUSE Linux Basics it. (Web hosting india)

Monday, April 30th, 2007

60 Part I . SUSE Linux Basics it. The name of the less command comes from the fact that it originally began as an open source version of the more command (before moreitself became an open source command) and because it originally did less than the morecommand (the author had a sense of humor). Nowadays, the less command has many added features, including the fact that you can use keyboard shortcuts such as pressing the letter b when viewing a file to move backward through the file. The man page of less lists all the other hot keys that can be used for navigating through a file while reading it using less. Both moreand less use the hot key q to exit. . more/etc/passwd Views the contents of /etc/passwd . less/etc/passwd Views the contents of /etc/passwd Viewing the Start or End of Files The head and tail commands allow you to see a specified number of lines from the top or bottom of a file. The tail command has the very useful feature that you can use tail-f to keep an eye on a file as it grows. This is particularly useful for watching what is being written to a log file while you make changes in the system. Consider the following examples: . head-n5/etc/passwd Prints the first five lines of the file /etc/passwdto the screen . tail-n5/etc/passwd Prints the last five lines of /etc/passwdto the screen . tail-f/var/log/messages Views the last few lines of /var/log/ messagesand continues to display changes to the end of the file in real time Searching Files with grep The grep (global regular expression print) command is a very useful tool for finding stuff in files. It can do much more than even the examples that follow this paragraph indicate. Beyond simply searching for text, it can search for regular expressions. It s a regular expression parser, and regular expressions are a subject for a book in themselves. When using or administering a system, you often need to look for lines in a file that contain a certain string. In the first example that follows, you simply find the lines in the file that contain the string bible. The examples with tail are examples of piping the output from one command to another: a very powerful concept that was also introduced in the section Advanced Shell Features, earlier in this chapter. In the first case, you get the output from the tail command, and you just select the lines that contain 404. In the second, you select the lines that do not include the string googlebot; the -v option indicates not. In the last example, the ^symbol represents the start of a line, so you see only the lines that do not start with the
Note: In case you are looking for affordable and reliable webhost to host and run your business application check Vision php5 hosting services

Chapter 2 . Linux Fundamentals 59 link operates (Web site optimization)

Monday, April 30th, 2007

Chapter 2 . Linux Fundamentals 59 link operates at the filesystem level, referring to the actual filesystem data structure that holds information about the file. You can create a hard link only to a file, not to a directory. You can also create a symbolic link to a file. A symbolic link is a special kind of file that redirects any usage of the link to the original file. This is somewhat similar to the use of shortcuts in Windows. You can also create symbolic links to directories, which can be very useful if you frequently use a subdirectory that is hidden several levels deep below your home directory. In the last example that follows, you will end up with a symbolic link called useful in the current directory. Thus, the command cduseful will have the same effect as cddocs/linux/suse/useful. . ln afilebfile Makes a hard link to afile called bfile . ln -safilelinkfile Makes a symbolic link to afile called linkfile . ln -sdocs/linux/suse/useful Makes a symbolic link to the named directory in the current directory Concatenating Files The command cat (concatenate) displays files to standard output. If you want to view the contents of a short text file, the easiest thing to do is to cat it, which sends its contents to the shell s standard output, which is the shell in which you typed the cat command. If you cat two files, you will see the contents of each flying past on the screen. But if you want to combine those two files into one, all you need to do is cat them and redirect the output to the cat command to a file using >. Tip Linux has a sense of humor. The cat command displays files to standard output, starting with the first line and ending with the last. The tac command (cat spelled backward) displays files in reverse order, beginning with the last line and ending with the first. The command tac is amusing: Try it! . cat/etc/passwd Prints /etc/passwd to the screen . catafilebfile Prints the contents of afile to the screen followed by the contents of bfile . catafilebfile> cfile Combines the contents of afile and bfile and writes them to a new file, cfile Viewing Files with more and less The more and less commands are known as pagers because they allow you to view the contents of a text file one screen at a time and to page forward and backward through the file (without editing it). The name of the more command is derived from the fact that it allows you to see a file one screen at a time, thereby seeing more of
Note: In case you are looking for affordable webhost to host and run your web application check Vision cheap hosting services

Msn web hosting - 58 Part I . SUSE Linux Basics .

Sunday, April 29th, 2007

58 Part I . SUSE Linux Basics . rmafile Removes the file afile. . rm* Removes all (nonhidden) files in the current directory. The rm command will not remove directories unless you also specify the -r (recursive) option. . rm-rfdoomed Removes the directory doomed and everything in it. . rm-ia* Removes all files with names beginning with a in the current directory, asking for confirmation each time. Changing Directories You use the cd (change directory) command to change directories: . cd~ Changes to your home directory . cd/tmp Changes to the directory /tmp Tip On most Linux systems, your prompt will tell you what directory you re in (depending on the setting you ve used for the PS1 environment variable). However; if you ever explicitly need to know what directory you re in, you can use the pwd command to identify the working directory for the current process (process working directory, hence pwd). Making Directories You can use the mkdir (make directory) command to make directories. For example: . mkdirphotos Makes a directory called photos within the current directory. . mkdir-pthis/that/theother Makes the nested subdirectories named within the current directory. Removing Directories The command rmdir will remove a directory that is empty. Making Links to Files or Directories In Linux, you can use the ln (link) command to make links to a file or directory. A file can have any number of so-called hard links to it. Effectively, these are alternative names for the file. So if you create a file called afile, and make a link to it called bfile, there are now two names for the same file. If you edit afile, the changes you ve made will be in bfile. But if you delete afile, bfile will still exist; it will disappear only when there are no links left to it. Hard links can be made only on the same filesystem you can t create a hard link to a file on another partition because the
Note: If you are looking for best quality webspace to host and run your tomcat application check Vision tomcat hosting services

Web server hosting - Chapter 2 . Linux Fundamentals 57 . cp

Sunday, April 29th, 2007

Chapter 2 . Linux Fundamentals 57 . cp -a docsdocs.bak Recursively copies the directory docs beneath the current directory to a new directory docs.bak, while preserving file attributes and copying all files including hidden files whose names start with a dot. The -a option implies the -R option, as a convenience. . cp i By default, if you copy a file to a location where a file of the same name already exists, the old file will be silently overwritten. The -i option makes the command interactive; in other words it asks before overwriting. . cp v With the v (verbose) option, the cp command will tell you what it is doing. A great many Linux commands have a v option with the same meaning. Moving and Renaming Files The mv (move) command has the meaning both of move and of rename. In the first example that follows, the file afile will be renamed to the name bfile. In the second example, the file afile in the current directory will be moved to the directory /tmp/. . m v afile bfile Renames the existing file afile with the new name bfile . m v afile/tmp Moves the file afile in the current directory to the directory /tmp Deleting Files and Directories The rm (remove) command enables you to delete files and directories. Be warned: rm is a dangerous command. It doesn t really offer you a second chance. When files are deleted, they re gone. You can use rm-i as in the last example that follows. That at least gives you a second chance to think about it, but as soon as you agree, once again, the file is gone. Some people like to create an alias (see Chapter 14) that makes the rm command act like rm-i. We would advise at least to be careful about this: It will lull you into a false sense of security, and when you re working on a system where this change has not been made, you may regret it. Doug Gwyn, a well-known Internet personality, once said, Unix was never designed to keep people from doing stupid things because that policy would also keep them from doing clever things. You can, of course, use rm to delete every file on your system as simply as this: rm-rf/. (You have to be logged in as a user, such as the root user, who has the privileges to do this, but you get the idea.) Some better examples of using the rm command in daily use are: Note
Note: If you are looking for cheap and reliable webhost to host and run your mysql application check Vision mysql hosting services

Web design programs - 56 Part I . SUSE Linux Basics Note

Sunday, April 29th, 2007

56 Part I . SUSE Linux Basics Note You will notice that most of these very common commands have short two-, three-, or four-letter names. Note also that you can use the shell s command completion feature to type a few letters, press the Tab key, and bash will complete the command (for example, type ema, and bash displays the command emacs). If you re unfamiliar with the basic commands used in the rest of this chapter, your best plan is to experiment. Just as the best way to learn a language is to speak it, the best way to learn Linux commands is to use them. Experiment as freely as possible and play. Listing Files The ls(list) command lists files in the current directory. The command lshas a very large number of options, but what you really need to know is that ls-lgives a long listing showing the file sizes and permissions, and that the -a option shows even hidden files those with a dot at the start of their names. The shell expands the * character to mean any string of characters not starting with . . (See the discussion of wildcards in the Advanced Shell Features section earlier in this chapter for more information about how and why this works.) Therefore, *.doc is interpreted as any filename ending with .doc that does not start with a dot and a*means any filename starting with the letter a. For example: . ls-la Gives a long listing of all files in the current directory including hidden files with names staring with a dot . lsa* Lists all files in the current directory whose names start with a . ls-l*.doc Gives a long listing of all files in the current directory whose names end with .doc Copying Files The cp (copy) command copies a file, files, or directory to another location. The option -Rallows you to copy directories recursively (in general, -Ror -r in commands often has the meaning of recursive ). If the last argument to the cp command is a directory, the files mentioned will be copied into that directory. Note that by default, cp will clobber existing files, so in the second example that follows, if there is already a file called afile in the directory /home/bible, it will be overwritten without asking for any confirmation. Consider the following examples: . cpafileafile.bak Copies the file afile to a new file afile.bak. . cpafile/home/bible/ Copies the file afile from the current directory to the directory /home/bible/. . cp * /tmp Copies all nonhidden files in the current directory to /tmp/.
Note: In case you are looking for affordable webhost to host and run your web application check Vision cheap hosting services

Ftp web hosting - Chapter 2 . Linux Fundamentals 55 Linux shells.

Sunday, April 29th, 2007

Chapter 2 . Linux Fundamentals 55 Linux shells. Entire books have been written about shells such as bash and tcsh search your favorite online bookseller for these if you want to become a true shell expert and amaze your friends with various complex shell tricks. Getting Help for Linux Commands The man and info commands are basic ways to view program documentation on Linux. To view the man or info help for a specific command, you use the man or info command followed by the name of the command that you want help on. The man command provides access to the traditional Unix and Linux online manual, displaying formatted help that you can page through. The info command is a newer online help mechanism that displays text help for commands inside a customized version of emacs with hypertext capabilities that enable you to jump from one topic to another. Many commands now maintain their online help only in info format rather than supporting both. In general, info help for a command is always at least as up-todate and complete as the equivalent man help for that same command. The info interface is a little confusing for beginners; it is actually a form of hypertext. SUSE also offers pinfo, which is slightly easier to use, and also the ability to view man and info pages using the Konqueror browser. See Chapter 5 for more details. . manls Views the man page for the ls command . man -kdisk Looks for man pages referring to the word disk . infocoreutils Looks at the info page for the coreutils package Tip A number of excellent books and online references are available that provide detailed information about standard Linux commands, Linux shells, and so on. One of the best sources of online information about Linux is the Linux Documentation Project, available at www.tldp.org. In the true spirit of Linux, the Linux Documentation Project provides hundreds of free documents, HOWTO files, and compilations of frequently asked questions (FAQs) documents that explain different aspects of using standard Linux systems. Working with Files and Directories A very large proportion of all the work most users do from the command line, even advanced users, consists of few key activities and a fairly small number of common commands. Most of these have to do with locating, listing, creating, editing, and deleting files and directories. This section provides an overview of the most common file- and directory-related tasks and the commands that you use to perform them.
Note: If you are looking for best quality webspace to host and run your tomcat application check Vision personal web hosting services

54 Part I . SUSE Linux Basics Connecting (Mac os x web server)

Saturday, April 28th, 2007

54 Part I . SUSE Linux Basics Connecting Commands and Redirecting Input and Output Unix and Linux commands are designed with a KISS (Keep It Simple, Stupid) philosophy. Some operating systems feature thousands of specialized commands that perform many specific, but similar, tasks. Unix and Linux take the opposite approach, providing many small, simple commands that you can combine to perform complex tasks. For example, some operating systems might provide a specialized command to print a listing of the current directory. On a Linux system, you would perform this task by combining the existing list (ls) and print (lpr) commands into a single sequence of commands in which the output of the ls command was provided as input to the lpr command by connecting the two commands using a special symbol known as a pipe (|), as in the following example: ls | lpr Linux shells provide this capability by connecting the output from one command to the input expected by another. In Linux terms, this is connecting the standard output from one command to the standard input of another. The pipe symbol automatically ties the two commands together and sends the output of the first to the second as input. Linux actually provides two different ways of specifying that the output of one command is the input to another by using a pipe to connect the two commands, or by what is known as redirecting IO, which stands for redirecting input/output. The output of a file can also be redirected to a file, using the greater than sign (>), which simply creates a file containing the output of the command, as in the following example: ls > listing.out This command takes the output of the ls command and sends it to the file listing.out. Linux supports combining commands and redirecting input and output by recognizing three different aspects of program input and output: . stdin The standard input stream that is read from by a program . stdout The standard output stream to which program output is sent . stderr A specialized output stream known as standard error to which program error messages are written You will encounter these terms as you become more familiar with executing shell commands because these are the cornerstones of creating complex commands by stringing together simple ones. Like the regular expressions discussed in the previous section, redirecting input and output is an extremely powerful feature of most
Note: If you are looking for cheap webhost to host and run your apache application check Vision jboss web hosting services

Web hosting domains - Chapter 2 . Linux Fundamentals 53 . file1

Saturday, April 28th, 2007

Chapter 2 . Linux Fundamentals 53 . file1 . file1.doc . file2 . file2.doc . file3 . file3.txt . file8 . other_file.doc Given this list of files, Table 2-1 shows how you can use wildcards, ranges of values, and lists to match specific files. As you ll see later in this chapter, pattern matching is especially useful when listing filenames and directory names that match specific patterns. Table 2-1 Pattern Matching in Linux Shells Pattern Matching Filenames * file1, file1.doc, file2, file2.doc, file3, file3.txt, file8, other_file.doc file? file1, file2, file3, file8 *.doc file1.doc, file2.doc, other_file.doc file?.doc file1.doc, file2.doc file?.* file1.doc, file2.doc, file3.txt file[1-3] file1, file2, file3 file{1,3} file1, file3 file{1,3}.{doc,txt} file1.doc, file3.txt Note As explained later in this chapter, in the section Listing Files, Unix and Linux systems do not list files that begin with a period by default. Therefore, the wildcard * will match only all visible files in a directory (files whose names do not begin with a period), even though the * matches the period in the middle of a filename.
Note: If you are looking for high quality webhost to host and run your jsp application check Vision florida web design services