Sie sind auf Seite 1von 4

Date : 21 August, 2010

Module 1:
=========
Review Commands :
===========
ls , pwd , cd
touch , mkdir , rm , rmdir
cp, mv
cat, more, less, tail
su , exit
man , info

Module 2:
=========
env
How to add the PATH in env variable:
====================================
export PATH=$PATH:/usr/sbin:/sbin
env >>>>> It shows env information
env > /tmp/envoutput.txt
cat envoutput
env | more >>>> It shows the env information page by page
===============
ls /etc >>>>> It lists the .etc directory contents
ls .g* >>>>> It lists all files / directories starts from g
ls .g* | more >>>> It shows all the dir /files starts from "g" page by page

grep >>>> get regular expression


===================================
grep perry /etc/passwd >>>> It shows the perry in /etc/passwd file
grep bash /etc/passwd
grep 5 /etc/passwd
Grep all the user accounts starts from 5 in the system:
=========================================
grep 5.. /etc/paswd
grep 5[0-9][0-9] /etc/passwd
grep :5[0-9][0-9]: /etc/passwd
grep :[56][0-9][0-9]: /etc/passwd
Review:
=======
Environment variables ( env )
Redirection , Pipes
Wildcards
grep
Module 3:
=========
find / ( it starts search from / )
find / -name junk
find . ( it starts search from local directory . )
find . -name junk
find . -name '*.h' -exec diff -u '{}' /tmp/master ';'

locate: ( used for searching )


==============================
/etc/cron/daily ( slocate.cron )
slocate.db
which: ( used fr searching )
============================
which emacs
/usr/bin/emacs
whereis: ( used for getting teh summary of command )
====================================================
wheres emacs

Working with Text files :


=========================
sort >>>> It sorts the file sin Aplhabetical order
sort ncaa.txt
cat ncaa.txt | sort
cat ncaa.txt | sort > ncaa_sort.txt
cat ncaa.txt -o ncaa_sort.txt
info sort
nl: ( It shows the number of lines in a file )
===============================================
nl ncaa.txt
wc: ( wrd count )
==================
wc ncaa.txt
lines words bytes
tac: ( It shows the file in reverse order )
===========================================
tac ncaa.txt

cut : ( It shows the specific part of the file)


===============================================
cut -f3 testscores.txt >>>>> It shows the 3rd field in the file
cut -f1,3 testscores.txt >>> It shows the 1st and 3rd field of the file
cat /etc/passwd | cut -d: -f1,3

paste: ( used to join 2 files together )


========================================
paste animal.txt food.txt
paste -s animal.txt food.txt >>> It add the lines in second line ( -s = serial
)

fmt: ( format ) It formats the file in human readble


===============
fmt -u getty.txt > getty_fmt.txt
Review:
=======
find
locate , which , whereis
sort
cut, paste
nl, wc, tac
fmt
Modeule 4:
==========
Processes:
==========
Running version of program
Program:
========
Set of instructions

Das könnte Ihnen auch gefallen