Unix commands helps

grep grep is a saviour command for unix users. grep can be used to search for patterns in a file or standard input. The pattern search includes finding the line number of the keyword, counting the number of occurrences of a keyword and many more. we will see in the following examples. Example 1) grep […]

Read more
IFS – Internal Field Separator

It seems like an esoteric concept, but it’s actually very useful. If your input file is “1 apple steve@example.com”, then your script could say: while read qty product customer do echo “${customer} wants ${qty} ${product}(s)” done The read command will read in the three variables, because they’re spaced out from each other. However, critical data […]

Read more
Grep

Grep with large pattern files When I investigated the run times of grep -f related to large pattern files (with hundreds of lines and more) it became apparent that one can speed up grep by splitting up the pattern files into smaller chunks. I tested this with GNU grep 2.5.3 on a machine with an […]

Read more
TAR data over SSH and SCP

The GNU version of the tar archiving utility (and other old version of tar) can be use through network over ssh session. 1. Tarred file transfer Scp is very inefficient when copying many small files because it sets up a separate transfer for each file. It is possible to solve this problem by creating a […]

Read more
awk.cheat

.———————————————————————–. | | | AWK Cheat Sheet | | | ‘———————————————————————–‘ | Peteris Krumins (peter@catonmat.net), 2007.08.22 | | http://www.catonmat.net – good coders code, great reuse | ‘———————————————————————–‘ ===================== Predefined Variable Summary ===================== .————-+———————————–.———————. | | | Support: | | Variable | Description ‘—–.——-.——-‘ | | | AWK | NAWK | GAWK | ‘————-+———————————–+—–+——-+——-‘ | FS […]

Read more
Perl Tips

Useful One-Line Scripts for Perl Dec 03 2013 | version 1.10 ——————————– ———– ———— Compiled by Peteris Krumins (peter@catonmat.net, @pkrumins on Twitter) http://www.catonmat.net — good coders code, great reuse Latest version of this file is always at: http://www.catonmat.net/download/perl1line.txt This file is also available in other languages: Chinese: https://github.com/vinian/perl1line.txt Please email me peter@catonmat.net if you wish […]

Read more
catalina.out log rotation

Hi, I am interested in catalina.out log file rotation, I have an application where logging to catalina.out is very huge, say 0.5 MB / sec. So I have written one script to handle this which is shown below. # crontab -l | grep catalina 0,30 * * * * bash /catalina_log_handler.sh  >/dev/null 2>&1 # more […]

Read more
Logoff user remote session using CMD

  Using CMD to kick user not properly logoff in remote session. This command to list out the user. Have 2 command : 1 – quser /SERVER : [server name] 2 – qwinsta /SERVER : [server name] This command to kick the user : 1 – logoff /SERVER : [server name] [session id] Example : […]

Read more

Hit Counter provided by dental implants orange county