Вы находитесь на странице: 1из 14

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

all file id the directory where the name of ls -ltr wc -l ==> list 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.txt ==> 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 files where date st arts with 1 and 2'nd charter is 2 or 9, so list all files ==> that 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 12 or 26 or 09 ls -allp ==> disp aly / after directory names ls -all grep mdmtm_eng grep 2011-03-04 ==> display all file tha t have mdmtm_eng and also have 2011-03-04 as part of the file name ls -ltr grep ctl wc -l ls -all grep -i <<file name>> ==> grep -i beomes case incensit ive ls grep mdmtm_engyaustbatch grep 2011-11-10 grep zip xargs zgrep -l Level2 SettlementReconciliation wc -l ==>> count the number of zip files where thier date is 2011-11-10 and contai ns the string (SettlementLoader-loaders) ls -lrt ==>sorts by ascending creation t imestamp order (-l =long (detailed) display ) ls -lt ==>sorts by descending creation timestamp order ls -la sort -nk 5 ==>sort by the size (5) indicate s the column number for sorting (in this case col 5 is the size col) ls -la sort -nr 5 ==>sort by the size (5) indicate s the column number for sorting (in this case col 5 is the size col) and in reverse order ls -ltr sort -n ==> list the file sort by size asc order history ==> will list the command history , output will be somthing like this 23 ls -ltr ../backlog

24 25 26 27 28

ls -ltr ../backlog ls -ltr ../backlog ls -ltr rm catsm_energyapbatch_400588769.xml mv catsm_energyapbatch_400588769-2011-08-26.081808.828.zip ./processed ==> r23 will execute ( ls -ltr .

./backlog) _____________________________________________ To Run script in debug mode : sh x <<name of the script>> eg: sh -x RunSnapShotReport_MBSE3203.sh _____________________________________________ Tail -f ==> will display the tail of the file and keep scrollin g and displaying new info logged into the file tail -f nohup.out ==> ______________________________________________ cat MIRNLISTING_ENVESTRA_20110330.CSV wc -l ==> get the number of records in side the file (MIRNLISTING_ENVESTRA_20110330.CSV) tail -f loading.log eing written to the (loading.log) ==> show the ongoing lines that are b

_______________________________________________ More Command Shift+G to go to end of file B ==> to go up in the file Enter ==> to go down in the file j ==> move to next line k ==> move above line line ___________________________________________ view command view FileName commands: :set nu ==>> set line number on :q ==> quit ____________________________________________ shortcut or symbloic link 1- change directory to the <<destination directory >> where the link file will b e created easdclpard41(tibstg):cd /EAI/tibco/STG/scripts > 2- To create 2 linked file names (runintech.sh & runRFCDPI.sh) which would actua ll link and run StartServers.sh issue the following command ln -s <<full path of the source file>> <<name of the destination link>> eg: easdclpard41(tibstg):/EAI/tibco/STG/scripts > ln -s /EAI/apps/IQ_Office/

bin/aix53_64bit/startServers.sh runIntech.sh eg: easdclpard41(tibstg):/EAI/tibco/STG/scripts > ln -s /EAI/apps/IQ_Office/ bin/aix53_64bit/startServers.sh runRFCDPI.sh list the files in the directory, you will see that 2 linked files were create d. ls -lt lrwxrwxrwx 1 tibstg tibco 51 Jul 21 10:51 runRFCDPI.sh -> /EA I/apps/IQ_Office/bin/aix53_64bit/startServers.sh lrwxrwxrwx 1 tibstg tibco 51 Jul 21 10:49 runIntech.sh -> /EA I/apps/IQ_Office/bin/aix53_64bit/startServers.sh

____________________________________________ cd - Return to the previous directory cd .. Return to the parent directory cd ./processed ==> list all files withing the (subdirectory of the current dire ctory) which is named <<processed >> cd ~ ==> Go back to home directory, useful if you're lost ___________________________________________ fg ===> display the foreground process bg ===> display the processes that is running in the background ___________________________________________ Disk Space heapdump.20110708.153113.589998.phd ./tibco/adapter/adadb/5.5/bin/odbctrace.out

df ==>df (abbreviation for disk free) is a standard Unix computer p rogram 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 file in MB sorted by size

du -sk * ==> shows the file usage for every file and directory beneath the current, 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 find . -size +50000

________________________________________________________________________________ ____________________________________

Grep ____ grep grep

: grep "payment_ftp" *.log : grep "payment_ftp" *.log ==> search for all occurance 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 will grep all 'eai_support' and 'GASB

egrep '(eai_support GASBB)' *.properties B' within the *.properties files

________________________________________________________________________________ __________________________________ * filter the current directory for (mdmtm_engyaustbatch 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/gems/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 $file_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/iface/GASMKT/PRD/Gastrix/out/$(echo $file_name sed 's/Z.zip//g')* if [ -f /EAI/iface/GASMKT/PRD/Gastrix/out/$(echo $file_name sed 's/Z.zip//g' )* ] ; then echo "Matching 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/iface/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 matching 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/ERM/L2SVM/temp <<press enter>> done <<press enter>> ________________________________________________________________________________ __________________________________ GEMS Monitor while true do echo $(date): outboxcomm, no. of .zip files: `ls /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 ack wc -l` sleep 1 done while true do echo $(date; ls -l /EAI/tibco/tra/domain/CMSPRD/application/GEMS/working/GEMS-B W-ENGYAUST/jdb/GEMS-BW-ENGYAUST) sleep 60 done ___________________________________________________________________________ wc -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 records at the end sort 123.txt ==>sort records within the file 123.txt unique 123.txt ==>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 'mypage.htm' In the above command the system would search for any file named mypage.htm in th e current directory and any subdirectory. find . -name 'heapdump*' -exec echo rm '{}' \; find . -name 'heapdump*' -exec ls -l '{}' \;

___________________________________________________________________ cat MIRNLISTING_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 you 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 everyone, and ch mod o-r filename will make it unreadable for others again. Permissions, 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 {filespec} Give yourself read and write permission chmod u+x {filespec} Give yourself execute permission. chmod a+rw {filespec} Give read and write permission to everyone.

________________________________________________________________________________ ______________________________________ gzip -9 <name of file> will compress <filename> and remove the original file Unzip -p // will unzip the ziped file and browse 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 file (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_20111014_ByFRMP.tar.bz2 --> * stands for every non hidden files within the current folder --> tar all files and send the output into bzip2 utility to co mpress the tar 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 arachivename.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 //example ******************************************************************************** *********************************** in case we have file names in the folder 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 that 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 = bzip2 -dc __file_name__ > new File Name decompress and retain the original file to 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 set the mode of file transfer to ASCII (this is the default and transmits seven bits per character) binary ==> to set the mode of file transfer to binary (the binary mode transmits all eight bits per byte and thus provides less chance of a transmission 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 environment (same as quit) pwd cd lcd ==> to print current working directory ==> to change directory on the remote machine ==> to cgange the current directory on the local machine

get ==>to copy one file from the remote machine to the local machine . If you are going to copy a z.ip file from remote place or send a zip file or any binary files, you have to be in binary session. just type bin and enter to eneter a binary 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 ABC 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 remote machine to the local machine; you are prompted for a y/n answer before transferring each file mget * copies all the files in the current remote directory to 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 files from the local machine to the remote machine; you are prompted for a y/n answer before transferring each file example ftp> mput *.html open ==>to open a connection 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 commands ? ==> 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 into 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 in buffer

_______________________________________ Webmethod user-id : administrator password : manage SVN user-ID : malshanteer SVN password : malshanteer ____________________________________________________________ TIBCO EMS In all Servers /EAI/tibco> 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 then enter the p assword >show quesues >show topics ----------------------------------------TIBCO EMS Local 1. go to d:\tibco\ems\5.0\bin 2. run the following command: 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 the following command: show queues show topics ______________ esc K to go back to history ____________________________________________ Gateway eagwcfg ==> will take you to gateway proberties directory all gatewa log is in : /EAI/EA_GATEWAY/logs/PRD __________________________________________________________ Crontab crontab -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 - Minutes 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 past 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 values for a field. For example, if you want ed a task to run at hours 12, 15 and 18, you would enter that as "12,15,18". - A line in crontab file like below removes the tmp files from /home/someuser/tm p each day at 6:30 PM. 30 18 * * * rm /home/someuser/tmp/*

welcome to crontabrocks.org Crontabrocks.org is a quick and simple guide to crontab usage. The cron daemon p rovides the ability for a system administrator or any other user (if permitted t o do so) to automate the routine running of scripts, tasks or any other server f unction on a regular basis. The cron daemon is somewhat 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 configured 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 comes out of the box with several s ystemic cron jobs already set up, so adding your 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 written 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/editing crontab -l - simply lists the crontab file's contents for the user. Think of 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 file'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 as "root", but making changes to a nother user's crontab file or simply looking at 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 logged in as root but you want to edit the crontab for the user "admin", you would do 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 the "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 look 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 crontab entry has 2 parts: Part 1 - The schedule The schedule, which governs when the task will run, consists of a string of numb ers, possible commas and asterisks (*). So, in the above example, the schedule is: 30 0,12 * * * What you are seeing 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 hour (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 Sunday).

* = 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 ind icates the the task will run "every" month of the year. A * in the Minutes field 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 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 past 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 coming 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 months? 1,2,3 - The task will run only during the months of January, February and March. 0 - The task will only run on a Sunday. ________________________________________________________________________________ __________________________________ Stop ea gateway cd /EAI/EA_GATEWAY/scripts execute the script stopEJFTP.sh with two arguments to specify the interface name and the environment name (DEV STG PRD). stopEJFTP.sh EAI-IB PRD Start gateway dc2ap11852 nohup startEJFTP.sh XXX PRD & dc2ap11853 nohup startEJFTP.sh XXX PRD & dc2ap11854 nohup startEJFTP_MF.sh SPAusNet_MBS PRD & or nohup startEJFTP_MF.sh TRUEnergy_MBS PRD & or

nohup startJJEJFTP.sh B2BBrowser_NEMMCO_EALINK PRD & or else nohup startEJFTP.sh XXX PRD & dc2ap11856 eapdcbsafp01 startEJFTP.sh XXX PRD > /dev/null & nohup startEJFTP.sh XXX PRD &

All gateways connect thru a local proxy to external sites 1- First test 10.0.12.0 :8021 enter user nameenter password if all OK connect to External site ________________________________________________________________________________ _____________________________________ EMS check if ems is running : ps -ef grep tibemsd Verify that messages not piled up within the EMS Queue, otherwise alert L2 A- Log into eapdclparp37 and change directory to /EAI/tibco/ems/5.0/bin [[BR]] B- Execute 'tibemsadmin'[[BR]] C- type 'connect' and login as admin user[[BR]] D- type 'show queues' and verify that ea.prd.* queues have 0 Messages and 0.0 Kb size.[[BR]] ________________________________________________________________________________ ____________________________________ When using the find and replace command ^ indicates first $ indicates end of line

TIBCO glbal var change: tibco.clientVar.FileTransfer/CBA/Outbound/CBA_DirectDebit_AlertUserBy=16:05:00 TRA files /EAI/tibco/tra/domain/CMSPRD/application/CBA

ls -l ~/OUTAGE

http://l4298mq1/apps/EMMA_Viewer_Prototype/index.php ***************************************************** Get SQlLoader example get XML parsing example with data

what is pagescrapper is Partner Link Configuration used for webservices !! get to 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 the .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 AEMO, thus will delete the .Zip file from outbox/comm

OMSPRD.OMS1.CASS.TRANSIT has 36 pending messages on dc2ap11851 CUSTOMER_DETAIL_INBOUND table check if there is any error in OMS-ESB_OMS.log if u do not find anything and the number of messages kept increasing then we nee d to talk to OMS Support and ask them to process the data that we have in CUSTOM ER_DETAIL_INBOUND

Вам также может понравиться