You are on page 1of 4

L1 useful Linux commands

Inode information
I-node usage can be checked
[root@bemlx2 ~]# df -i /var
Filesystem
Inodes IUsed IFree IUse% Mounted on
/dev/mapper/vg00-lv_var
524288 3834 520454 1% /var
System information
# uname -a
Linux bemlx2.na.pg.com 2.6.9-34.ELhugemem #1 SMP Fri Feb 24 17:04:34 EST 2006
i686 i686 i386 GNU/Linux
cat /etc/redhat-release shows the current OS version and update
Server hardware details (serial number, model, bus details) can be found by using
the below command
# dmidecode
# echo $LANG show you the current system language
# free m will give you the memory and swap information
#hwclock show shows the hardware clock
Swapon s also shows the swap information
lspci shows all PCI device information
lsusb shows all USB device Inormation
ifconfig a shows all the lancard information.
sysreport -> collect some detailed information
about the hardware and setup of your Red Hat Linux system.
/var/log/messages will have all the standard system error messages
/var/log/dmesg kernel boot messages
/var/log/secure security , authentication and xinetd messages
/var/log/ all other application related logs
File system
fdisk l shows all the partition information
cat /proc/partitions also serve the same .

Hardware addresses
Cat /proc/*
lspci -vvv
dmesg
dmidecode
/sbin/hpasmcli
Etc..
hpasmcli is a utility to check the system health, it is a command based utility
hpasmcli> show
SHOW ASR
SHOW BOOT
SHOW DIMM
SHOW F1
SHOW FANS
SHOW HT
SHOW IML
SHOW IPL
SHOW NAME
SHOW PORTMAP
SHOW POWERSUPPLY
SHOW PXE
SHOW SERIAL [ BIOS | EMBEDDED | VIRTUAL ]
SHOW SERVER
SHOW TEMP
SHOW UID
SHOW WOL
Eg:hpasmcli> SHOW SERVER
System
: ProLiant ML370 G4
Serial No. : USE626NBD9
ROM version : P50 11/09/2005
iLo present : Yes
Embedded NICs : 1
NIC1 MAC: 00:17:08:54:dd:b2
Processor: 0

hpasmcli> SHOW FANS


Fan Location
Present Speed of max Redundant Partner Hot-pluggable
--- -------------- ----- ------ --------- ------- ------------#1 PROCESSOR_ZONE Yes
NORMAL 5%
No
N/A
Yes
#2 PROCESSOR_ZONE Yes
NORMAL 5%
No
N/A
Yes

#3 PROCESSOR_ZONE Yes
#4 PROCESSOR_ZONE Yes

NORMAL 5%
NORMAL 5%

No
No

N/A
N/A

Yes
Yes

Viewing kernel parameters


Tunable Parameter
sysctl a shows all kernel tunables
Loadable Modules
Modules are small kernel extensions that may be loaded and unloaded at will.
Module files are stored in /lib/modules/$(uname r)/
We may also add thritparty modules
lsmod displays the modules loaded
modinfo can be used for displaying the module information
Package Installation
RPM (RedHat package manager)
system-config-packages menu driven utility for package managing .
rpm command is used for package managing Via command line
rpm qi <package name> information about the package
rpm qf <file name> shows owning package
rpm ql <package name> query the list of files in the package
Networking
/etc/sysconfig/network Global Network parameters like gateway , hostname .
/etc/sysconfig/network-scripts/ifcfg-eth0 configuration file for Ist LAN card
/etc/sysconfig/network-scripts/ifcfg-eth1 configuration file for IInd LAN card
mii-tool shows the link status and speed
ethtool <interface> will also shows the interface details
Sharing Files (NFS)
Daemons: nfsd ,lockd.statd portmap

system started (/etc/init.d/nfs.server (start | stop)


showmount e (displays the currently shared mount points)
showmount -a(remote mounts )

To Check System Access


To check for successful logins
last
To check for bad logins
lastb
To check for root access (and other su attempts e.g. su - oracle)
more /var/log/secure
There are also root history files for each user who executes sesu -
/var/opt/secu/log/root/.txxxxx

You might also like