stat – display file or file system status

A UNIX Command stat -f / $stat -f / File: “/” ID: bc427fdafb7b0541 Namelen: 255 Type: ext2/ext3 Block size: 4096 Fundamental block size: 4096 Blocks: Total: 18864769 Free: 16209639 Available: 15251363 Inodes: Total: 4792320 Free: 4684854 $ UNIX Explanation Display file or file system status. Related Source Code Exposition static bool do_statfs (char const *filename, …

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 …

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 …