Home News Contact us Blog   Get Listed

Search for C,C++,DAA Programs. Send video songs to your loved ones.

 
Custom Search
   

Shaadi.com Matrimonials

 

Knowledge Base
Question Bank Home
Gift your mate
Write Reviews

 

 

Unix: Operating System - Page 7

Page1 || Page2 || Page3 || Page4 || Page5 || Page6 || Page7 || Page8
Page9 || Page10 || Page11
 

 

Who :
It is use to get information about all users who are currently logged into the system.
Syntax: Who
User name

Who am i :
User or is getting information about himself.
Syntax: WHO AM I

Echo :
It prints or echoes at the terminal whatever else user happens to type on the line.
Syntax: Echo ‘any line’

Tput clear :
To clear the screen and let the shell prompt appear at the top of the screen.
Syntax: Tput clear

Exit :
This command is use to terminate a program. The command is
generally run with a numeric argument. Syntax: Exit

Cal :
It comprehends and displays the entire calendar of any year from one A.D to 9999 A.D.
Syntax: $ Cal
Cal command displays the current date as well as the calendar (month proceeding current month itself and month following the current month)
Syntax: $ Cal <month><year>
This syntax displays that month’s calendar only.
 

Man :
It displays the UNIX manual pages on any specified command.
Syntax: $ MAN <any cmd>
Online manual displays all relevant information on UNIX
command and the option they support. The MAN files are not mere text files. We cannot CAT a MAN file. Instead a MAN is a complex program that searches and displays manual text from special files that contain text-processing codes. Some MAN pages also reveal bugs in certain commands. Each MAN page explains the use, syntax and switches available with each command.

GREP :
Grep is one of the most useful UNIX filters. It scans a file for the occurrence of a pattern, and can display the selected pattern, the line numbers in which they are found, or the filenames where the pattern occurs. Grep can also select lines containing the pattern.
Syntax : $ grep options patterns filename(s)
E.g. $ grep president emp.lst
OPTIONS :
-c (continuous occurrence) : the –c (count) options counts the occurrences.
-n (displaying line numbers : the –n (number) option can be used to display the line numbers containing the pattern, along the lines.
-v (deleting lines) : the –v (inverse) option selects all but the lines containing the pattern.

REGULAR EXPRESSIONS :
Regular expressions take care of some common query requirements. You may not be aware of the spelling of a name, but you may want the system to present a file of possible ones, so that you can select exactly the one you require. If any expression uses any of these characters, it is termed a regular expression.

               

Symbol   Significance
 *     Matches zero or more occurrences of previous character.
 .  Matches a single character.
[pqr] Matches a single character p, q or r.
[c1-c2]    Matches a single character within the ASCII range represented by c1 and c2.
[^pqr]   Matches a single character which is not a p, q or r.
^pat  Matches pattern pat as beginning of file.
Pat$   Matches pattern pat at end of line.

WC:
It is for counting total number of lines. Words and characters of information contained in the file. Syntax : WC name
Switches:
 - l: number of lines.
 - c: number of characters.
 - w: number of words.

Cmp:
It is use to comparing two files. It uses two file names as arguments and displays the difference on the terminal. Syntax: $ Cmp file1 file2
The two files are compared byte-by-byte and the location of the first mismatch is echoed to the string.
Switches:
      – l: list option gives a detailed list of byte number and differing bytes in octal for each character that differ in both the files.
                        

Previous    :   Next

© copyright 2008 created by www.citysuvidha.com