All
===
>stat -c 'major: %t minor: %T' <device> -> Lists device major and
minor numebres {ex: stat -c 'major: %t minor: %T' /dev/sda}
>who �b -> last reboot time
>dmsetup -> device mapper setup utility
>wget <http_link> -> download some file from web (ex:
http://build-squid.eng.vmware.com/build/VMware-VSAClusterService-5.5.1.0-1568942-
linux.zip)
>ldd <program_name> -> print shared library
dependencies (ex: ldd /bin/bash)
>pkg-config --libs --cflags <lib_name> -> Checking the lib
configurations ex: pkg-config --libs --cflags vix-disklib
>file <file_name> -> shows ifnormation about a binary
>cat ~/.bashrc -> append permanent environment
variables exports in last line... ex{ echo 'export $TEST=$TEST:/usr/test' >>
~/.bashrc }
>ulimit -a -> Check core file size (core file size)
>ulimit -c unlimited -> to set core file size to
unlimited
>gdb <executable> <core_file_name) -> to analyze core file in linux
(ex: gdb sample core.31728)
>find <dir> -executable -type f -> find all executable files
in linux
>strings <file_name> -> To check detaisl about librrary
and etc... <ex: strings libssl.so >
>wall <message> -> send a message to everybody�s
terminal
Pipe
----
>ls | grep -v 201710 | xargs rm -rf -> Delete all files which
does not ahve string "201710"
Regular Expression
------------------
>grep datacenter servers.txt | awk '$3 > 20 {print ;}' | more (ex: this will
check for 3rd value in each line "b_datacenter, servers 21")
>ls -l | grep -Eo "h[0-9].*[0-9]+\.vmdk" | awk '{system("vmkfstools -U "$1)}'
=> list all vmdk files and delete it
>cat results.log | grep RESULT | grep SKIP | grep -Eo "vmfs.*.test" | sed
's/.test/.log/g' |awk 'print $1;system("grep -A 1 ERROR " $1);print "\n"}' -> Grep
ERROR in eacg test NG testcase log file
btrfs
------
>mkfs.btrfs /dev/sdb1
>mount /dev/sdb1 /testdir
>cd /testdir
>touch bigfile1
>truncate -s 3T bigfile1
>btrfs filesystem show
IO Generation:
==============
>memhog -r100 4g -> simulates memory consumption by 4GB and run for
100 iterations
-----------------------------------------------------------------------------------
-----------------------------------------
Block/SCSI
==========
Target side
------------
Initiator sie
-------------
>lsscsi -> Lists all scsi devices (lsscsi -h -> for more info)
>lsblk -> Lists all block devices (lsblk -h -> for more info)
>iscsiadm -> open-iscsi administration utility
>echo 1 > /sys/bus/scsi/devices/H:B:T:L/delete -> make a SCSI disk disappear
with a 2.6 kernel
>cat /sys/bus/scsi/devices/H:B:T:L/timeout -> see disk timeout
>find /sys/class/scsi_generic/*/device/timeout -exec grep -H . '{}' \;
--> cmd to find guest OS disk timeout
>rescan-scsi-bus.sh -> rescan scsi bus
Linux Rescan - adding a new disc
Ref: https://www.certdepot.net/rhel7-configure-iscsi-target-initiator-persistently/
10) From initiator, connect to this iscsi target IP. LUNs will be visible
c) Create LUN
>targetcli /iscsi/iqn.20...:t1/tpg1/luns> create /backstores/block/block1
d) Check Params
-----------------------------------------------------------------------------------
-----------------------------------------
Kernel
======
>cat /proc/cmdline -> Reports the parameters passed to the kernel at boot.
NFS
---
>exportfs -o rw,no_root_squash 10.112.71.0/255.255.252.0:/testdir1 exporting a
dir using command
1. mount CD to /mnt
2. create file /etc/yum.repos.d/rhel-local.repo and add below contents
----
[rhel6.3-local]
name=RHEL 6.1 local repository
baseurl=file:///mnt/
gpgcheck=0
enabled=1
----
-----------------------------------------------------------------------------------
-----------------------------------------
SLES specific
-------------