Get the pid of the program
$ps -ef | grep “program name”
$pfiles <pid>
This will
list all the files and sockets used by the program.
Get the pid of the program
$ps -ef | grep “program name”
$pfiles <pid>
This will
list all the files and sockets used by the program.
To enable ftp use inetadm -e ftp
to disable it use inetadm -d ftp
This is one command that I find very useful at work. I learned it from my Collegue Manish.
If you have lot of jar files lying in some directories and you want to find which jar file contains Foo.class,
for i in `find . -name “*.jar”`; do echo $i; jar tvf $i | grep “Foo”; done
For Windows users, this might be a full day work, rite? Enjoy!
Steps to enable root login for ssh and disable telnet on Solaris,
Change “PermitRootLogin no” entry to “PermitRootLogin yes”
svcadm restart svc:/network/ssh:default
svcadm disable telnet
Following are the steps to connect to a remote x11 server,
On the client machine set the DISPLAY variable as follows,
$ export DISPLAY=server-host-name:0.0
On the server machine, enable remote connection from client
$ xhost +
N.B – use + if you are not concerned about any security issues. It enables any one to connect to your server. Use specific client name otherwise.
To read more about reasons to use remote display server and better security options , check this link.
There is no recursive grep function on Solaris. The work around that we use at work is,
find ./ -name *.java | xargs grep “mystring”
Suppose you want to find all Java class files under a given directory, including the sub directories, that use the resource bundle key “prop.file.path”
First part of the command returns all the files with .java extension –
find ./ -name *.java
The output of find command is given as input to the grep command using pipe symbol. xargs (http://en.wikipedia.org/wiki/Xargs) is used to split the large number of results returned by find command and pass it one by one to grep.
find ./ -name *.java | xargs grep “prop.file.path”
Use prtconf command. It is used to print system configuration.
prtconf | head -3 |grep Mem