Oracle Linux and Solaris command comparison

An update to an earlier post Solaris vs Linux differences with a specific look at Oracle Solaris 11 and Oracle Linux versions 6.5 and 7.1

Package management

In OEL, use the yum command to manage packages. In Solaris 11 we use the pkg command.

Basic Operation Oracle Enterprise Linux 6 & 7 Solaris 11
Check update yum check-update pkg update -nv
Update package yum update pkg-name pkg update pkg-name
Update all packages yum update pkg update
Install yum install pkg-name pkg install pkg-name
Search yum search search-string pkg search search-string
List installed pkgs yum list all pkg list
Display package info yum info pkg-name pkg info pkg-name

Password expiration

In OEL use the chage command to set user password expiration time. Solaris uses the passwd command.

Basic Operation Oracle Enterprise Linux 6 & 7 Solaris 11
Set maximum number of days chage -M 90 username passwd -x 90 username
Set minimum number of days chage -m 30 username passwd -n 30 username
Display password information chage -l username
Last password change: February 29, 2017
Password expires : Never
Password inactive : Never
Account expires : Never
Minimum number of days between password changes: 30
Maximum number of days between password changes: 90
Number of days of warning before expiry: 7
passwd -s username
oracle PS 02/29/17 30 90
|      |  |        |  +- max days till expiry
|      |  |        +- min days till expiry
|      |  +- last changed
|      +- status
+- user name

User management

Basic Operation OEL 6.5 OEL 7.1 Solaris 11
Add user useradd username useradd username
Update user ID usermod -u newUID username usermod -u newUID username
Delete user userdel username userdel username
Display password expiration date chage -l username passwd -s username
Set password expiration date chage -m 60 username passwd -x 60 username
Change account info (GCOS) chfn passwd -g

Network management

Basic Operation OEL 6.5 OEL 7.1 Solaris 11
Set IP address vi /etc/sysconfig/network-scripts/ifcfg-device
IPADDR=ipaddress
nmcli con mod device
ipv4.method
ipadm create-addr -T static -a local=ipaddr device
Configure DHCP vi /etc/sysconfig/network-scripts/ifcfg-device
BOOTPROTO=dhcp
nmcli con mod device
ipv4.method auto
ipadm create-addr -T dhcp device
Check IP address ifconfig ip address ipadm show-addr
Configure gateway vi /etc/sysconfig/network
GATEWAY=ipaddr
nmcli con mod device
ipv4.gateway ipaddr
route -p add netaddr ipaddr
Check gateway info netstat -rn ip route netstat -rn
Display device status ethtool eth0 nmcli device status dladm show-link
dladm show-phys

Service management

Basic Operation OEL 6.5 OEL 7.1 Solaris 11
Start service service svcname start systemctl start svcname svcadm enable -t svcname
Enable and autostart service svcname start
chkconfig svcname on
systemctl start svcname
systemctl enable svcname
svcadm enable svcname
Stop service servce svcname stop systemctl stop svcname svcadm disable -t svcname
Disable service service svcname stop
chkconig svcname off
systemctl stop svcname
systemctl disable svcname
svcadm disable svcname
List services chkconfig --list sytemctl list-units-files --type service svcs -a
Display service status service svcname status systemctl status svcname svcs svcname

File system / Storage management

Basic Operation OEL 6.5 OEL 7.1 Solaris 11
Create volume/pool vgcreate volume_group device_name zpool create poolname RAID device_name
Create logical vol lvcreate -L size -n logical-name vol-group zfs create filesys-name
Create snapshot lvcreate -s -L size -n snapshot-name orig-device zfs snapshot snapshot-name
Roll back from snapshot lvconvert --merge snapshot-name zfs rollback snapshot-name
Backup file system dump 0fu -f backup-file partition xfsdump -l level -f backup-file partition zfs send snapshot-name
Restore file system restore -r -f backup-file xfsrestore -f backup-file -s session-id desination zfs receive snapshot-name
Operate partition parted
fdisk
format

System monitoring

Basic Operation OEL 6.5 OEL 7.1 Solaris 11
Check CPU, memory, I/O mpstat, vmstat, iostat, iotop, netstat mpstat, pgstat, vmstat, iostat, fsstat, netstat, flowstat, dlstat, ipmpstat
Check CPU memory and expansion cards cat /proc/cpuinfo
cat /proc/meminfo
lspci
prtdiag
Confirm network communication ping, ethtool ping, dladm
Check process state ps, pstree ps, ptree
Process trace strace truss
System uptime uptime uptime
Load per process top, pidstat top, prstat