Sei sulla pagina 1di 53

Contents

cat --- for creating and d isplaying short files


y

chmod --- change permissions


y

cd --- change d irectory


y

cp --- for copying files


y

date---di spl aydate


y

echo ---echo argument


y

ftp --- connect to a remote machine todownload or upload files


y

grep --- search file


y

head ---display first part of file


y

ls --- see what files you have


y

lpr --- standard print command (see also print)


y

more --- use to read files


y

mkdir --- create d irectory


y

mv --- for moving and renaming files


y

ncftp ---especially good fordownloading files via anonymous ftp.


y

print --- custom print command (see also lpr)


y

pwd --- find out whatdirectory you are in


y

rm --- remove a file


y

rmdir --- remove d irectory


y

rsh --- remote shell


y

setenv --- set anenvironment variable


y

sort --- sort file


y

tail ---display last part of file


y

tar --- create an archive, add orextract files

telnet --- log in to another machine


wc – word count, char lines

green verde
blue azul
<control-D>
%
<control-D>stands for "hold the control key down, then tap 'd'". The symbol> tells
the computer
that what is typed is to be putinto the filedict. To view a file we usecat in a different
way:
% cat dict
red rojo
green verde
blue azul
%
If we wish to add text to anexisting file we d o this:
% cat >>dict
white blanco
black negro
<control-D>
%
Now suppose that we have another filetmp that looks like this:
% cat tmp
cat gato
dog perro
%
Then we can joindict and tmp like this:
% cat dict tmp >dict2
We could check the number of lines in the new file like this:
% wc -l dict2
8The commandwc counts things --- the number of characters, words, and line in a
file.
chmod
This command is used to change the permissions of a file or directory. For
example to make a
fileessay.001 readable by everyone, we do this:
% chmod a+r essay.001
To make a file, e.g., a shell scriptmycommand executable, we do this
% chmod +x mycommand
Now we can runmycommand as a command

To check the permissions of a file, use ls -l . For more information onchmod, use
man chmod.
cd
Usecd to change directory. Usepwd to see what directory you are in.
% cd english
% pwd
% /u/ma/jeremy/english
% ls
novel poems
% cd novel
% pwd
% /u/ma/jeremy/english/novel
% ls
ch1 ch2 ch3 journal scrapbook
% cd ..
% pwd
% /u/ma/jeremy/english
% cd poems
% cd
% /u/ma/jeremy
Jeremy began in his home directory, then went to his english subdirectory. He listed
this
directory usingls , found that it contained two entries, both of which happen to be
diretories. He
cd'd to the diretorynovel, and found that he had gotten only as far as chapter 3 in
his writing.
Then he used cd .. to jump back one level. If had wanted to jump back one level,
then go to
poemshe could have said cd ../poems. Finally he usedcd with no argument to jump
back to his
home directory.
cp
Use cp to copy files ordirectories.
% cp foo foo.2
This makes a copy of the file foo.
% cp ~/poems/jabber .
This copies the file jabber in the directory poems to the current directory. The
symbol "." stands
for the current directory. The symbol "~" stands for the home directory.
date
Use this command to check the d ate and time

% date
Fri Jan 6 08:52:42 MST 1995
echo
Theecho command echoes its arguments. Here are some examples:
% echo this
this
% echo $EDITOR
/usr/local/bin/emacs
% echo $PRINTER
b129lab1
Things likePRINTER are so-called environment variables. This one stores the name of the
default
printer --- the one that print jobs will go to unless you take some action to change things. The
dollar sign before an environment variable is needed to get the value in the variable. Try the
following to verify this:
% echo PRINTER
PRINTER

ftp
Useftp to connect to a remote machine, then upload or download files. See
also:ncftp
Example 1: We'll connect to the machinefubar. net, then change director tomystuff,
then
download the filehomework11:
% ftp solitude
Connected to fubar.net.
220 fubar.net FTP server (Version wu-2.4(11) Mon Apr 18 17:26:33 MDT
1994) ready.
Name (solitude:carlson):jeremy
331Password required for jeremy.
Password:
230 User jeremy logged in.
ftp> cd mystuff
250 CWD command successful.
ftp> get homework11
ftp> quit
Example 2: We'll connect to the machinefubar. net, then change director tomystuff,
then
upload the filecollected-letters:
% ftp solitude
Connected to fubar.net.
220 fubar.net FTP server (Version wu-2.4(11) Mon Apr 18 17:26:33 MDT
1994) ready

Scribd

• Explore
• Community
Upload a Document
Top of Form

Search Books, Presentations, Business, Academics...

• Login

• atulsinghchouhan
o My Home
o View Public Profile
o My Documents
o My Collections
o Messages
o Settings
o Help
o Log Out

/ 43

View Mode

BookSlideshowScroll

Reading should be social! Post a message on your social networks to let others know
what you're reading. Select the sites below and start sharing.
Readcast Complete!

Click 'send' to Readcast!

Choose 'auto' to readcast without being prompted.

atulsinghcho...

Add a Comment

Submit

Share & Embed

Link / URL:
Embed:

• Width: Auto
• Height:

• Start on page:

• View:

Download this Document for Free


Re: what is Normalization means..?
Answer
#2
Normalization is a series of steps followed to
obtain a
database design that allows for consistent
storage and
efficient acess of data in a relational
database.
These steps reduce data redundancy and risk of
data
becoming inconsistent.
there are 5 types of normal forms(NF) :
1 NF , 2NF, 3NF, 4NF, 5NF
1NF:- A relation is said to be in first normal
form , if it
dows not contain any repeating groups or
elements (or) if
all the values are atomic
2 NF:- A relation is said to be in Second
Normal form, if
and only if it is in 1 NF and all the non-key
attributes
are fully functionally dependent on the primary
key.
3 NF:- A relation is said to be in 3rd normal
form, if and
only if it is in 2NF and every non-key
attribute is
non-transitively dependent on the primary key.
(or) every attribute is independent of all the
other non-
key attributes.
BCNF:- A relation is said to be in BCNF, if
every attribute
on which some other attribute is also a
candidate for
primary key of a relation.
4 NF:- A relation is said to be in 4th normal
form, if and
only if it is in 3NF and it should not contain
any
multivalued dependencies.
5 NF :-A relation is said to be in 5 NF , if
and only it it
is in 4 NF and every join dependency in R is
implied by the
candidate key.
Unix Command Summary
Seeeeeeeddeedede
For morocumntation on a comman, consult a goo book, or us th man pags.
Forxampl, for
mor information on, us th comman.
Contents
y
cat --- for crating anisplaying short fils
y
chmo
y
c
y
cp --- for copying fils
y
de
y
e
y
ftp --- connct to a rmot machin toownloa or uploa fils
y
grp --- sarch fil
y
ha
y
ls --- s what fils you hav
y
lpr --- stanar print comman (s also print)
y
mor
y
mkir --- cratirctory
y
mv --- for moving an rnaming fils
y
ncftp ---spcially goo forownloaing fils via anonymous ftp.
y
print --- custom print comman (s also lpr)
y
pw
y
rm --- rmov a fil
y
rmir --- rmovirctory
y
rsh --- rmot shll
y
stnv --- st annvironmnt variabl
y
sort --- sort fil
y
tail ---isplay last part of fil
y
tar --- crat an archiv, a orxtract fils
y
tlnt --- log in to anothr machin
y
wc --- count charactrs, wors, lins
c

%
red rojo

green verde
blue azul
<control-D>
%
<
that what is typed is to be put the file. To view a file we use in a different way:
%
red rojo
green verde
blue azul
%
I
%
white blanco
black negro
<control-D>
%
N
%
cat gato
dog perro
%
T
%
We could check the number of lines in the new file like this:
%
8
ch
This command is used to change the permissions of a file or directory. For example
to make a
file readable by everyone, we do this:
%
To make a file, e.g., a shell script executable, we do this
%
N

To check the permissions of a file, use ls -l . For more information onchmod, use man
chmod.
cd
Usecd to change directory. Usepwd to see what directory you are in.
% cd english
% pwd
% /u/ma/jeremy/english
% ls
novel poems
% cd novel
% pwd
% /u/ma/jeremy/english/novel
% ls
ch1 ch2 ch3 journal scrapbook
% cd ..
% pwd
% /u/ma/jeremy/english
% cd poems
% cd
% /u/ma/jeremy
Jeremy began in his home directory, then went to his english subdirectory. He listed
this
directory usingls , found that it contained two entries, both of which happen to be
diretories. He
cd'd to the diretorynovel, and found that he had gotten only as far as chapter 3 in his
writing.
Then he used cd .. to jump back one level. If had wanted to jump back one level,
then go to
poemshe could have said cd ../poems. Finally he usedcd with no argument to jump
back to his
home directory.
cp
Use cp to copy files ordirectories.
% cp foo foo.2
This makes a copy of the file foo.
% cp ~/poems/jabber .
This copies the file jabber in the directory poems to the current directory. The
symbol "." stands
for the current directory. The symbol "~" stands for the home directory.
date
Use this command to check the d ate and time.

% date
Fri Jan 6 08:52:42 MST 1995
echo
Theecho command echoes its arguments. Here are some examples:
% echo this
this
% echo $EDITOR
/usr/local/bin/emacs
% echo $PRINTER
b129lab1
Things likePRINTER are so-called environment variables. This one stores the name of
the default
printer --- the one that print jobs will go to unless you take some action to change
things. The
dollar sign before an environment variable is needed to get the value in the variable.
Try the
following to verify this:
% echo PRINTER
PRINTER

ftp
Useftp to connect to a remote machine, then upload or download files. See also:ncftp
Example 1: We'll connect to the machinefubar. net, then change director tomystuff,
then
download the filehomework11:
% ftp solitude
Connected to fubar.net.
220 fubar.net FTP server (Version wu-2.4(11) Mon Apr 18 17:26:33 MDT
1994) ready.
Name (solitude:carlson):jeremy
331Password required for jeremy.
assword:
P

230 User jeremy logged in.


ftp> cd mystuff
250 CWD command successful.
ftp> get homework11
ftp> quit
Example 2: We'll connect to the machinefubar. net, then change director tomystuff,
then
upload the filecollected-letters:
% ftp solitude
Connected to fubar.net.
220 fubar.net FTP server (Version wu-2.4(11) Mon Apr 18 17:26:33 MDT
1994) ready.

Name (solitude:carlson):jeremy
331Password required for jeremy.
assword:
P

230 User jeremy logged in.


ftp> cd mystuff
250 CWD command successful.
ftp> put collected-letters
ftp> quit
The ftp program sends files in ascii (text) format unless you specify binary mode:
ftp> binary
ftp> put foo
ftp> ascii
ftp> get bar
The file foo was transferred in binary mode, the file bar was transferred in ascii mode.
grep
Use this command to search for information in a file or files. For example, suppose
that we have
a filedict whose contents are
red rojo
green verde
blue azul
white blanco
black negro
Then we can look up items in our file like this;
% grep red dict
red rojo
% grep blanco dict
white blanco
% grep brown dict
%
Notice that no output was returned by grep brown. This is because "brown" is not in our
dictionary file.
Grep can also be combined with other commands. For example, if one had a file of
phone
numbers named "ph", one entry per line, then the following command would give an
alphabetical
list of all persons whose name contains the string "Fred".
% grep Fred ph | sort
Alpha, Fred: 333-6565
Beta, Freddie: 656-0099
Frederickson, Molly: 444-0981
Gamma, Fred-George: 111-7676
Zeta, Frederick: 431-0987

The symbol "|" is called "pipe." It pipes the output of the grep command into the input of the
sort
command.
For more information ongrep, consult
% man grep
head
Use this command to look at the head of a file. For example,
% head essay.001
displays the first 10 lines of the fileessay.001 To see a specific number of lines, do
this:
% head -n 20 essay.001
Thisdisplays the first 20 lines of the file.
ls
Usels to see what files you have. Your files are kept in something called a directory.
% ls
foo
letter2
foobar
letter3
letter1
maple-assignment1
%
Note that you have six files. There are some useful variants of thels command:
% ls l*
letter1 letter2 letter3
%
Note what happened: all the files whose name begins with "l" are listed. The asterisk
(*) is the "
wildcard" character. It matches any string.
lpr
This is the standard Unix command for printing a file. It stands for the ancient "line
printer." See
% man lpr
for information on how it works. Seepr int for information on our local intelligent
print
command.
mkdir
Use this command to create adirectory.
% mkdir essays
To get "into" thisdirectory,do
% cd essays
To see what files are inessays,do this:
% ls
There shouldn't be any files there yet, since you just made it. To create files, seecato
r emacs.
more
More is a command used to read text files. For example, we could do this:
% more poems
The effect of this to let you read the file "poems ". It probably will not fit in one
screen, so you
need to know how to "turn pages". Here are the basic commands:
y
q --- quit more
y
spacebar --- read next page
y
return key --- read next line
y
b --- go back one page
For still more information, use the commandman mo re.
mv
Use this command to change the name of file and directories.
% mv foo foobar
The file that was namedfoo is now namedfoobar

nt
Use for anonymous ftp --- that means you don't have to have a password.
%
Connected to ftp.fubar.net
>

The file is downloaded from the machine.


p
T
%
%
%

%
an ra th mssagisplay.o print on a spcific printr,o this:
%
%
%
T
%
pw
Us this comman to fin out whatirctory you ar working in.
%
/u/ma/jeremy
%
%
/u/ma/jeremy/homework
%
assign-1 assign-2 assign-3
%
%
/u/ma/jeremy
%
J
subdirectory. Cd means " change directory". He used pwd to check to make sure he
was in the
right place, then used to see if all his homework files were there. (They were). Then
he
back to his home directory.
rm
Us to rmov fils from yourirctory.
%
remove foo?
%

%
The first command removed a single file. The second command was intended to
remove all files
beginning with the string "letter." However, our user (eremy?) decided not to
remove letter3.
rmdir
Use this command to remove a directory. For example, to remove a directory called
"essays", do
this:
A
rs

%
connects you to the machine. This is one of our public workstations and is fairly fast.
See also:telnet
setenv
%
labprinter
%
%
myprinter
sort
Us this commman to sort a fil. Forxampl, suppos w hav a fil with contnts
red rojo
green verde
blue azul
white blanco
black negro
T
%
black negro
blue azul
green verde
red rojo
white blanco
HT
%
Y
tai
Use this command to look at the tail of a file. For example,
%
displays the last 10 lines of the file To see a specific number of lines, do this:
%
T
tar
Use create compressed archives of directories and files, and also to extract
directories and files
from an archive. Example:
%
displays the file names in the compressed archive while
%
eee
tenet
Use this command to log in to another machine from the machine you are currently
working on.
For example, to log in to the machine "solitude", do this:
%
See also:r sh.
wc
Use this command to count the number of characters, words, and lines in a file.
Suppose, for
example, that we have a file with contents
red rojo
green verde
blue azul
white blanco
black negro
T
%
5
10
56 tmp
This shows that has 5 lines, 10 words, and 56 characters.
The word count command has several options, as illustrated below:
%
5 tmp
%
10 tmp
%
56 tmp
dummy
Under construction
back to top of misc commans
back to top of pag
File Managementommands.
cat,cd, cp, file,head,tail, ln,ls,mkdir,more,mv, pwd, rcp,rm, rmdir, wc.
Pw
pwd command will print your home directory on screen, pwd means print working
directory.
/u0/ssb/sandeep
is output for th comman whn us
L
ls command is most widely used command and it displays the contents of directory.
options
y
ls will list all th fils in your homirctory, this comman has many options.
y
ls -l will list all th fil nams, prmissions, group,tc in long format.
y
ls -a will list all th fils incluing hin fils that start with . .
y
ls -lt will list all fils nams bas on th tim of cration, nwr fils bring first.
y
ls -Fxwill list fils anirctory nams will b follow by slash.
y
ls -Rwill lists all th fils an fils in th all thirctoris, rcursivly.
y
ls -R | mor
Mk
mkdir sandeep will create new directory, i.e. here sandeep directory is created.
C
cd sandeep will change directory from current directory to sandeep directory.

Use pwd to check your current directory and ls to see if sandeep directory is there or
not.
You can then use cd sandeep to change the directory to this new directory.
Cat comman
cat cal.txt cat commanisplays th contnts of a fil hr on scrn (or stanar out).
H
head filename by default will display the first 10 lines of a file.
If you want first 50 lines you can use head -50 filename or for 37 lines head -37
filename and so
forth.
T
tail filename by default will display the last 10 lines of a file.
If you want last 50 lines then you can use tail -50 filename.
M
spacebar. For example if you have a file which is 500 lines and you want to read it
all. So you
can use
more filename
W
wc command counts the characters, words or lines in a file depending upon the
option.
Options
y
wc -l filnam
y
wc -w filnam
y
wc -c filnam

F
File command displays about the contents of a given file, whether it is a text (scii) or
binary
file. To use it type
file filename. For example I have cal.txt which has ascii characters about calander of
current
month and I have resume1.doc file which is a binariy file in microsoft word. I will get
file resume.doc
resume1.doc:
data
fil cal.txt
cal.txt:
ascii text
C
cp command copies a file. If I want to copy a file named oldfile in a current directory
to a file
named newfile in a current directory.
cp oldfile newfile
If I want to copy oldfile to other directory for example /tmp then
cp oldfile /tmp/newfile. Useful options available with cp are . -p options preserves
the
modification time and permissions, -r recursively copy a directory and its files,
duplicating the
tree structure.
R
rcp command will copy files between two unix systems and works just like cp
command (-p and
-i options too).
For example you are on a unix system that is called and want to copy a file which is
in
current directory to a system that is called in directory then you can use rcp
command
rcp filename lion:/usr/john
You will also need permissions between the two machines. For more infor type man
rcpat
command line.
Mv
mv command is used to move a file from one directory to another directory or to
rename a file.
S
y
mv olfil nwfil
y
mv -i olfil nwfil
y
mv -f olfil nwfil

y
mv * /usr/bajwa/ will mov all th fils in currntirctory to /usr/bajwairctory.
L
Instead of copying you can also make links to existing files using ln command.
If you want to create a link to a file called coolfile in /usr/local/bin directory then you
can enter
this command.
ln mycoolfile /usr/local/bin/coolfile
S
y
ln -s filon filtwo will crat a symbolic link an canxist across machins.
y
ln -n option will not ovrwritxisting fils.
y
ln -f will forc th link to occur.
R
To delete files use rm command.
Options:
y
rm olfil
y
rm -f option will rmov writ-protct fils without prompting.
y
rm -r option willlt thntirirctory as wll as all th subirctoris, vryangrous
comman.
R
rmdir command will remove directory or directories if a directory is empty.
Options:
y
rm -rirctory_nam
y
rmir sanp is how you us it to rmov sanpirctory.
y
rmir -p will rmovirctoris an any parntirctoris that armpty.
y
rmir -s will supprss stanarrror mssags caus by -p.
back to top of Fil managmnt commans

back to top of pag


C
diff,dircmp, cmp, grep, find.
D
diff command will compare the two files and print out the differences between.
Here I have two ascii text files. fileone and file two.
Ctt
This is first file
this is second line
this is third line
this is different
as;lkdjf
this is not different
f
This is first file
this is second line
this is third line
this is different
xxxxxxxas;lkdjf
this is not different
deee
4c4
< this is different
as;lkdjf
---
>

xxxxxxxas;lkdjf
C
cmp command compares the two files. For exmaple I have two different files fileone
and filetwo.
cmp fileone filetwo will give me
fileone filetwo differ: char 80, line 4
if run cmp comman on similar fils nothing is rturn.
-s comman can b us to rturnxit cos. i.. rturn 0 if fils ar intical, 1 if fils ariffrnt, 2 if
fils ar inaccssibl.

T
cmp -s filon fil1 &&cho 'no changs'.
no changes
D
dircmp command compares two directories. If i have two directories in my home
directory
named
dd
dircmp dirone dirtwo will return this
Dec9 16:06 1997dirone only and dirtwo onlyage 1
./cal.txt
./fourth.txt
./dohazaar.txt
./rmt.txt
./four.txt
./te.txt
./junk.txt
./third.txt
./test.txt
G
grep command is the most useful search command. You can use it to find processes
running on
system, to find a pattern in a file, etc. It can be used to search one or more files to
match an
expression.
It can also be used in conjunction with other commands as in this following example,
output of
ps command is passed to grep command, here it means search all processes in
system and find
the pattern.
ps -ef | grep sleep will display all the sleep processes running in the system as
follows.
ops 12964 258530 16:12:24 ttyAE/AAES0:00 sleep 60
dxi 12974 156400 16:12:25 ttyAH/AAH
0:00 sleep 60
ops 12941 256880 16:12:21 ttyAE/AAEt0:00 sleep 60
ops 12847 258120 16:11:59 ttyAH/AAH60:00 sleep 60
ops 12894 258340 16:12:12 ttyAE/AAEX0:00 sleep 60
dxi 13067 272532 16:12:48 ttyAE/ABEY0:00 sleep 1
ops 13046 257610 16:12:44 ttyAE/AAE00:00 sleep 60
dxi 12956 130780 16:12:23 ttyAG/AAG+0:00 sleep 60
ops 12965 257370 16:12:24 ttyAE/AAEp0:00 sleep 60
ops 12989 257780 16:12:28 ttyAH/AAHv0:00 sleep 60
ssb 13069 267582 16:12:49 ttyAH/AAHs0:00 grep sleep
pjk 2704933530 15:20:23 ?
0:00 sleep 3600
Options:
y
-b option will prcach lin with its block numbr.
y
-c option will only print th count of match lins.
y
-i ignors upprcas an lowrcasistinctions.
y
-l lists filnams but not match lins.

other associated commands with are and. egrep typically runs faster. for more
information type man egrepor man fgrep in your system.
F

find $HOE -print will lists all files in your home directory.
find /work -name chapter1 -print will list all files named chapter1 in /work directory.
find / -type d -name 'man*' -print will list all manpage directories.
find / -size 0 -ok rm {} \; will remove all empty files on system.
conditions of find
y
--
y
--
y
-
can us it with cpio comman.
y
-
y
-
y
-
y
-
y
-
y
-
or nam pip, symbolic link, or plain fil.
back to top of misc commans
back to top of pag
Textroessing
cut,paste, sort, uniq,awk,sed,vi.

Ct
cut command selects a list of columns or fields from one or more files.
Option -c is for columns and -f for fields. It is entered as
cut [files]
for example if a file named testfile contains
this is firstline
this is secondline
this is thirdline
E
cut -c1,4 tstfil

I
Options:
y
-c
y
-f
y
-scoul b us w ith -f to supprss lins withoutlimitrs.
P
paste command merge the lines of one or more files into vertical columns separated
by a tab.
for example if a file named testfile contains
this is firstline
an a fil nam tstfil2 contains
this is testfile2
thn running this comman
past tstfil tstfil2 > outputfil
will put this into outputfil
this is firstline
this is testfile2
it contains contnts of both fils in columns.
who |aste
Options:
y
-'char' sparat columns with char insta of a tab.
y
-s mrg subsqunt lins from on fil.

S
sort command sort the lines of a file or files, in alphabetical order. for example if you
have a file
named testfile with these contents
zzz
aaa
1234
yuer
wer
qww
wwe
T
sort tstfil
will giv us output of
1234
aaa
qww
wer
wwe
yuer
zzz
Options:
y
-b ignors laing spacs an tabs.
y
-c chcks whthr fils ar alray sort.
y
-
y
-i ignors non-printing charactrs.
y
-n sorts in arithmtic orr.
y
-o
y
+m[-m] skips n fils bfor sorting, an sort upto fil position m.
y
-r rvrs th orr of sort.
y
-u intical lins in input fil apar only on tim in output.
U
uniq command removes duplicate adjacent lines from sorted file while sending one
copy of each
second file.
Examples
sormes | uiq -d
Options:
y
-c printach lin onc, counting instancs ofach.
y
-

y
-u print only uniqu lins.
A
awk is more like a scripting language builtin on all unix systems.lthough mostly used
for text
processing, etc.
Here are some examples which are connected with other commands.
Exa
df - | ' {o $2 "ol" {oo$1 {pri (o12)/1'
give total space in your system in megabytes.
Here the output of command df -t is being passed into awk which is counting the
field 1 after
pattern "total" appears. Same way if you change $1 to $4 it will accumulate and
display the
addition of field 4
which is used space.
for more information about awk and nawk command in your system enter man awk
orman
nawk.
S
sed command launches a stream line editor which you can use at command line.
you can enter your sed commands in a file and then using -f option edit your text
file. It works as
sed [options] files
options:
y
- 'instruction' Apply thiting instruction to th fils.
y
-f
y
-n supprssfault output.
for mor information about s,ntr man s
V
vi command launches a vi sual editor. To edit a file type
vi
vi editor is a default editor of all Unix systems. It has several modes. In order to
write characters
you will need to hit to be in insert mode and then start typing.ake sure that your
terminal has
correct settings, vt100 emulation works good if you are logged in using pc.
Once you are done typing then to be in command mode where you can write/search/
you need to
hit :w filename to write

and in case you are done writing and want to exit


:w! will write and exit.
options:
y
i for insrt mo.
o
o
o
o
o
y
: for comman mo.
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
y
/string to sarch string in fil.
y
n to sarch for nxt occurnc of string.
back to top ofxt procssing commans
back to top of pag
Shell androgramming
Seee eeeeee

S
Shell programming is integral part of Unix operating systems. Shell is command line
userinterface to Unix operating system, User have an option of picking an interface
on Unix such
as ksh, csh, or default sh., these are called shells(interface). Shell programming is
used to
automate many tasks. Shell programming is not a programming language in the
truest sense of
word since it is not compiled but rather an interpreted language. Unix was written in
C language
and thus c language is integral part of unix and available on all versions. Shells, like
ksh and csh
are popular shells on unix although there are 5 or 6 different shells available but I
will only be
discussing ksh and csh as well as sh. Common features among all shells are job
control, for
example if I am running a processes which is searching the whole system for .Z files
and output
is directed to a file named compressedfiles.
example:
y
fin / -nam *.Z -print > comprssfils
thn aftrntring this comman hitting
y
<
ky will suspn this job, thnntring
y
bg
at comman lin will put this job in backgroun,ntring
y
fg
will put this job in forgroun.ntring
y
jobs
at comman lin will show m all my concurrnt jobs that ar running.
O
o
o
o
o
cpio,tc.
o
o
o
lttrs
o
will match singl charactrs in a fil.
o
o
o
o
o
o
that shll)
o
o
o

o
o
o
o
B
sh or Bourne shell is default shell of Unix operating systems and is the most simplest
shell in
Unix systems.
E
y
c; ls
y
(f
logfil.
y
sortile | l
y
alias [otions] [name[='ommand']]
o
y
let
o
eeed
y
for x[in list]
y
functioncommans;} is th syntax of a function which can b call from anywhr in
program.
y
i then eli then elsei
K
Ksh or Korn shell is widely used shell.
C
csh is second most used shell.
E
echo command in shell programming.
L
line command in shell programming.
S
sleep command in shell programming.
Tt
test command in shell programming.
CC
Since Unix is itself written in C programming language, most Unix operating systems
come with
c compiler called cc.
back to top ofhll programming.
back to top of pag
C
cu,ftp,login, rlogin,talk,tlnt, vacationan writ
C
cu command is used for communications over a modem or direct line with another
Unix system.
Syntax is
cu
O
y
-b

y
-c
y
-
y
-
y
-l
y
-n prompts for a tlphon numbr.
y
-s
Dstination
y
tlno is th tlphon numbr of th mom to connct to.
y
systm is call th systm known to uucp.
y
aar is an arss spcific to LA.
F
ftp command is used to execute ftp protocol using which files are transferred over
two systems.
Syntax is
ftp
options
y
-
y
-g
y
-i turn off intractiv prompts.
y
-v vrbos on. show all rsponss from rmot srvr.

Lg
login command invokes a login session to a Unix system, which then authenticates
the login to a
system. System prompts you to enter userid and password.
Rg
rlogin command is used to log on to remote Unix systems, user must have
permissions on both
systems as well as same userid, or an id defined in .rhosts file. Syntax is
rlogin

options
y
-8 will allow 8 bitata to pass, insta of 7-bitata.
y
-
y
-l
Tk
talk command is used to invoke talk program available on all unix system which lets
two users
exchange information back and forth in real time. Syntax is
talk userid@hostname
Tt
Telnet command invokes a telnet protocol which lets you log on to different unix,
vms or any
machine connected over TCP/IP protocol, IPx protocol or otherwise. Syntax is
telnet hostname
V
vacation command is used when you are out of office. It returns a mail message to
sender
announcing that you are on vacation. to disable this feature, type .
syntax is
vacation
O
y
-
y
-F
y
-l
y
-m
W
write
Storageommands
comprss uncomprss, cpio,ump,pack, tar, mt.
C
Compress command compresses a file and returns the original file with .z extension,
to
uncompress this.Z file useuncompress
command is
compress
O
y
-bn limit th numbr of bits in coing to n.
y
-c writ to stanar output (o not chang fils).
y
-f comprss conitionally,o not prompt bfor ovrwriting fils.
y
-v
U
Uncompress file uncompresses a file and return it to its original form.
syntax is
ucompress
O
y
-c writ to stanar output without changing fils
C
cpio command is useful to backup the file systems. It copy file archives in from or
out to tape or
disk, or to another location on the local machine. Its syntax is
cpio fls [opios]
I

y
cpio -i [options] [pattrns]
o
o
o
cpio -o
o
cpio -p
o
O
o
o
o
o
o
o
o
o
o
o
o
o
o
o
E
o
/v/rst8
o
o
D
dump command copies all the files in filesystem that have been changed after a
certain date. It is
good for incremental backups. This information about date is derived from
/var/adm/dumpdates
and /etc/fstab .
syntax for HP-UX dump is
/usr/sbin/dump [option [argument ...] filesystem]

O
y
0-9his numbr isump lvl. 0 option caussntir filsystm to bump.
y
b blocking factor takn into argumnt.
y
d dee dee
y
f plac thump on nxt argumnt fil insta of tap.
y
TET
spcifis that thnsity of th tap is 6250 B.
o
y
for mor info typ
P
pack command compacts each file and combine them together into a.z file. The
original
file is replaced. Pcat and unpack will restore packed files to their original form.
Syntax is
Pack
O
y
-
y
-f Forc th packvn whnisk spac isn't sav.
y
TP
pc
y
T
T
tar command creates an archive of files into a single file.
Tar copies and restore files to a tape or any storage media. Synopsis of tar is
tar [options] [ile]
Examples:
tar cvf /dev/rmt/0 /bin /usr/bin creates an archive of /bin and /usr/bin, and store on
the tape in
/dev/rmt0.
tar tvf /dev/rmt0 will list the tape's content in a /dev/rmt0 drive.
tar cvf - 'find . -print' > backup.tar will creates an archive of current directory and
store it in file
b
Functions:
y
c crats a nw tap.

y
r appn fils to a tap.
y
t print th nams of fils if thy ar stor on th tap.
y
xxtract fils from tap.
Options:
y
b n us blocking factor of n.
y
l printrror mssags about links not foun.
y
L follow symbolic links.
y
v print function lttr (x forxtraction or a for archiv) an nam of fils.
Mt
M

commands to tape device rather than tape itself.t command is BSD command and is
seldom
found in system V unix versions.
syntax is
mt [-t tapename] command [count]
mt for-UX accpt following commans
y
e
y
fsf Forwar spac count fils.
y
fsr Forwar spac count rcors.
y
bsf Backwar spac count fils.
y
bsr Backwar spac count rcors.
y
rwR w in tap .
y
offl Rwin tap an go offlin.
y
ed See ed dSd de
y
smk Writ count stmarks (DDrivs only).
y
fss Forwar spac count stmarks (DDrivs only).
y
bss Backwar spac count stmarks (DDrivs only).
y
E
o
o
System Status
at, chmod,chgrp, chown,crontab,date, df,du, env, finger, ps,ruptime, shutdwon,stty,
who.

A
at command along with crontab command is used to schedule jobs.
at
for example if I have a script named usersloggedin which contains.
#!/bin/ksh
who | wc -l
echo "are total number of people logged in at this time."
an want to run this script at 8:00 AM.o will first typ
usrsloggin %lt;ntr>
I
30
are total number of people logged in at this time.
O
y
-f
y
-m will sn mail to usr aftr job is complt.
y
-l will rport all jobs that ar schul an thir jobnumbrs.
y
-r
C
chmod command is used to change permissions on a file.
for example if I have a text file with calender in it called cal.txt.
initially when this file will be created the permissions for this file depends upon set in
your profile files.s you can see this file has 666 or -rw-rw-rw attributes.
ls -la cal.txt
-rw-rw-rw-
1 ssb
dxidev
135 Dec3 16:14 cal.txt
In this line above I have -rw-rw-rw- meaning respectively that

ttt
example Decimal 644 which is 110 100 100 in binary meand rw-r--r-- or user can
read,write this
file, group can read only, everyone else can read only. Similarly, if permissions are
755 or111
101 101 that means rwxr-xr-x or user can read, write and execute, group can read
and execute,
everyone else can read and execute.ll directories have d in front of permissions. So if
you don't
want anyone to see your files or to do anything with it use chmod command and
make

permissions so that only you can read and write to that file, i.e.
chmod 600 filename.
C
chgrp command is used to change the group of a file or directory.
You must own the file or be a superuser.
chgrp [options] newgroup
N
O
y
-h will chang th group on symbolic links.
y
-R rcursivlyscn throughirctory changing group of all fils an subirctoris.
C
chown command to change ownership of a file or directory to one or more users.
Syntax is
chown
O
y
-h will chang th ownr on symbolic links.
y
-R will rcursivlyscn through thirctory, incluing subirctoris an symbolic links.
Ct
crontab command is used to schedule jobs. You must have permission to run this
command by
unixdministrator.obs are scheduled in five numbers, as follows.
Minutes
0-59
Hour
0-23
Day of month
1-31
month
1-12
Day of week
0-6 (0 is sunday)
so forxampl you want to schul a job which runs from script nam backup_jobs in
/usr/local/bin
dedde eee
rprsnts all valus.
25 2215 * 0 /usr/local/bin/backup_jobs

T
S
crontab
crontab
D
Date displays todays date, to use it typedate at prompt.
Sun Dec7 14:23:08 EST 1997
is similar to what you shoul s on scrn.
D
df command displays information about mounted filesystems. It reports the number
of free disk
blocks. Typically a Disk block is 512 bytes (or 1/2 Kilobyte).
syntax is
df
O
y
-b will print only th numbr of fr blocks.
y
-
y
-f will rport fr blocks but not fr inos.
y
-F
y
-k will print allocation in kilobyts.
y
-l will rport only on local fil systms.
y
-n will print only th fil systm nam typ, with no argumnts it lists typ of all filsystms
D
du command displays disk usage.
En
env command displays all the variables.

Fg
finger command.
P
ps command is probably the most useful command for systems administrators. It
reports
information on active processes.
ps
options.
y
-a Lists all procsss in systmxcpt procsss not attach to trminals.
y
-
y
-f Lists a full listing.
y
-j print procss groupD an sssionD.
R
ruptime command tells the status of local networked machines.
ruptime
options.
y
-a inclu usrvn if thy'v bn il for mor than on hour.
y
-l sort by loa avrag.
y
-r rvrs th sort orr.
y
-t sort by uptim.
y
-i sort by numbr of usrs.
S
Shutdown command can only be executed by root. To gracefully bring down a
system, shutdown
command is used.
options.
y
-gn us a grac-prio of n scons (fault is 60).
y
-ik tll th init comman to plac systm in a stat k.
o
o
o

o
o
y
-y supprss thfault prompt for confirmation.
S
stty command sets terminal input output options for the current terminal. without
options stty
reports terminal settings.
stty modes device
options
y
-a rport all options.
y
-g rport currnt sttings.
Mos
y
0 hang up phon.
y
n st trminal bau.
y
eeee
W
who command displays information about the current status of system.
who
Who as default prints login names of users currently logged in.
O
y
-a us all options.
y
-b Rport information about last rboot.
y
-
y
-
y
-p rport prviously spawn procsss.
y
-u rport trminal usag.
S
Teeone Intervie Questions

1.n your carr, what hav youon that you ar th most prou of?

2.What ar th spcific skill sts that you woul bring to this job?

3.Whato you think is th biggst challng facing_ _ ___ _ _ _ toay?

4.What must an organization provi in orr for you too your bst?

5.f you coul chang on thing in your last job (or prsnt job), what woul it b?

6.f wr to spak to your co-workrs, what woul thy say about you?

7.Why shoul consir you for this position?


Ff

1.Dscrib how you first bcam intrst in_ _ _ _ _ _ _ __ _ _ (whatvr fil of work).

2.iv m anxampl of som goals youv ha an how you achiv thm.

3.ll m about on of th toughst groups with which youv ha to work.What ma th group


tough? Whati youo?
4.What ar th biggstcisions youv ma in th past yar on th job?ll m how you ma
thm.
5.iv m anxampl of a tim youisagr with airctiv givn by your suprvisor.What

happn?

6.What givs you gratst joy in your work an why?

7.Dscrib a risk you took in a job.What was th rsult?

8.ll m about a tim in which your work was criticiz.What happn?owi you rspon?

9.What has bn your gratst frustration orisappointmnt in your prsnt job?Why?

10.What approachso you us in talking with popl who hav vryiffrnt prsonalitis or work
styls than your own?
11.What maks you angry in th workplac?

12.ow woul you st prioritis for this position?ow woul you spn your first six months?
13.Whato youxpct from ACU as yourmployr?
1. Step 1
What are your weaknesses?
You want to be honest here. Don't try to flip the question around or say something
stupid like "I work too much." Be honest! You know what your weaknesses are. Only
a confident person can confidently display their weaknesses. This will show how
honest you are and how well you will fit in the company culture.
2. Step 2
Run down your resume for me.
I have a great technique for this called the "resume line-by-line" technique. Open
two windows on your computer. On one, pull up your resume and the other pull up
the job description. Read the job description twice and now go back to your resume.
Now, line-by-line, go through you're resume and practice putting your skills in the
words that you just read in the job description. This way you will prep your mind to
think only in terms of the job description when answering the interviewer's
questions,
i.e. you will almost respond the way they want you to respond. Nice.
3. Step 3
Why do you want to work for our company?
You have to do your research! Follow the company's mission statement. Follow the
recent press releases. Find your passion. What's that one thing that you like in the
company? Besides money, benefits, or break-times. Do you like the people? The
talent? The background of the leadership? The company's responsibility to the
community? Understanding these things are what makes the interviewer go "wow,
this person is a great fit for our company."
Tye o Dimension
Conform Dimnsion

Conformed dimensions are either identical or strict mathematical subsets of the most
granular,
detailed dimension. Dimension tables are not conformed if the attributes are labeled
differently
or contain different values. Conformed dimensions come in several different flavors.t
the most
basic level, conformed dimensions mean the exact same thing with every possible
fact table to
which they are joined. The date dimension table connected to the sales facts is
identical to the
date dimension connected to the inventory facts.[1]
J
A
creating an abstract dimension, these flags and indicators are removed from the fact
table while
placing them into a useful dimensional framework.[2]
Dgnrat Dimnsion
A

Rol-laying Dimnsions
Dimensions are often recycled for multiple applications within the same database.
For instance, a
"Date" dimension can be used for "Date of Sale", as well as "Date of Delivery", or
"Date of
Hire". This is often referred to as a "role-playing dimension
w ww
dimesio
JA
to a separate sub dimension.
Degenerate Dimension: Keeping the control information on Fact table ex: Consider a
Dimension
table with fields like order number and order line number and have 1:1 relationship
with Fact
table, In this case this dimension is removed and the order information will be
directly stored in a
Fact table inorder eliminate unneccessary joins while retrieving order information..
Wff

A viw taks th output of a qury an maks it appar lik a virtual tabl an it can b us in plac
of
tabls.
A matrializ viw provis inirct accss to tablata by storing th rsults of a qury in a sparat
schma objct.
If- f f
Forign kys of facts tabls ar primary kys of Dimnsion tabls.t is clar that fact tabl
contains
columns which ar primary ky to othr tabl that itslf mak normal form tabl
W
A numbr of vry smallimnsions might b lump togthr to form a singlimnsion, a junk
deeeeeeedddee
dedeee de de
Ef I
B
eeee deed deee dee
I
warhous is th conglomrat of allata marts within thntrpris.nformation is always stor in
t
W
Seeeeedeee
eeedeeeeeeeee
primary ky is that it is uniqu forach row in th tabl.t is usful bcaus th natural primary
ky can
chang an this maks upats morifficult.urrogat kys ar always intgr or numrich
dede

Potrebbero piacerti anche