Linux commands

Click on the headings to sort

CommandCommon Arguments & DescriptionOSCommand Description
chkconfig--list (Lists all of the services which chkconfig knows about, and whether they are stopped or started in each runlevel)RedhatUpdates and queries runlevel info for system services
dmidecode (No arguments - Show description of system hardware components)LinuxDump a computer's DMI (SMBIOS) table contents
echo"- - -" > /sys/class/scsi_host/hostX/scan (Initiate a SCSI bus rescan, where X stands for the SCSI bus to be scanned)LinuxRescan a linux SCSI bus
fdisk-l (List partition tables for devices)LinuxPartition table manipulator
fdisk/dev/sda1 (Run interactive menu on /dev/sda1)LinuxPartition table manipulator
lspci-vv (Be very verbose and display info about all PCI buses and devices)LinuxList all pci devices
lsraid-A -a /dev/md0 (Display a short listing of md0)LinuxList and query Linux md devices
lsscsi-c (Classic output)LinuxList all SCSI devices or hosts on system
lvchange-pr vg00/lv2 (changes permission of LV lv2 in VG vg00 to be read-only)LinuxChanges attributes of a logical volume
lvcreate-L 2G -n datalv datavg (Create a 2GB LV named datalv in VG datavg)LinuxCreate an LV in an existing VG
lvdisplay-m (Display mapping of logical extents to physical volumes and extents)LinuxDisplay attributes of a logical volume
lvdisplay-v (Display verbose info of all logical volumes such as status, size, associated VG etc)LinuxDisplay attributes of a logical volume
lvextend-L 40G /dev/system/root (Extend LV "/dev/system/root" to size 40G)LinuxExtend the size of a logical volume
lvscanLinuxScan all disks for logical volumes
mdadm--create /dev/md0 --level=1 --raid-devices=2 /dev/sdb /dev/sdc (Create a RAID 1 volume from two drives)LinuxCreate an MD (Multiple Device) software raid device
mdadm--detail /dev/md0 (View status of /dev/md0)LinuxView status of MD (Multiple Device) software raid devices
mdadm-Es | grep md0 >>/etc/mdadm.conf (Add RAID device md0 to /etc/mdadm.conf so that it can be seen at boot)LinuxMake MD (Multiple Device) software raid devices persistent at boot
mkfs.ext3/dev/datavg/datalv (Create an ext3 file system on the LV)LinuxMake an ext3 file system
mkfs.reiserfs/dev/datavg/datalv (Create a reiserfs file system on the LV)SuseMake a reiserfs file system
mkswap/dev/rootvg/swaplv (Sets up a linux swap area on the logical volume swaplv)LinuxFormat a device or file as a Linux swap area
mount-o loop disk1.iso /mnt/disk1 (Mounts disk1.iso on directory /mnt/disk1 as a loopback deviceLinuxMount an iso image via a loopback device
mount-o remount,rw /LinuxRemounts / read write in failsafe or single user mode
mount-t iso9660 -o ro /dev/sr0 /mnt/cdrom (mount the CDROM in the cdrom drive /dev/sr0 onto /mnt/cdrom)LinuxMounting a CDROM
mppUtil-a (Print table of arrays currently detected by this host)LinuxRDAC (a.k.a. MPP) Driver Utility
pvcreate/dev/sdd (Initialize /dev/sdd)LinuxInitialize a disk or partition for use by LVM
pvdisplay-v (Display verbose info of all physical volumes, such as their associated volume group)LinuxDisplay attributes of a physical volume
resize_reiserfs/dev/system/root (Resize the filesystem to the size of the LV)SuseResize reiserfs filesytem
servicentpd start (Start the ntpd service)RedhatStart, stop or restart services
SPident-vvv (Maximum verbosity)SuseTry to identify service pack level
swapon-v /dev/rootvg/swap1lv (Enables the logical volume swap1lv as swap, with verbosity (-v))LinuxSpecify devices on which paging and swapping occur
sysctl-a (Display all values currently available)LinuxConfigure kernel parameters at runtime
sysctlvm.swappiness=40 (Modify swappiness value - possible values 0 to 100; indicates the degree to which the kernel favours swap space over main memory, higher values favour swap)LinuxConfigure kernel parameters at runtime
tune2fs-m 1 /dev/system/logs (Set the percentage of reserved filesystem blocks to 1%)LinuxAdjust tunable filesystem parameters on ext2/ext3 filesystems
vgchange-a y /dev/vg01 (Activate volume group vg01 or "-a n" to deactivate)LinuxChanges attributes of a volume group
vgcreatevg00 /dev/sdd (Create VG called vg00 using /dev/sdd)LinuxCreate a volume group
vgdisplay-v (Display verbose info of all volume groups including the physical and logical volumes)LinuxDisplay attributes of volume groups
vgextendvg00 /dev/sdd (Add /dev/sdd to existing volume group vg00)LinuxAdd physical volumes to a volume group
yumgroupinstall "X Window System" "KDE Desktop" (Install X windows and KDE)Linuxyum Yellowdog Updater Modified package management utility used on Redhat and CentOS
yumgroupremove "KDE Desktop" groupremove_leaf_only=1 (Uninstall KDE, don't remove any packages that are required by any other packages or groups)Linuxyum Yellowdog Updater Modified package management utility used on Redhat and CentOS
yumlist updates (List packages in an enabled repository which is an update for any installed package)Linuxyum Yellowdog Updater Modified package management utility used on Redhat and CentOS
yumupdate (Update all installed packages)Linuxyum Yellowdog Updater Modified package management utility used on Redhat and CentOS
yumupdate httpd (Update the httpd package)Linuxyum Yellowdog Updater Modified package management utility used on Redhat and CentOS