What is iostat?
4 iostat examples
Syntax and Options
Related Commands
What is iostat?
Iostat command reports CPU and I/O statistics. iostat command is used during performance analysis to narrow down the problematic areas in the system.
Sample output of iostat command and its explanation:
$ iostat
Linux 2.6.31-17-generic (sathiya-laptop) 05/25/10 _i686_ (1 CPU)
avg-cpu: %user %nice %system %iowait %steal %idle
25.99 0.78 7.43 12.77 0.00 53.03
Device: tps Blk_read/s Blk_wrtn/s Blk_read Blk_wrtn
sda 27.40 797.19 201.27 800902 202208
sr0 0.03 1.24 0.00 1248 0
The first line displays general information — Linux kernel version, hostname etc.,
Next two lines displays CPU statistics, in which the first 3 column displays average CPU usage. The 4th column displays the percentage of time the CPU were idle and waited for I/O response. 5th column displays percentage of waiting time of virtual CPU. 6th column displays the percentage of time the CPU is idle.
Remaining line displays the device utilization report. First line in that is headers, such as number of Transfer per second, number of blocks read per second, blocks write per second, total block reads, total block writes.
[click to continue…]
What is chmod?
3 chmod examples
Syntax and Options
Related Commands
What is chmod?
chmod stands for change mode, which changes the file or directory mode bits. To put it simply, use chmod command to change the file or directory permissions.
Following is a sample of ls -l command output. In this, the 9 characters from 2nd to 10th position represents the permissions for the 3 types of users.
-rw-r--r-- 1 john john 272 Mar 17 08:22 test.txt
In the above example:
- User (john) has read and write permission
- Group has read permission
- Others have read permission
Three file permissions:
- read: permitted to read the contents of file.
- write: permitted to write to the file.
- execute: permitted to execute the file as a program/script.
Three directory permissions:
- read: permitted to read the contents of directory ( view files and sub-directories in that directory ).
- write: permitted to write in to the directory. ( create files and sub-directories in that directory )
- execute: permitted to enter into that directory.
Numeric values for the read, write and execute permissions:
To have combination of permissions, add required numbers. For example, for read and write permission, it is 4+2 = 6.
[click to continue…]
What is umount?
3 umount examples
Syntax and Options
Related Commands
What is umount?
umount stands for unmount, which unmounts the file system. Use umount to unmount a device / partition by specifying the directory where it has been mounted.
Following is the partial output of the mount command.
# mount
/dev/sdb1 on /mnt type vfat (rw)
Device /dev/sdb1 is mounted on /mnt, from where all your process will be accessing the data available on that device.
For some reason, if you like to physically detach the /dev/sdb1 device, you should first unmount it (to logically detach the device).
[click to continue…]
Question: Someone sent me a *.chm file. I don’t have windows machine. Is it possible to view a *.chm file on a Linux system.?
Answer: Use kchmviewer to view chm files as explained below.
[click to continue…]
When you execute a Unix job in the background ( using &, bg command), and logout from the session, your process will get killed. You can avoid this using several methods — executing the job with nohup, or making it as batch job using at, batch or cron command.
[click to continue…]
Tee command is used to store and view (both at the same time) the output of any other command.
Tee command writes to the STDOUT, and to a file at a time as shown in the examples below.
[click to continue…]
Using gpg you can generate private and public keys that can be used to encrypt and decrypt files as explained in this example.
[click to continue…]