Solaris · Basic Commands

Solaris · Lesson 3

Basic Commands

Daily use Solaris terminal commands for system administrators. File operations, navigation and system information commands. Difference between Linux and Solaris behavior. Practical production examples.

Why start with basic commands?

Before touching services, networking or ZFS, you should be completely comfortable with moving around the system and running simple read-only commands. Yeh sab commands aap har Solaris session mein use karoge.

Is lesson mein hum mainly safe, non-destructive commands cover karenge jo sirf information dikhate hain—kuch todte nahi 🙂.

Basic command flow in a Solaris session

Yeh ek typical flow hai jab aap nayi Solaris machine par login hote ho: system info check, current path dekhna, files list karna, logs directory visit karna, etc.

terminal — bash
solaris-lab
[root@solaris ~]# uname -a
SunOS sol11 5.11 11.4.0.15.0 i86pc i386 i86pc
 
[root@solaris ~]# pwd
/root
 
[root@solaris ~]# ls
Desktop Documents scripts backup.sh
 
[root@solaris ~]# cd /var/log
[root@solaris /var/log]# ls -l
total 12
-rw-r--r-- 1 root root 10240 Jan 10 10:22 messages
-rw-r--r-- 1 root root 2048 Jan 10 10:10 secure
 
[root@solaris /var/log]# cat /etc/release
Oracle Solaris 11.4
Assembled xx Month 20xx
 
[root@solaris /var/log]# df -h
Filesystem Size Used Available Capacity Mounted on
rpool/ROOT/solaris 40G 10G 30G 25% /
 
[root@solaris /var/log]# ps -ef | head
UID PID PPID C STIME TTY TIME CMD
root 0 0 0 Jan 10 ? 0:03 sched
root 1 0 0 Jan 10 ? 0:05 /sbin/init

Command categories you should know

Instead of ratta-marofying random commands, yaad rakho ki har command ek category mein fit hota hai. Neeche 4 main categories hain.

System information

uname, date, whoami — commands to check OS version, current date/time and which user you are logged in as.

Navigation & listing

pwd, ls, cd — move between directories and list files in different formats (ls -l, ls -a, etc.).

Viewing file content

cat, more, less, tail — see configuration and log files without editing them.

Getting help

man, --help — in-built documentation so you can discover options yourself on any Solaris box.

Important commands in this lesson

System & session info

  • uname -a → complete OS + kernel info
  • uname -r → only OS release version
  • whoami → which user is logged in
  • date → current date & time on server

Navigation

  • pwd → print current directory
  • ls → list files (ls -l, ls -lh, ls -a)
  • cd /path → change directory
  • cd .. → go one level up

Viewing files safely

  • cat /etc/release → Solaris version
  • more /var/log/messages
  • less /var/log/messages (better for big files)
  • tail -f /var/log/messages → live log tailing

Processes & disk usage

  • df -h → disk usage in human readable format
  • du -sh * → size of folders in current directory
  • ps -ef → full process listing
  • ps -ef | head → just check top rows quickly

Practice task – do this on your VMware lab

  • Login to your Solaris VM and run all commands shown in the terminal demo above.
  • Note down the output of uname -a, df -h and ps -ef | head to understand your system profile.
  • Try using man for at least 3 commands (e.g. man ls, man df, man ps).
  • Don't worry about remembering everything – focus on getting comfortable typing and reading the outputs.

Next up, we move to user and group management where these basic commands will keep helping you.