About Me

My photo
Working as Technical Lead in CollabNET software private limited.
Showing posts with label command. Show all posts
Showing posts with label command. Show all posts

Tuesday, 3 November 2009

List ports used by java process

Below is the command to list all the ports opened by a java process

sudo netstat -tulpn |grep java

Thursday, 24 September 2009

To touch a folder contents recursive

Some times you may need to alter the access date of files and folder. You can do it by a recursive touch command.

find . | xargs touch

Friday, 18 September 2009

Intresting tip abt tcpdump

Searched for a tool like wireshock in windows and came to know this!. This help me to dump the soap requests.

Here is the simple command.

sudo tcpdump -XX -s0 -i lo -w k "tcp port 80"

-XX: Print packets in hex and ASCII
-s0: Print whole packets, not only first 68 chars.
-i is the interface to monitor.

"tcp port 80" Filter expression.
-w output file.


This dumps all the requests and responses which are passing through tcp port 80!.

Thursday, 23 April 2009

Linux maximum processes per user

Recently I came to know there is a max count of processes allocated for each user. Below is the command to find the find that.

ulimit -u

Reference:
http://tldp.org/LDP/solrhe/Securing-Optimizing-Linux-RH-Edition-v1.3/x4733.html

Tuesday, 31 March 2009

Find and Grep

The find and grep are very usefull commands for development.

When you want to grep a content for the matching files, below commands will help you out.


In linux:
find /tmp -name 'page.xml' -print0 | xargs -0 grep "view_link=\"ReportView" | awk '{print $1}' | wc -l

In solaris:
find /tmp -name 'page.xml' -exec grep "view_link=\"ReportView" {} \; | wc -l

In the above command I'm trying to find page.xml inside /tmp dir and then search content "view_link=\"ReportView" from the find output.

Wednesday, 8 October 2008

Visual block in VI

Do you need to perform multiple line edits at a single stretch.

I came across VISUAL BLOCK in vi editor.


   CTRL + v makes you to enter the visual mode for your file.
   select multiple lines
   SHIFT + i gives you the insert mode
   Enter the text at beginning of the block
   Press ESC twice to apply changes to all lines.



Blogged with the Flock Browser