Solaris Tips and Tricks

2010-05-19 1 min read Solaris

Find a list of Tips and Tricks <a href="http://sysunconfig.net/unixtips/solaris.html">here.

A nice trick to list the process which has opened a particular port is :

#!/bin/ksh

# 7-30-2003
# find from a port the pid that started the port

line=&#8217;————————————————————————-&#8217;
pids=`/usr/bin/ps -ef | sed 1d | awk '{print $2}&#8217;`

# Prompt users or use 1st cmdline argument
if [ $# -eq 0 ]; then
         read ans?&#8221;Enter port you like to know pid for:  &#8221;
else
         ans=$1
fi

Continue reading

Linux tip to find the pid/program using a particular port

2010-05-12 1 min read Solaris

netstat -lpn
Technorati Tags: <a class="performancingtags" href="http://technorati.com/tag/port" rel="tag">port, <a class="performancingtags" href="http://technorati.com/tag/pid" rel="tag">pid, <a class="performancingtags" href="http://technorati.com/tag/linux" rel="tag">linux, <a class="performancingtags" href="http://technorati.com/tag/netstat" rel="tag">netstat

View entire process string

2010-05-06 0 min read Solaris
\"Solaris
Image via Wikipedia

$ /usr/ucb/ps -auxgww Depending on your installation, when you run ps you will only get the first 40 or so characters displayed. In order to view the entire string, use /usr/ucb/ps on <a class="zem_slink freebase/en/solaris_operating_system" title="Solaris (operating system)" rel="homepage" href="http://www.sun.com/solaris/">Solaris.

<a class="zem_slink freebase/en/uniform_resource_locator" title="Uniform Resource Locator" rel="wikipedia" href="http://en.wikipedia.org/wiki/Uniform_Resource_Locator">URL: <a href="http://feedproxy.google.com/~r/Command-line-fu/~3/3y5LUukdRu8/view-entire-process-string">http://feedproxy.google.com/~r/Command-line-fu/~3/3y5LUukdRu8/view-entire-process-string<h6 class="zemanta-related-title">Related articles by Zemanta <ul class="zemanta-article-ul"> <li class="zemanta-article-ul-li"><a href="http://domainmacher.com/snurl-com-a-secure-and-simple-url-shortener/?utm_source=rss&utm_medium=rss&utm_campaign=snurl-com-a-secure-and-simple-url-shortener">SnURL.com – A Secure And Simple URL Shortener (domainmacher.com) <div class="zemanta-pixie"><a class="zemanta-pixie-a" title="Reblog this post [with Zemanta]" href="http://reblog.zemanta.com/zemified/5575dd33-40cb-43f4-9de1-9a17f6372eef/"><img class="zemanta-pixie-img" src="http://blog.amit-agarwal.co.in/wp-content/uploads/2010/08/reblog_b44.png" alt="Reblog this post [with Zemanta]" /><span class="zem-script more-related more-info pretty-attribution paragraph-reblog">

Continue reading

Running Nested X server

2010-03-25 1 min read Linux Solaris

Today I was trying to do a XDMCP connection to the other server ( which is solaris, not sure if that matters) so I used the Xnest server. and used the following command:

Xnest :1 -ac -query

And I was getting the error:

AUDIT: Tue Dec 2 20:40:03 2008: 1470 Xnest: client 2 rejected from IP <>

I tried allowing the host to use the display but not use. The command I used was

Continue reading

Solaris commands.

2010-03-21 1 min read Linux

prtdiag
vmstat
iostat
uname -a

Will update this shortly with the details for these commands.

bash script with sql to get the number of records from multiple tables.

2010-02-10 1 min read Bash Database Learning Linux Solaris

Here is the bash script:

#!/bin/sh
names[1]=errorlog
names[2]=amit1log
names[3]=amit2log
names[4]=amit3log
names[5]=amit4log
j=1
echo $1
for i in $( sqlplus amit/passwd@tns @get_count.sql |sed  -n &#8217;/COUNT/,/Disconnected/p&#8217;|sed &#8217;/COUNT/ d&#8217;|sed &#8217;/—/ d&#8217;|sed &#8217;/Disconnected/ d&#8217;|tr &#8217;n&#8217; &#8217; &#8217;  )
do
temp=${names[$j]}
let count=30-${#temp}
for ((I=1; I <= $count ; I++))
do
printf &#8221; &#8221;
done
echo  &#8221;${names[$j]}    : $i&#8221;
# echo $j
let j=j+1
done
echo
echo

and the required sql script:

select count() from errorlog;
select count(
) from amit1log;
select count() from amit2log;
select count(
) from amit3log;
select count(*) from amit4log;
quit;

Continue reading
Newer posts