Inside Linux As an alternative, (Web hosting service) you can use

Inside Linux As an alternative, you can use the command less. Most people, including me, will tell you that less is more than more. Here is the syntax for less: less [options] files The syntax is the same, but the options available for less significantly dwarf more. The options and commands available for less could span pages in a book. Be sure to check the man page for more on less. Another command that can be used to view a file is head. We have seen this command in a previous section in this chapter. Here is the syntax: head [options] files There is one caveat: head is primarily used to view the first few lines in a file, the default being 10 lines. The fact remains, though, that it is a command to view a file. You can, however, use the -c or -n options to control the number of lines in a file. The following is an example of head: stimpy $ head -5000 install.txt This example will print the first 5,000 lines from the file install.txt. Alternatively, you can do this: stimpy $ head -c 5k install.txt This example duplicates the previous example. The k refers to 1KB blocks. Another command that displays the contents of a file is cat. The one drawback to cat is that text will scroll up off the screen if the file contains more lines that the screen has. The syntax for cat is as follows: cat [options] files The cat command (concatenation) is useful when you want to append data to a file. See the man page for additional information. Copying Files You will find it necessary to copy a file from one directory to another. Alternatively, you might want to duplicate a file. The cp (copy) command is used to copy a file to another. The syntax for cp follows: cp [options] file1 file2 cp [options] files directory The first form copies file1 to file2. Be careful: If file2 exists, it will be overwritten. If the destination is a directory, the source file(s) are copied to the directory, and the source file(s) retain their names. Moving Files From time to time, you will need to move a file from one location to another. The mv (move) command is used to move a file to another location. The syntax for mv follows: mv [options] source target The mv command moves source to target. Be careful: If target exists, it will be overwritten. The mv command can be useful if you want to rename a file. The following dialog demonstrates the use of mv: stimpy $ cd ~ stimpy $ ls names.txt stimpy $ mv names.txt .. stimpy $ ls stimpy $ ls .. names.txt stimpy $ mv ../names.txt . stimpy $ ls names.txt stimpy $ mv names.txt names stimpy $ ls names stimpy $ The first example moves the file to the current directory’s parent. That fact is verified by the ls command. The next example moves the file from the parent directory back to the current directory. The last example demonstrates using the mv command to rename a file. The mv command can also be used on directories. Use the command as you would on files. If the source is a directory and the target is an existing directory, the source is moved as a subdirectory of target. When mv is used on a directory, the directory and its complete contents are moved, too. page 59
Note: If you are looking for cheap webhost to host and run your apache application check Vision jboss web hosting services

Leave a Reply