Linux

How to find disk utilization and latency: 
iostat -d -x 2 6
-d = display the device utilization report.
-x = display extended stats
2 = Display device report at 2 second intervals
6 = display 6 reports at 2 second intervals.

await = The average time (in milliseconds) for I/O requests issued to the device to be served. This includes the time spent by the requests in queue and the time spent servicing them.
r_await =  The average time (in milliseconds) for read requests issued to the device to be served. This includes the time spent by the requests in queue and the time spent servicing them.
w_wait =  The average time (in milliseconds) for write requests issued to the device to be served. This includes the time spent by the requests in queue and the time spent servicing them.


How to list the block devices attached to your server:
lsblk
How to use the vi editor
1. Create a backup copy of the file you plan to edit.  
2. Type vi and the file name to open the file in the vi text editor
3. Press “i” to enter Insert Mode.  -- INSERT -- will appear at the bottom left.
4. Make the necessary changes to the file.
5. To save changes and quit:
Press - Esc , : , w , q Enter
6. To quit without saving changes

Press - Esc , : , q  (add ! if needed), Enter

How to find which distribution of Linux you're running:
cat/etc/os-release

Finding a word in a file
grep WordImLookingFor vmkwarning.log

Finding total disk size
df -h --output=size --total
df -h --output=size --total | awk 'END {print $1}'
df -h --total
Extracting/unpacking a Tarball file
tar -xvf filename.tar

Unpacking or uncompressing gz file
tar -xyzf file.gz

How to create a copy of a file:
In the example below, a new copy of 123.vmx called 123backup.vmx is created in the same directory.
cp 123.vmx 123backup.vmx

How to Delete a file:
To delete a file called 123.txt
rm 123.txt

Showing Time:
date 

How to find default gateway:
route -n

How to find my DNS Servers:
cat /etc/resolv.conf

No comments:

Post a Comment