You are on page 1of 2

UNIX Commands:

1. line count : wc -l arnwithtxn.dat


2. Check the any element in the file : grep -n 1444248947 nac_106_inputrecords.t
xt
3. to view the file : vi nac_106_inputrecords.txt
4. to edit and save the file : :wq
5. to come out the file : :q
6. Cut the some portion of the record in a file : cut -f2 -d":" chase_txn.dat >
chase_txn_inputrecords.txt
7. to display the file in console : head chase_txn.dat
8. Row count in a file : wc -l arnwithtxn.dat
9. To view perticular portion of all the records : head chase_txn.dat | cut -f2
-d":" | cut -c76-93
11. Cut the some portion of the record and write into another file : cat chase_t
xn.dat | cut -f2 -d":" | cut -c76-93 > chaeamnt.dat
12. compare two files : diff nac_file_arns.sort arnwithtxn.dat | grep -c "<"
13. difference two files : diff nac_file_arns.sort arnwithtxn.dat | more
14 sort: cut -f2 -d":" chase_txn.dat | cut -c8-17 | sort -u > arnwithtxn.dat
15 sort and count :cut -f2 -d":" chase_txn.dat | cut -c8-17 | sort -u | wc -l
16. Search the all the files using perticular value : find . -name "*.*" | xargs
egrep "1442037717|1442075378" > /tmp/chase_txn.dat
17. append the search results to same file : find . -name "*.*" | xargs egrep "1
442037717|1442075378" >> /tmp/chase_txn.dat
diff txnids.uniq txnids.sort | grep ">" > duptxns.dat
head duptxns.dat
diff txnids.uniq txnids.sort | more
tail txnids.sort
wc -l txnids*
uniq txnids.sort > txnids.uniq
sort -o txnids.sort txnids.dat
head -652 AccumResp0528.dat | tail -1
Check the first name and last name in the file
find . -name "*.*" | xargs egrep -i "Barbara|Catherine|Gina|Christine|Robert" |
egrep -i "Mucciolo|Ogrudek|Love|Piacquadio|Kiselyak"
paste -d"|" hmay.dat may_lines.dat tmay.dat > extract_maylines.sh

--accrual total extraction and summing up the values


grep "commission" lv_accrual_20080703061810.xml > commision_0306.dat
vi commission_0306.dat
--substitue the <commission> tags
:g/<commission>/s/<commission>//
:g/<\/commission>/s/<\/commission>//
:wq
--sum the total file
cat commision_11.dat | awk 'BEGIN { tot=0 } { tot+=$1 } END { print tot }'
--Sum the member amount in proc488
cut -f12 -d"~" sp_may_proc_488.txt > amount.dat

You might also like