Main Menu

Search

Showing posts with label Linux How To Doc. Show all posts
Showing posts with label Linux How To Doc. Show all posts

LINUX: fdisk Command To Check the Size of Partitions / Volumes/ Disks (How To Doc)

Below fdisk command can be used to check the size of all the partitions, volumes, disks on Linux Machine.
fdisk -l

Below is example snippet of above command.

Disk /dev/xvdb: 107.4 GB, 107374182400 bytes
64 heads, 32 sectors/track, 102400 cylinders
Units = cylinders of 2048 * 512 = 1048576 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000

    Device Boot      Start         End      Blocks   Id  System
/dev/xvdb1               2      102400   104856576   83  Linux

Disk /dev/mapper/VolGroup00-LogVol01: 34.4 GB, 34359738368 bytes
255 heads, 63 sectors/track, 4177 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000

Disk /dev/mapper/VolGroup00-LogVol00: 33.8 GB, 33831256064 bytes
255 heads, 63 sectors/track, 4113 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000

If you want to check the size of specific partition, volume below command can be used.

fdisk -s <name>

Below is example.
fdisk -s /dev/mapper/VolGroup00-LogVol00

Below is example snippet of above command.
# fdisk -s /dev/mapper/VolGroup00-LogVol00
33038336

Products to which Article Applies


All Linux Operating Systems

 

Additional Reference

 

https://www.tecmint.com/fdisk-commands-to-manage-linux-disk-partitions/

LINUX: Command To Check CPU Speed In Linux? (How To Doc)

Below command can be executed to check CPU Speed in Linux hosts.

date;time echo "scale=1000; 4*a(1)" | bc -l;date



Above command will print the date time before and after execution of the command and also display real, sys and user execution times for command execution. Below is example snippet of above command.

If the CPU speed and performance is ideal this command will finish in a second and the real, sys and user execution times will be lesser than a second.

Sat Aug 24 23:24:49 EDT 2019
3.141592653589793238462643383279502884197169399375105820974944592307\
81640628620899862803482534211706798214808651328230664709384460955058\
22317253594081284811174502841027019385211055596446229489549303819644\
28810975665933446128475648233786783165271201909145648566923460348610\
45432664821339360726024914127372458700660631558817488152092096282925\
40917153643678925903600113305305488204665213841469519415116094330572\
70365759591953092186117381932611793105118548074462379962749567351885\
75272489122793818301194912983367336244065664308602139494639522473719\
07021798609437027705392171762931767523846748184676694051320005681271\
45263560827785771342757789609173637178721468440901224953430146549585\
37105079227968925892354201995611212902196086403441815981362977477130\
99605187072113499999983729780499510597317328160963185950244594553469\
08302642522308253344685035261931188171010003137838752886587533208381\
42061717766914730359825349042875546873115956286388235378759375195778\
18577805321712268066130019278766111959092164201988
real    0m0.348s
user    0m0.305s
sys     0m0.003s
Sat Aug 24 23:24:50 EDT 2019

Products to which Article Applies

All Linux Environments

Additional References


https://gist.github.com/xaratustrah/225bc8bfc827447952c9


Linux: How To Uninstall / Remove rpm package(s) On Linux Hosts? ("rpm" command)

Below "rpm" command can be used to uninstall / remove .rpm rpm package(s) on Linux hosts.
rpm -ev <rpm name>.rpm

If you want to force uninstall / remove the rpm package below command can be used.

rpm -ev --force <rpm name>.rpm


Products to which Article Applies

All Linux Environments

Additional References

https://www.thegeekstuff.com/2010/07/rpm-command-examples


LINUX: Capture strace On Particular Process Into a File (How To Doc)

Below is command to capture strace of particular process into a file.

strace -p <PID> -o <outputfile>

For e.g. if you want to capture strace on PID 4444 and then save the output into /tmp/strace.out, your command will look as follows:

strace -p 4444 -o /tmp/strace.out

Products to which Article Applies


All Linux and UNIX environments

Additional References