Display file or file system status.
Category Archives: operating system
vmstat – Report virtual memory statistics
A UNIX Command . vmstat -m Cache Num Total Size Pages fat_inode_cache 23 23 688 23 fat_cache 102 102 40 102 isofs_inode_cache 0 0 656 12 udf_inode_cache 23 23 712 23 fuse_request 0 0 632 25 fuse_inode 0 0 768 21 dm_crypt_io 0 0 152 26 kcopyd_job 0 0 368 22 dm_uevent 0 0 2608 …
Continue reading “vmstat – Report virtual memory statistics”
vmstat -m
vmstat reports information about processes, memory, paging, block IO, traps, disks and cpu activity. Slab Allocation Linux Slab Allocator.
getopt
getopt is used to break up (parse) options in command lines for easy parsing by shell procedures, and to check for legal options.
getopt – parse command options
commandline session $getopt hello — $getopt hello how are you ? — how are you 1 c h $getopt hello hello are you ? — hello are you 1 c h $getopt hello hello are yours ? — hello are yours 1 c h $getopt hello hello are yours what ? — hello are yours …
head
Print the first 10 lines of each FILE to standard output. Part of debian coreutils.
Understanding the Unix ‘head’ Command
commandline session head is a program on Unix and Unix-like operating systems used to display the beginning of a text file or piped data. $sudo head /var/log/syslog Jan 5 20:10:05 debian syslogd 1.5.0#6.1: restart. Jan 5 20:10:05 debian anacron[1056]: Job `cron.daily’ terminated Jan 5 20:10:05 debian anacron[1056]: Normal exit (1 job run) Jan 5 20:12:14 …
hexdump, hd — ASCII, decimal, hexadecimal, octal dump
The hexdump utility is a filter which displays the specified files, or standard input if no files are specified, in a user-specified format. $cat version.c #include #include int main(int argc, char **argv) { printf(“MySQL client version: %sn”, mysql_get_client_info()); } Commandline Session $hexdump version.c 0000000 6923 636e 756c 10064 3c20 796d 675f 6f6c 0000010 6162 2e6c …
Continue reading “hexdump, hd — ASCII, decimal, hexadecimal, octal dump”
Hacking with the “groups” GNU command
20.4 `groups’: Print group names a user is in ============================================= `groups’ prints the names of the primary and any supplementary groups for each given USERNAME, or the current process if no names are given. If more than one name is given, the name of each user is printed before the list of that user’s groups …
true and false
A UNIX Command $true $echo $? 0 $false $echo $? 1 $ UNIX Explanation true – do nothing, successfully exit with a status code indicating success. false – do nothing, unsuccessfully exit with a status code indicating failure. Related Source Code Exposition int main (int argc, char **argv) { if (argc == 2) { initialize_main …