Linux /? Help

Linux Newbie Help Area






Utilities


cat - list file content on screen

Format
cat [options] [file-list]

Summary
cat lists all the files specified by file-list to your screen end to end.

Options
-n number, causes cat to display line numbers at the beginning of each line.


echo - just that... an echo :)

Format
echo [option] message

Summary
Very useful in scripting, lets you write messages to the terminal and can be used to display shell variables

Options
-n newline, prevents echo from displaying the newline at the end of the message

Example
#echo 'Hi!'
Hi!
#echo -n 'Hi!'
Hi!#
#echo $TERM <-- this is a shell variable
vt100
#

grep - search for pattern in file

Format
grep [options] pattern [file-list]

Summary
This utility searches one or more files for a pattern. The grep utility performs actions, specified by options every time
it finds a line that contains a match for the pattern.
If you use tabs or spaces in the pattern you must quote it.

Options
if you don't specify any options grep displays the line that contained a match for pattern.
-c    count, causes grep to display the number of times it found a match for pattern
-i     ignore case, ignores case when finding a match for pattern
-l     file list, causes grep to display only the filename in which it found a match for pattern
-v    reverse test, causes lines not containing a match to satisfy the search

head - display the beginning (head) of a file

Format
head [-number] [file-list]

Summary
The head utility displays ,without arguments, the ten first lines of the files given by file-list. If you want to display more or less than 10 lines specify this with the -number option.
If you don't specify any file-list head will read from it's standard input. This means that you can pipe to it.

less - less is more, more is less

Summary
Similar to more but you can scroll backwards in the document too!


man - display the manual

Format
man [options] page

Summary
Man is the built in manual pager in Linux. It offers allot of flexibility, and I must admit that I don't know the man utillity as good as I should. The parameter page tells man what you want help for. Normally it is a command but you can also specify a utility, function or some config file you need help with. Use the interactive commands to navigate inside the document.

Options
There are ALLOT... use "man man" to find the apropriate one..

Interactive commands
/"argument"    Higlights all words that contain "argument".
q    quit, quits man.


more - list file on screen

Format
more [options] [file-list]

Summary
Allows you to view a text file at the terminal. Almost the same as cat, but it pauses each time it fills the screen. On pause, you can press ENTER to make more display one more line. If you press space more fills another screen. More will display all the files given in the file-list argument. If you don't give it the file-list argument, more will read from it's standard input.

Options
-n     number of lines, specifies the number of lines in a screenfull.
-d    display, makes more display a explanatory message after each screenful
+n    line number, makes more start at line number n.

Interactive commands
More has a lot of interesting commands that can be used whenever more pauses here is a list of the most commonly used
d shows half a screenful
q exits from more
v starts up the vi editor with the current document at the current line (very useful)

tail - display the last part (tail) of a file

Format
tail [options] [file]

Summary
This utility displays the last part of the file specified by file. If you don't specify a file it read's from it's standard input, this means that you can pipe to it.

Options
-n    lines, the number of lines from the en of the file you want tail to display.

tar - unpacks/packs files from/to file

Format
tar key[options] [file-list]

Summary
The tar utlility can extract, add to, list, and create tar volumes. It can also extract tar.gz/tgz archives.You can only have one key mode, but you can have multiple options. The tar utility has tons of options check them out in the manual (man tar)

Key
t    table of contents, displays all the files in the archive.
A    append, adds the files specified by file-list the archive.
c    create, creates a new archive
x    extract, extracts files from the archives given by file-list

Options
v    verbose, causes tar to display each line as it reads/writes them.
-V name    Create a volume with volumename NAME. Use this together with the key A
z    filter the archive through gzip. Use this when you have a tgz/tar.gz file.
-f file   input file, Unpack from archive "file" instead of the standard input which is /dev/rtm0 (tape streamer)


Table of contents





webmaster@webpromo-inc.com


© Linux /? Help - WebPromotions 2001 Company Ltd.