This collection of Solaris OS interview questions has been updated for clarity, modern syntax, and practical context. Each answer includes additional commentary explaining when and why the command is used.
ls -lS
-S flag sorts files by size (largest first). You can combine it with -h for human-readable sizes: ls -lhS.
ls -a | grep "^\."
.). The -a flag ensures these files are listed.
grep -v '^$' sample.txt > new_sample.txt
new_sample.txt. Alternatively, use sed '/^$/d' sample.txt.
grep "Debug" *.conf
tail -f Debug.log
tail -f continuously displays appended lines—useful for monitoring logs while a process is running.
du -k * | sort -nr
-h for a human-readable format.
cd CDMA_3X_GEN*
find . -type f
export DISPLAY=$(who am i | awk -F'[()]' '{print $2}')
who am i and sets it for graphical display redirection.
ps -ef | grep $USER
ps -fu $USER is also valid.
Ctrl+l — Clear screenCtrl+r — Search command historyCtrl+u — Clear text before cursorCtrl+a — Move to start of commandCtrl+e — Move to end of commandCtrl+d — Exit shellCtrl+z — Suspend current processls -lhS
man top | col -b > top_help.txt
echo "Script executed at $(date)" >> timeinfo.inf
iostat -E
du -k
sort -nr for ranking.
du -sk * | sort -nr | head
quot -af
repquota -a serves the same purpose.
cat /dev/null > filename1
touch filename1 to create an empty file.
alias psme='ps -ef | grep -i $USER'
pagesize
arp -a
netstat -an | grep ESTABLISHED
netstat -i
ptree <pid>
ptree 1267.
pwdx <pid>
pfiles <pid>
ipcs
prstat -s cpu
prstat is Solaris’s preferred process monitor, sorted here by CPU usage.
top command.prstat -a
top but optimized for Solaris.