Solaris Cheatsheet
#
Solaris is a Unix operating system originally developed by Sun Microsystems. It is known for its scalability, especially on SPARC systems, and for its innovative features such as DTrace, ZFS, and Zones. Below is a comprehensive cheatsheet to help you get started with Solaris, covering various commands and their descriptions.
Command | Description |
---|
uname -a | Display all system information |
prtdiag | Display system diagnostic information |
dmesg | Show system boot messages |
prstat | Display real-time system information |
ps -ef | List all running processes |
pkginfo | List installed packages |
pkgadd -d <package> | Install a package |
pkgrm <package> | Remove a package |
pfexec <command> | Run a command with elevated privileges |
User and Group Management
#
Command | Description |
---|
useradd <username> | Add a new user |
userdel <username> | Delete a user |
usermod -G <group> <username> | Add a user to a group |
groupadd <group> | Create a new group |
groupdel <group> | Delete a group |
passwd <username> | Change a user’s password |
Network Management
#
Command | Description |
---|
ifconfig -a | Display all network interfaces |
ping <hostname/IP> | Send ICMP ECHO_REQUEST to network hosts |
netstat -r | Display the routing table |
route add <destination> <gateway> | Add a static route |
svcadm restart network/physical | Restart network services |
ipadm | Manage IP interfaces and addresses |
dladm | Manage datalink interfaces |
Disk Management
#
Command | Description |
---|
df -h | Display disk usage in a human-readable format |
du -sh <directory> | Show disk usage of a directory |
mount | Display all mounted filesystems |
mount -F <fstype> <device> <mount_point> | Mount a filesystem |
umount <mount_point> | Unmount a filesystem |
format | Format and partition a disk |
zpool create <pool> <device> | Create a ZFS storage pool |
System Services and Daemons
#
Command | Description |
---|
svcadm enable <service> | Enable a service |
svcadm disable <service> | Disable a service |
svcadm restart <service> | Restart a service |
svcs -a | List all services |
svcs -x | List failed services |
svcs -l <service> | Display detailed information about a service |
File Operations
#
Command | Description |
---|
cp <source> <destination> | Copy files or directories |
mv <source> <destination> | Move or rename files or directories |
rm <file> | Delete a file |
rm -r <directory> | Delete a directory and its contents |
chmod <permissions> <file> | Change file permissions |
chown <owner>:<group> <file> | Change file owner and group |
ln -s <target> <link> | Create a symbolic link |