Sei sulla pagina 1di 12

Files ls -ltr ls -all ls -ltr more ==> show directory list screen at time ls -lt

r *xyz* ==> list all file id the directory where the name of ls -ltr wc -l ==> l
ist all files and wc -l is used to lsit count of the files ls -ltr > my_file.txt
==> output of th e list comand is directed to my_file.txt ls -ltr >> my_file.tx
t ==> outp ut of the list comand is appended to my_file.txt ls -ltr grep "13 Dec
" ==> sele ct all file where file date is dec 13 ls -ltr grep "Dec 13" ==> sele
ct all file where file date is dec 13 ls -ltr grep "1[29] Nov" ==> grep all file
s where date st arts with 1 and 2'nd charter is 2 or 9, so list all files ==> th
at have a dates of Nov 12 or Nov 19 ls -ltr grep -E "Nov (12 26 09)" ==> grep -E
, gr ep using extended expression. will list all files where date are ==> Nov 1
2 or 26 or 09 ls -allp ==> disp aly / after directory names ls -all grep mdmtm_e
ng grep 2011-03-04 ==> display all file tha t have mdmtm_eng and also have 201103-04 as part of the file name ls -ltr grep ctl wc -l ls -all grep -i <<file nam
e>> ==> grep -i beomes case incensit ive ls grep mdmtm_engyaustbatch grep 2011-1
1-10 grep zip xargs zgrep -l Level2 SettlementReconciliation wc -l ==>> count th
e number of zip files where thier date is 2011-11-10 and contai ns the string (S
ettlementLoader-loaders) ls -lrt ==>sorts by ascending creation t imestamp order
(-l =long (detailed) display ) ls -lt ==>sorts by descending creation timestamp
ram used to display the amount of available disk space for filesystems on which
the invoking user has appropriate read access. du -sm * ==> show the list of fi
le in MB sorted by size
du -sk * ==> shows the file usage for every file and directory beneath the curre
nt, or specified, directory. du -g ==> shows the subfolder size in megabyte s du
-sm <foldername> du /EAI sort -n ==> list all folder under /EAI sorted size fin
d . -size +50000
________________________________________________________________________________
____________________________________

Grep ____ grep grep


: grep "payment_ftp" *.log : grep "payment_ftp" *.log ==> search for all occuran
ce in the current dir for the "payment_ftp " phraze in all files that have a an
extensio of .log
echo *.log egrep
xargs grep INVPREP_ENW_
: egrep "support" myfile.txt search for pattern of "support" in the myfile.txt w
ill grep all 'eai_support' and 'GASB
egrep '(eai_support GASBB)' *.properties B' within the *.properties files
________________________________________________________________________________
__________________________________ * filter the current directory for (mdmtm_en
gyaustbatch and dated 2010-02-10 an d have an extension of .ctl ) and store the
filter result of file names into a variable called <<file_name>> for every file
do the following: copy the file stored in var $file_name to folder /EAI/iface/ge
ms/PRD/REPORTS /ERM/L2SVM/temp ls grep mdmtm_engyaustbatch grep 2010-02-10 grep
.ctl while read file_name <<press enter>> do <<press enter>> cp $file_name /EAI/
iface/gems/PRD/REPORTS/ERM/L2SVM/temp <<press enter>> done <<press enter>> _____
___________________________________________________________________________ ____
________________________________ ls DPRTm*Z.zip while read file_name do echo $fi
le_name echo $file_name sed 's/Z.zip//g' #sed is used to replace one string wih
a nother string echo $(echo $file_name sed 's/Z.zip//g')* echo echo echo /EAI/if
ace/GASMKT/PRD/Gastrix/out/$(echo $file_name sed 's/Z.zip//g')* if [ -f /EAI/ifa
ce/GASMKT/PRD/Gastrix/out/$(echo $file_name sed 's/Z.zip//g' )* ] ; then echo "M
atching File Was Found: " echo mv $file_name /EAI/iface/GASMKT/PRD/Gastrix/arch
else echo "no matching files was found in Gastrix/out !!" fi done ______________
__________________________________________________________________ _____________
_______________________

ls catsm_engyaust_msg_17*zip do echo $file_name echo echo


while read file_name
echo /EAI/iface/gems/PRD/NEMMCO/ENGYAUST/inbox/arch/$file_name if [ -f /EAI/ifac
e/gems/PRD/NEMMCO/ENGYAUST/inbox/arch/$file_name] ; then echo "Matching File Was
Found: " echo mv $file_name /EAI/iface/GASMKT/PRD/Gastrix/arch else echo "no ma
tching files was found in Gastrix/out !!" fi done ______________________________
__________________________________________________ _____________________________
_____ ls grep mdmtm_engyaustbatch grep 2010-02-10 grep .ctl while read file_name
<<press enter>> do <<press enter>> cp $file_name /EAI/iface/gems/PRD/REPORTS/ER
M/L2SVM/temp <<press enter>> done <<press enter>> ______________________________
__________________________________________________ _____________________________
_____ GEMS Monitor while true do echo $(date): outboxcomm, no. of .zip files: `l
s /EAI/iface/gems/PRD/NEMMCO/E NGYAUST/outbox/comm grep zip wc -l` inboxcomm, no
. of .ack files: `ls -l /E AI/iface/gems/PRD/NEMMCO/ENGYAUST/inbox/comm/ grep ac
k wc -l` sleep 1 done while true do echo $(date; ls -l /EAI/tibco/tra/domain/CMS
PRD/application/GEMS/working/GEMS-B W-ENGYAUST/jdb/GEMS-BW-ENGYAUST) sleep 60 do
ne ___________________________________________________________________________ w
c -l 123.txt ==>Get the no of records inside the file wc -l 123_abc.txt 334_tty.
txt ==>Get the no of records inside a multible text or CVS files with total reco
rds at the end sort 123.txt ==>sort records within the file 123.txt unique 123.t
xt ==>list the unique records within the file lv8 ______________________________
______________________________________________ PS -ef ==> Show process ID ==> -e
show for all usres ==> -f show UID, PPID ..etc

ps -ef grep MIBBGeneric -v grep ==>> show the proces-id for MIBBGeneric -v g rep
to exclude the grep command from appreaing in the list
_______________________________________________________________ find -name 'mypa
ge.htm' In the above command the system would search for any file named mypage.h
tm in th e current directory and any subdirectory. find . -name 'heapdump*' -exe
c echo rm '{}' \; find . -name 'heapdump*' -exec ls -l '{}' \;
___________________________________________________________________ cat MIRNLIST
ING_ENVESTRA_20101202.csv wc l
to find the number of records in the csv file __________________________________
_________________________________ chmod options filename --- lets you change the
read, write, and execute permissi ons on your files. The default is that only y
ou can look at them and change them, but you may somet imes want to change these
permissions. For example, chmod o+r filename will make the file readable for ev
eryone, and ch mod o-r filename will make it unreadable for others again. Permis
sions, another way You can also change file permissions with letters: u = user (
yourself) g = group a = everyone r = read w = write x = execute chmod u+rw {file
spec} Give yourself read and write permission chmod u+x {filespec} Give yourself
execute permission. chmod a+rw {filespec} Give read and write permission to eve
ryone.
________________________________________________________________________________
______________________________________ gzip -9 <name of file> will compress <fi
lename> and remove the original file Unzip -p // will unzip the ziped file and b
rowse the file inside unzip -v // will give u the actual ziped file name inside
the zip file unzip -l // will give u the actual ziped file name inside the zip f
ile (same as -v) bzip2 -9vv CSD_20111014.csv (compressor only, used for zipping
one file only) a nd takes longer to zip but more disk space effecient

tar eg:
// used for archiving only and no compression tar -cvf - * bzip2 -9c > CSD_20111
014_ByFRMP.tar.bz2 --> * stands for every non hidden files within the current fo
lder --> tar all files and send the output into bzip2 utility to co mpress the t
ar fil and then save the output to << file_name.tar.bz2>>
******************zip a lot of file in a folder into one filename **************
********************************** zip -9r archname.zip . compress all files in
the current directory (not to b e used with fileglob pattern such as *.log or *
.dat, because the fileglob might expand so much ls grep log xargs zip -9r arachi
vename.zip // zip all files that hav e "log" in the file name, works if the file
names dose not have spaces. ls grep log xargs zip -9r log_file_21112011.zip //e
xample *************************************************************************
******* *********************************** in case we have file names in the fo
lder that contaiins spaces within the file n ame, then we can use the following:
ls grep log while read line do zip -9r backup_12121961.zip "$line" file name th
at have the space done
"$line" will be substituted with the
// dont forget to remove the original log files that was compressed ************
******************************************************************** ***********
********************** to uncompress bz2 file = bzip2 -d __file_name__ tands for
decompress. without retaining original bziped2 file. to uncompress bz2 file = b
zip2 -dc __file_name__ > new File Name decompress and retain the original file t
o uncompress tar.bz2 file = bzip2 -dc __file_name__ ncompress the bz2 .tar file
tar -xvf --> -d s --> -dc --> to u
it is better to do the bzip2 and tar operation into a temp folder. _____________
___________________________________________________________________ ____________
_____________________________________________________ FTP commands ascii ==>to s
et the mode of file transfer to ASCII (this is the default and transmits seven b
its per character) binary ==> to set the mode of file transfer to binary (the bi
nary mode transmits all eight bits per byte and thus provides less chance of a t
ransmission error and must be used to transmit files other tha n ASCII files)

bye ==> to exit the FTP environment (same as quit) close ==> to exit the FTP env
ironment (same as quit) pwd cd lcd ==> to print current working directory ==> to
change directory on the remote machine ==> to cgange the current directory on t
he local machine
get ==>to copy one file from the remote machine to the local machine . If you ar
e going to copy a z.ip file from remote place or send a zip file or any binary f
iles, you have to be in binary session. just type bin and enter to eneter a bina
ry session get ABC DEF copies file ABC in the current remote directory to (or on
top of) a file named DEF in your current local directory. get ABC copies file A
BC in the current remote directory to (or on top of) a file with the same name,
ABC, in your current local directory. mget ==>to copy multiple files from the re
mote machine to the local machine; you are prompted for a y/n answer before tran
sferring each file mget * copies all the files in the current remote directory t
o your cu rrent local directory, using the same filenames. Notice the use of the
wild card character, *. example: ftp> mget *.html mput ==>to copy multiple file
s from the local machine to the remote machine; you are prompted for a y/n answe
r before transferring each file example ftp> mput *.html open ==>to open a conne
ction with another computer open brubeck opens a new FTP connection with brubeck
; you must enter a username and password for a brubeck account (unless it is to
be an anonymous connection). put ==> to copy one file from the local machine to
the remote machine help ==> Type help or ? to view list of all available ftp com
mands ? ==> Type help or ? to view list of all available ftp commands __________
_____________________________ Vi Commands :w =====> To save the current file :q
=====> to quit :wq =====> to save and quit / =====> Go to command line /[a-zAZ]+
=====> search the file for any smallor large alpha caracter followed by + eg: D
+Z x i dd yy =====> esc then x to delete a characer =====> esc then i to enter i
nto insert mode =====> delete one line =====> copy whole line
shift+p =====> to paste above cursor p =====> to paste below cursor shift+c ====
=> to overwrite rest of line starting from the cursor position w ith what ever i
n buffer

_______________________________________ Webmethod user-id : administrator passwo


rd : manage SVN user-ID : malshanteer SVN password : malshanteer _______________
_____________________________________________ TIBCO EMS In all Servers /EAI/tibc
o> cd ems /EAI/tibco/ems> cd bin /EAI/tibco/ems>/bin tibemsadmin /EAI/tibco/ems>
/bin connect the userid is always admin by default ==> hit the enter key and the
n enter the p assword >show quesues >show topics ---------------------------------------TIBCO EMS Local 1. go to d:\tibco\ems\5.0\bin 2. run the following comm
and: tibemsadmin.exe 3. write the following line: connect tcp://localhost:7222 4
. the username is admin and leave the password empty. 5. Press enter. 6. Write t
he following command: show queues show topics ______________ esc K to go back to
history ____________________________________________ Gateway eagwcfg ==> will t
ake you to gateway proberties directory all gatewa log is in : /EAI/EA_GATEWAY/l
ogs/PRD __________________________________________________________ Crontab cront
ab -l Display your crontab file.
A crontab file has five fields for specifying day , date and time followed by th
e command to be run at that interval. _________________________ 1. Minute - Min
utes after the hour (0-59) ______________________ 2. Hour - 24-hour format (0-23
).

___________________ 3. Day - Day of the month (1-31) ________________ 4. Month Month of the year (1-12) ______________5. Weekday - Day of the week. (0-6, whe
re 0 indicates Sunday) 30 0,12 * * * /some/script/or/command
So, when we combine all the schedule elements, we know when and how often this t
ask will run. Going on the above example, this task would run: At 30 minutes pa
st the hours of 0 (midnight) and 12 (noon), EVERY day of the mon th, EVERY month
of the year and EVERY day of the week. In other words, the above task would run
every single day at 12:30AM and 12:30PM - A comma is used to input multiple val
ues for a field. For example, if you want ed a task to run at hours 12, 15 and 1
8, you would enter that as "12,15,18". - A line in crontab file like below remov
es the tmp files from /home/someuser/tm p each day at 6:30 PM. 30 18 * * * rm /h
ome/someuser/tmp/*
welcome to crontabrocks.org Crontabrocks.org is a quick and simple guide to cron
tab usage. The cron daemon p rovides the ability for a system administrator or a
ny other user (if permitted t o do so) to automate the routine running of script
s, tasks or any other server f unction on a regular basis. The cron daemon is so
mewhat similar to what the "sch eduled tasks" tool on a Windows machine would be
. Most Unix/Linux based systems come with the cron daemon installed and configur
ed to start on server boot by de fault. There is usually not much work, if any,
that you have to do to start usin g the cron daemon. The server itself usually c
omes out of the box with several s ystemic cron jobs already set up, so adding y
our own jobs to the schedule is not big deal. Cron jobs are scheduled by a user
using a tool known as "crontab". Th e crontab is nothing more than a text file w
ritten in a syntax that the cron dae mon understands. So first, let's talk about
how to handle the crontab itself...
Accessing the Crontab crontab -e - opens the user's crontab file for viewing/edi
ting crontab -l - simply lists the crontab file's contents for the user. Think o
f it as a "cat" function for the crontab. The following commands would apply to
the user which you are logged in as. For e xample, if you are logged in as "root
", these commands would pertain to root's c rontab file. crontab -e - opens the
user's crontab file for viewing/editing crontab -l - simply lists the crontab fi
le's contents for the user. Think of it as a "cat" function for the crontab.

crontab -r - removes the crontab file contents for the user But what if you want
to edit another user's crontab? The system administrator is usually logged in a
s "root", but making changes to a nother user's crontab file or simply looking a
t another user's crontab file is o ften necessary. For situations like this, you
can append the "-u" flag followed by the desired username. For example, if logg
ed in as root but you want to edit the crontab for the user "admin", you would d
o the following: crontab -e -u admin The same logic applies to the other crontab
commands as well, such as: crontab -l -u admin - lists the crontab entry for th
e "admin" user. crontab -r -u admin - removes the crontab entry for the "admin"
user.
Writing to the Crontab Now that you know how to access the crontab, let's take a
look at the syntax of the crontab entry itself. A typical crontab entry might l
ook like this: 30 0,12 * * * /usr/local/scripts/whatever.script OK, so what does
that mean? Well, there are 2 parts to the entry you see above. In fact, any cro
ntab entry has 2 parts: Part 1 - The schedule The schedule, which governs when t
he task will run, consists of a string of numb ers, possible commas and asterisk
s (*). So, in the above example, the schedule is: 30 0,12 * * * What you are see
ing is actually split up into 5 sections. The following chart il lustrates what
each section of the schedule is for: 1. 2. 3. 4. 5. Minute - Minutes after the h
our (0-59). Hour - 24-hour format (0-23). Day - Day of the month (1-31). Month Month of the year (1-12). Weekday - Day of the week. (0-6, where 0 indicates Su
nday).
* = An asterisk in a schedule field indicates "every". It means that the task wi
ll occur on "every" instance of the given field. So a "*" on the Month field in
d icates the the task will run "every" month of the year. A * in the Minutes fie
ld would indicate that the task would run "every" minute. , = A comma is used to
input multiple values for a field. For example, if you wa nted a task to run at
hours 12, 15 and 18, you would enter that as "12,15,18".

Let's take a look at how this format fits into the syntax of a crontab entry: __
_______________________ 1. Minute - Minutes after the hour (0-59) ______________
________ 2. Hour - 24-hour format (0-23). ___________________ 3. Day - Day of th
e month (1-31) ________________ 4. Month - Month of the year (1-12) ____________
__5. Weekday - Day of the week. (0-6, whe re 0 indicates Sunday) 30 0,12 * * * /
some/script/or/command
So, when we combine all the schedule elements, we know when and how often this t
ask will run. Going on the above example, this task would run: At 30 minutes pa
st the hours of 0 (midnight) and 12 (noon), EVERY day of the mon th, EVERY month
of the year and EVERY day of the week. In other words, the above task would run
every single day at 12:30AM and 12:30PM . Let's play around with the schedule a
little bit and try something different. Wh at if we had something like this: 15
,45 0,12,6 20 1,2,3 0 /some/script/or/command Wow! Now this is a pretty complex
crontab entry. Let's decipher it... 15,45 - This means that the task will run at
15 and 45 minutes past the hour. Bu t what hours and what days? Well, that's co
ming up. 0.12.6 - The task will run during the hours of 0 (midnight), 12 (noon)
and 6AM. 20 - The task will run on the 20th day of the month. But during what mo
nths? 1,2,3 - The task will run only during tibco.clientVar.FileTransfer/CBA/Out
bound/CBA_DirectDebit_AlertUserBy=16:05:00 TRA files /EAI/tibco/tra/domain/CMSPR
D/application/CBA
ls -l ~/OUTAGE
http://l4298mq1/apps/EMMA_Viewer_Prototype/index.php ***************************
************************** Get SQlLoader example get XML parsing example with da
ta

what is pagescrapper is Partner Link Configuration used for webservices !! get t


o know SFTP ***************************************************** ______________
__________________________________________________________________ _____________
_______________________
1- AEMO produce .zip file 2- Ausgrid download the Zip file into thru gateway to
AusGrid outbox/comm 3- AusGrid process the .Zip file and copy it to outbox/arch
4- AusGrid creates corresponding .Ack file in inobox/comm 5- Gateway will copy t
he .Ack to AEMO inbox 6- Upon arrival of .Ack file into AEMO inbox, AEMO porcess
will delete the initi ating .Zip file 7- Ausgrid Gateway will be syncyc with AE
MO, thus will delete the .Zip file from outbox/comm
OMSPRD.OMS1.CASS.TRANSIT has 36 pending messages on dc2ap11851 CUSTOMER_DETAIL_I
NBOUND table check if there is any error in OMS-ESB_OMS.log if u do not find any
thing and the number of messages kept increasing then we nee d to talk to OMS Su
pport and ask them to process the data that we have in CUSTOM ER_DETAIL_INBOUND

Potrebbero piacerti anche