Useful Tips on Solaris

Directory

How to list the directories only

ls -F | grep /

How to compress file using tar

tar cvf target.tar directoryToCompress

How to extract file using tar

tar xvf target.tar

File Processing

Search for patterToSearch starting from directory /

The search will check for certain string in all files under directory /. Result will show the filename.

find / | xargs grep patternToSearch

Delete content of a file ie. set content of file to nothing

cat /dev/null > myFile.log

Network

Show IP address

Show the ip address of all interface

/sbin/ifconfig -a

Packet Capturing

Capture the traffic at the network level for port 21

snoop -x -vV -P -o port 21
snoop -x -vV -o nokia-ok2.trace host 192.168.1.10




Written by Hanny Tidore
[email protected]

Hosted by www.Geocities.ws

1