Linux Basic Commands and Description – Part 3

ethtool:

# ethtool eth0		(view ethernet device properties)

# ethtool -s eth0 autoneg off		(make changes in NIC parameter, use "-s")

# ethtool -s eth0 speed 100 autoneg off duplex full	(change the speed of ethernet card)

# ethtool -i eth0	(Display driver settings)

# ethtool -a eth0	(Display Auto-negotiation, RX and TX)

# ethtool -S eth0	(Display Network Statistics)

# ethtool -p eth0	(corresponding LED of physical port to blink)
	
# ethtool -p eth2 15	(corresponding LED of physical port to blink for 15s)

Commands related to NFS:

# showmount 	(Shows the available shares on your local machine

# showmount -e <server-ip or hostname>  (Lists the available shares at the remote server)

# showmount -d  (Lists all the sub directories)

# exportfs -v   (Displays a list of shares files and options on a server)

# exportfs -a   (Exports all shares listed in /etc/exports, or given name)

# exportfs -u   (Unexports all shares listed in /etc/exports, or given name)

# exportfs -r   (Refresh the server’s list after modifying /etc/exports)

# nfsstat –s 	(to check nfs server version)

# nfsstat –c	(to check nfs client version)

Crontab:

“minute” “hour” “date of month” “month” “day of week” “command”
Minute: 0-59
Hour: 0-23
Date of Month: 1-31
Month: 1-12
Day of Week: 0-7, 0 and 7 are Sunday.

# crontab –e 	(edit cron file)
# crontab –l 	(list cron jobs)
# crontab –l –u <user>	(list cron jobs for user)

Schedule a Job for more than one instance (e.g. Twice a Day)

# 00 11,16 * * * /home/test/test.sh

Schedule a job for specific range of time (Only on weekdays)

# 00 09-18 * * 1-5 /home/test/test.sh

Schedule a Background Cron Job For Every 10 Minutes

# */10 * * * * /home/ramesh/check-disk-space

Cluster Related Commands:

# clustat		(To check status of cluster)

# clustat –m 		(Display status of specific cluster node)

# clustat –s 		(Display status of specific service)

# clustat –l		(Display long format of services)

# cman_tool status	(Display local record of cluster status)

# cman_tool nodes	(Display local record of cluster nodes)

# ccs_tool  lsnode	(Display nodes)

# ccs_tool lsfence 	(List fence devices)

# clusvcadm –e <service_name>		(start the service on preferred node)

# clusvcadm –e <servive_name> -m node 	(start the service on mentioned node)

# clusvcadm –d <service_name>		(Stop the service and put it into disable state)

# clusvcadm –r <service_name> -m node	(Relocating service on mentioned node)

# clusvcadm –s <service_name>		(Stop the service and placed into the stopped state)

# clusvcadm –Z <service_name> 		(Freeze service on the node where it is currently running)

# clusvcadm –U				(Unfreez it)

# clusvcadm –R <servive_name>		(Restart a service)

Few commands to check shared storage details:

# scsi_id --whitelisted --device=/dev/sdh

# lspci | grep -i HBA

# lspci | grep -i Fibre

# lspci -nn | grep -i hba

# ls -l /dev /dev/mapper |grep '^b'

# ls -l /dev/disk/by-id/

# ls -l /dev/disk/by-path/

# ls -l /dev/disk/by-uuid/

# ls -l /sys/class/fc_host/

# ls -l /sys/block/

# dmesg | grep -i "attached"

# lsblk -o KNAME,TYPE,SIZE,MODEL

# echo "- - -" > /sys/class/scsi_host/host1/scan

Leave a Reply

Your email address will not be published. Required fields are marked *