Thursday, 13 December 2012

More On Linux



Getting Help

      On line Manuals: There are on – line manuals which gives information about most commands. The manual pages tell you which options a particular command can take, and how each option modifies the behavior of the command. Type man command to read the manual page for a particular command.

         For example, to find out more about the wc ( word count ) command, type

                % man wc

Alternatively

          % whatis wc

Other Useful LINUX Commands

    Compress: This reduces the size of a file, thus freeing valuable disk space. For example, type

             % ls – l mystylepro.txt

And note the size of the file. Then to compress mystylepro.txt, type

                  % compress mystylepro.txt

This will compress the file and place it in a file called mystylepro.txt.Z
To see the change in size, type ls – l again.
To uncompress the file, use the uncompress command.

                 % uncompress mystylepro.txt.Z

gzip: This also compress a file, and is more efficient than compress. For example, to zip mystylepro.txt, type

           % gzip mystylepro.txt

This will zip the file and place it in a file called mystylepro.txt.gz
To unzip the file, use the gunzip command.

          % gunzip mystylepro.txt.gz

 File: File classifies the named files according to the type of data contain, for example ASCII (text), pictures, compressed data, etc. To report on all files in your home directory, type

            % file *

History: The C shell keeps an ordered list of all the commands that you have entered. Each command is given a number according to the order it was entered.

            % history (show command history list )

If you are using the C shell, you can use the exclamation character ( ! ) to recall commands easily.

               % !! ( recall last command )
                % ! – 3 ( recall third most recent command )
                % !5  (recall 5th command in list )
                % ! grep (recall last command starting with grep )

You can increase the size of the history buffer by typing
            % set history = 100

No comments:

Post a Comment