August 2014
M T W T F S S
 123
45678910
11121314151617
18192021222324
25262728293031

Categories

August 2014
M T W T F S S
 123
45678910
11121314151617
18192021222324
25262728293031

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 […]

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 […]

Bash cheat sheet

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 […]

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 […]

cheat.sheet FOR AWK SED PERL and VI

[gview file=”http://rmohan.com/wp-content/uploads/2014/08/awk.cheat_.sheet_.pdf”]

 

[gview file=”http://rmohan.com/wp-content/uploads/2014/08/bash-history-cheat-sheet.pdf”] [gview file=”http://rmohan.com/wp-content/uploads/2014/08/bash-vi-editing-mode-cheat-sheet.pdf”] [gview file=”http://rmohan.com/wp-content/uploads/2014/08/perl.predefined.variables.pdf”] [gview file=”http://rmohan.com/wp-content/uploads/2014/08/sed.stream.editor.cheat_.sheet_.pdf”]

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 […]

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 […]

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 […]

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 :

[…]