More solaris commands
2010-06-29
417 words
2 mins read
These commands are taken from various sources and are quite helpful for day to day work on solaris.
For find n grep
grep -i m_forwardingProxy `find . -name \*cpp`
grep -i XVarBind `find . -name \*h`
grep -i gSLEncodeMode `find . -name ”*.cpp” -o -name ”*.h”`
Find:
find . \( -name ”*.cpp” -o -name ”*.h” -o -name ”*.c” -o -name ”*.cc” -o -name ”*.inh” -o -name ”*.inc” -o -name ”*.sm” -o -name ”*.asm” \)
ipcs – status of the shared memory segment:
ipcrm -s id – To clear the shared memory segment (id can be got by ipcs command.)
uname -a
which xxx – path of the xxx
(or)
type xxx – path of the xxx
who am i – present user details
who|cut -f 1 -d ’ ’|sort |uniq
who | awk '{print $1}’ | sort | uniq
whoami
source
chmod -r 777 * – To change the permissions
id
nm
ldd
ctags -R . – To create tag file for code browsing
ctags -L
pushd . – Pushes the current path on the Stack
popd . – Pops the current path from the Stack
snoop -x -20 port
groupadd cworks
useradd -g cworks -d /export/home/cworks -m -c ”cworks” cworks
useradd -g ccusers -d /export/home/naveenc -m -c ”Naveen’s NIS Login” -u 3224 naveenc
passwd cworks
passwd -s cworks
grep ”^cworks:” /etc/shadow
nslookup [For querying DNS]
dig
ps -aef | grep -i
Debugging:
prstat -p
pfiles
pmap
pstack
ps -p
gcore
useradd -g 5001 -d /export/home/skumar -m -c ”Sunil’s NIS Login on Ripley” -u 2002 skumar
useradd -d /export/home/skumar -m -c ”Sunil’s NIS Login on Ripley” -u 2002 skumar
ln -s
ln -s /pilgrimvobs/pilgrim/testbed/sparc/ptestbed ptestbed
To grep a particular column, PID in the below case:
ps -aef | awk '{print $2}’
To search descriptors in use:
pfiles `ps -aef | awk '{print $2}’` > descriptors.txt
prtconf — To get system information.
gcc/dcc compilation with -E option gives precompilaton output
gcc/dcc -E …… | less [This will help in seeing the output]
To change the date:
date mmddHHMM[[cc]yy]
cc – century
yy – year
wall – To broadcast message
ndd – get and set driver configuration parameters
ndd /dev/tcp
Related Articles:
- 2010/06/25 ack on solaris – grep recursively.
- 2010/06/11 for loop in bash script on solaris without seq
- 2010/05/19 Solaris Tips and Tricks
- 2010/05/12 Linux tip to find the pid/program using a particular port
- 2010/05/06 View entire process string
Authored By Amit Agarwal
Amit Agarwal, Linux and Photography are my hobbies.Creative Commons Attribution 4.0 International License.