This is a collection of commands that I used on various systems. I do not guarantee their accuracy.
Very useful reference: http://www.redbooks.ibm.com/redbooks/pdfs/sg247186.pdf.
Cross Reference of Linux and Solaris Administration Commands
Category | Task | RHEL / CentOS / Fedora | SUSE | Ubuntu / Debian | Solaris | Notes |
---|---|---|---|---|---|---|
Disk Partitions | Create | fdisk, parted, gparted | fdisk, parted, gparted | fdisk, parted, gparted | format, fmthard | |
Disk Partitions | Display | fdisk, parted, gparted | fdisk, parted, gparted | fdisk, parted, gparted | prtvtoc | max partitions on solaris is 7 |
Disk Partitions | Maximum | SCSI=15, IDE=63 | SCSI=15, IDE=63 | SCSI=15, IDE=63 | 7 | |
File System | Create | mkfs, mkfs.ext3, parted, gparted | mkfs, mkfs.ext3, mkfs.reserfs, parted, gparted | mkfs, mkfs.ext3, parted, gparted | mkfs, newfs | |
File System | Check | fsck | fsck | fsck, badblocks | fsck | |
Swap | Create swap space | mkswap | mkswap | mkswap | swap -a | |
Swap | Enable swap space | swapon | swapon | swapon | swap -a | |
Swap | Display swap space usage | swapon -s | swapon -s | swapon -s | swap -s | |
Swap | Display swap space status | swap -l | swap -l | swap -l | N/A | |
Swap | Disable swap space | swapoff | swapoff | swapoff | N/A | swapoff -a (all swap spaces) |
Swap | Delete swap space | rm | rm | rm | swap -d | |
Swap | Set swap priority level | swapon -p | swapon -p | swapon -p | N/A | |
LVM | Initialize a disk | pvcreate, mkraid, mdadm | pvcreate, mkraid, mdadm | pvcreate, mkraid, mdadm | metainit | |
LVM | Create volume or volume group | lvcreate LVname vgcreate VGname devicename mkraid, mdadm | lvcreate LVname vgcreate VGname devicename mkraid, mdadm | lvcreate LVname vgcreate VGname devicename mkraid, mdadm | metainit volname raidtype devices ... | |
LVM | Enable volume or volume group | lvchange -a y LVname vgchange -a y VGname raidstart | lvchange -a y LVname vgchange -a y VGname raidstart | lvchange -a y LVname vgchange -a y VGname raidstart | N/A | |
LVM | Disable volume or volume group | lvchange -a n LVname vgchange -a n VGname raidstop, mdadm | lvchange -a n LVname vgchange -a n VGname raidstop, mdadm | lvchange -a n LVname vgchange -a n VGname raidstop, mdadm | N/A | |
LVM | Delete volume or volume group | lvremove LVname vgremove VGname | lvremove LVname vgremove VGname | lvremove LVname vgremove VGname | metaclear | |
LVM | Add a device to volume or volume group | lvextend LVname vgextend VGname newdevname | lvextend LVname vgextend VGname newdevname | lvextend LVname vgextend VGname newdevname | metattach or metainit | |
LVM | Delete a device from the volume or volume group | lvreduce LVname vgreduce VGname devicename raidreconf | lvreduce LVname vgreduce VGname devicename raidreconf | lvreduce LVname vgreduce VGname devicename raidreconf | metadetach | |
AutoFS | Daemon | automount | automount | automount | automountd | not a command but useful |
AutoFS | Master cfg file | /etc/auto.master | /etc/auto.master | /etc/auto.master | /etc/auto_master | not a command but useful |
AutoFS | Other cfg file | /etc/auto.misc | /etc/auto.misc | /etc/auto.misc | /etc/auto_home | not a command but useful |
File System | CD-ROM | iso9660 | iso9660 | iso9660 | hsfs | not a command but useful |
File System | DVD | udf | udf | udf | udf | not a command but useful |
File System | Windows | vfat | vfat | vfat | pcfs | not a command but useful |
File System | Linux/unix | ext2, ext3, ext4, xfs | ext2, ext3, ext4, xfs | ext2, ext3, ext4, xfs, reiserfs | ufs | |
LVM | Create a soft partition or logical volume (no RAID) | lvcreate -Lsize -nLVname VGname | lvcreate -Lsize -nLVname VGname | lvcreate -Lsize -nLVname VGname | metainit -p | |
LVM | Create a soft partition or logical volume (RAID 0) | lvcreate -iNumOfStripes -IStripeSize -nLVname VGname mdadm, mkraid | lvcreate -iNumOfStripes -IStripeSize -nLVname VGname mdadm, mkraid | lvcreate -iNumOfStripes -IStripeSize -nLVname VGname mdadm, mkraid | metainit with RAID 0 on devices first, then metainit -p to create the soft partition volume | |
LVM | Create a soft partition or logical volume on a specific device | lvcreate -iNumOfStripes -IStripeSize -nLVname VGname mdadm, mkraid + devicename | lvcreate -iNumOfStripes -IStripeSize -nLVname VGname mdadm, mkraid + devicename | lvcreate -iNumOfStripes -IStripeSize -nLVname VGname mdadm, mkraid + devicename | metainit with RAID 0 on devices first, then metainit -p to create the soft partition volume + devicename | |
LVM | Delete a soft partition or logical volume | lvremove /dev/VGname/LVname raidreconf | lvremove /dev/VGname/LVname raidreconf | lvremove /dev/VGname/LVname raidreconf | metaclear | |
LVM | Extend a volume or logical volume | lvextend -Lsize /dev/VGname/LVname raidreconf | lvextend -Lsize /dev/VGname/LVname raidreconf | lvextend -Lsize /dev/VGname/LVname raidreconf | metattach volume | |
LVM | Extend a file system after volume has been grown | resize2fs, resize_reiserfs | resize2fs, resize_reiserfs | resize2fs | growfs | |
LVM | Reduce a volume or logical volume | resize2fs, lvreduce | resize2fs, lvreduce | resize2fs, lvreduce | metadetach Volname devicename | |
LVM | Set up or display metadb | vgdisplay, lvdisplay, lsraid | vgdisplay, lvdisplay, lsraid | vgdisplay, lvdisplay, lsraid | metadb | |
LVM | Display metadevice status | vgdisplay, lvdisplay cat /proc/mdstat | vgdisplay, lvdisplay cat /proc/mdstat | vgdisplay, lvdisplay cat /proc/mdstat | metastat | |
LVM | Initialize raw devices to metadevices | pvcreate | pvcreate | pvcreate | metainit | |
LVM | Attach metadevices | vgchange, lvchange | vgchange, lvchange | vgchange, lvchange | metattach | |
LVM | Detach metadevices | vgchange, lvchange | vgchange, lvchange | vgchange, lvchange | metadetach | |
LVM | Clear and remove metadevices | vgremove, lvremove | vgremove, lvremove | vgremove, lvremove | metaclear | |
LVM | Replace a metadevice | raidreconf | raidreconf | raidreconf | metareplace | |
LVM | Rename a volume | raidreconf | raidreconf | raidreconf | metarename | |
LVM | Check metadevice ID configuration | mdadm | mdadm | mdadm | metadevadm | |
LVM | Manage hot spares | mdadm, raidhotadd, raidhotremove | mdadm, raidhotadd, raidhotremove | mdadm, raidhotadd, raidhotremove | metahs | |
LVM | Set submirrors offline | mdadm | mdadm | mdadm | metaoffline | |
LVM | Set submirrors online | mdadm | mdadm | mdadm | metaonline | |
LVM | Change volume parameters | vgchange, lvchange | vgchange, lvchange | vgchange, lvchange | metaparam | |
LVM | Back up volume group metadata | vgcfgbackup | vgcfgbackup | vgcfgbackup | N/A | |
LVM | Recover soft partition configuration information | vgcfgrestore | vgcfgrestore | vgcfgrestore | metarecover | |
LVM | Set up root file system for mirroring | N/A | N/A | N/A | metaroot | |
LVM | Administer disk sets for sharing | N/A | N/A | N/A | metaset | |
LVM | Resynchronize volume during reboot | N/A | N/A | N/A | metasync | |
LVM | Expand a file system size | vgextend, lvextend, resize2fs, resize_reiserfs, raidreconf | vgextend, lvextend, resize2fs, resize_reiserfs, raidreconf | vgextend, lvextend, resize2fs, resize_reiserfs, raidreconf | growfs | |
LVM | Has entries that starts up the kernel metadevice modules | N/A | N/A | N/A | /etc/system | not a command, file |
LVM | Sets the default number of available volumes | /etc/sysconfig/lvm /etc/raidtab | ? | ? | /kernel/drv/md.conf | |
LVM | Scan for devices visible to LVM2 | lvmdiskscan | lvmdiskscan | lvmdiskscan | N/A | |
LVM | Scan disks for logical volumes | lvscan | N/A | |||
LVM | Display physical volume attributes | pvdisplay | pvdisplay | pvdisplay | N/A | |
LVM | Report physical volume information | pvs | pvs | pvs | N/A | |
LVM | Scan all supported logical volume block devices for physical disk | pvscan | pvscan | pvscan | N/A | |
LVM | Perform consistency check on the volume group | vgck | vgck | vgck | N/A | |
LVM | Scan all disks for volume group data and rebuild caches | vgscan | vgscan | vgscan | N/A | |
LVM | Import a volume group to this server | vgimport | vgimport | vgimport | N/A | |
LVM | Export a volume group out of this server | vgexport | vgexport | vgexport | N/A | |
Pkg | Install packages | rpm -i yum install | ? | apt-get install | pkg install | |
Pkg | Display installed packages | rpm -qa yum list installed | ? | dpkg -l | pkginfo or pkparam | |
Pkg | Remove software package | rpm -e yum remove | ? | apt-get remove | pkgrm | |
Pkg | Upgrade/install package | rpm -U yum upgrade/update | ? | apt-get upgrade/update | pkg update | |
Pkg | Verify correct installation | rpm -V yum-verify | ? | apt-get check or debsums | pkgchk | |
Pkg | List the contents of an installed package | rpm -ql package-name | ? | apt-file list package-name | Look in /var/sadm/install/contents rpm - | |
Pkg | Which package contains a file | rpm -qf filename | ? | apt-file search filename | Look in /var/sadm/install/contents | |
Pkg | List all available packages | yum list | ? | dpkg -l \* | pkg list -n | It is odd that you cannot do this with rpm. |
Pkg | Report package information | rpm -qi yum info package-name | ? | apt-cache showpkg package-name | Look in /var/sadm/pkg/PKGNAME/pkginfo | |
Patch | Install a patch | rpm -F yum update | ? | apt-get update | patchadd | Package mgmt in linux is different. |
Patch | Remove a patch | N/A | N/A | N/A | patchrm | Package mgmt in linux is different. |
Patch | Display installed patches | N/A | N/A | N/A | showrev -p | Package mgmt in linux is different. |
KMod | Install module | insmod | insmod | insmod | modload | |
KMod | List modules | lsmod | lsmod | lsmod | modinfo | |
KMod | Remove module | rmmod | rmmod | rmmod | modunload | |
Network | Configure TCP/IP | /etc/sysconfig/network and /etc/sysconfig/networking/* | /etc/network/interfaces /etc/NetworkManager | /etc/hostname.* /etc/inet/* /etc/defaultrouter /etc/defaultdomain /etc/nodename /etc/netmasks | ||
Network | Display interface settings | ifconfig ip | ifconfig ip | ifconfig ip | ifconfig -a | |
Network | Display interface status and statistics | netstat -i | netstat -i | netstat -i | netstat -i | |
Network | Configure interface | ifconfig ip | ifconfig ip | ifconfig ip | ifconfig | |
Network | Display network statistics | netstat | netstat | netstat | netstat | |
Network | Change resolver | /etc/resolv.conf | /etc/resolv.conf | /etc/resolv.conf | /etc/resolv.conf | |
Network | Change name services | /etc/nsswitch.conf | /etc/nsswitch.conf | /etc/nsswitch.conf | /etc/nsswitch.conf | |
Network | Display kernel network params | sysctl -a | grep ^net | sysctl -a | grep ^net | sysctl -a | grep ^net | ndd /dev/ip \? ndd /dev/tcp \? | |
Network | Configure kernel network params | sysctl -w variable=value | sysctl -w variable=value | sysctl -w variable=value | ndd | |
Network | Check for network link | ethtool mii-tool | ethtool mii-tool | ethtool mii-tool | ndd | |
Network | Rename interface | ip | ip | ip | N/A | |
Network | Check routing table | netstat -r route | netstat -r route | netstat -r route | netstat -r | |
Network | Ping | ping | ping | ping | ping | |
Network | Trace router | traceroute zenmap | traceroute zenmap | traceroute zenmap | traceroute | |
Network | Check ports | nmap zenmap | nmap zenmap | nmap zenmap | nmap | |
Network | Capture packets | tcpdump tethereal ethereal wireshark | tcpdump tethereal ethereal wireshark | tcpdump tethereal ethereal wireshark | snoop wireshark | |
NFS | Manually start NFS server | /etc/init.d/nfs start /etc/init.d/nfsserver service nfs start /etc/init.d/nfs-kernel-server start | ? | ? | /etc/init.d/nfs.server start | |
NFS | Mount clinet | mount server://resource /mnt/point | ? | ? | mount -F nfs server://resource /mnt/point | |
NFS | Server config file | /etc/sysconfig/nfs | /etc/default/nfs-kernel-server /etc/default/nfs-common | ? | /etc/default/nfs / | |
NFS | Share all exported file systems | exportfs -a | exportfs -a | exportfs -a | shareall | |
NFS | Share one exported file system | exportfs -o | exportfs -o | exportfs -o | share | for new file systems |
NFS | Config file | /etc/exports | /etc/exports | /etc/exports | /etc/dfs/dfstab | |
Device Creation | Create device files | udev | udev | udev | devfsadm |