Category: operating system

  • free – Display amount of free and used memory in the system

    A UNIX Command $free total used free shared buffers cached Mem: 507008 432908 74100 0 14700 186816 -/+ buffers/cache: 231392 275616 Swap: 1485972 0 1485972 $free -m total used free shared buffers cached Mem: 495 422 72 0 14 182 -/+ buffers/cache: 225 269 Swap: 1451 0 1451 $ UNIX Explanation Display amount of free […]

  • tee – read from standard input and write to standard output and files

    A UNIX Command $tee name my name is nice. my name is nice. $cat name my name is nice. $ UNIX Explanation Copy standard input to each FILE, and also to standard output. A special variant of the tee for the shell is called script and permits duplicating all input commands submitted to a shell […]

  • 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, […]

  • 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 […]

  • 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 […]

  • hexdump, hd — ASCII, decimal, hexadecimal, octal dump

    $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 3e68 230a 6e69 6c63 6475 20100 0000020 6d3c 7379 6c71 682e 0a3e 690a 746e 6d20 0000030 6961 286e 6e69 2074 7261 6367 202c […]

  • Hacking with the “groups” GNU command

    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 – do nothing, successfully. false – do nothing, unsuccessfully

    true – do nothing, successfully. false  – do nothing, unsuccessfully

    GNU command $true $echo $? 0 $false $echo $? 1 $ 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 (&argc, &argv); […]

  • setterm – set terminal attributes

    setterm – set terminal attributes

    GNU Command $setterm setterm: Argument error. Usage: setterm [options] Options: -term -reset -initialize -cursor -repeat -appcursorkeys -linewrap -default -foreground -background -ulcolor -ulcolor -hbcolor -hbcolor -inversescreen -bold -half-bright -blink -reverse -underline -store > -clear -tabs (tabn = 1-160) -clrtabs (tabn = 1-160) -regtabs -blank -dump -append -file dumpfilename -msg -msglevel -powersave -powerdown -blength -bfreq freqnumber -version […]

  • pstree – display a tree of processes

    ABOUT pstree pstree shows running processes as a tree. The tree is rooted at either pid or init if pid is omitted. If a user name is specified, all process trees rooted at processes owned by that user are shown. [bash] $pstree -A init-+-NetworkManager—3*[{NetworkManager}] |-accounts-daemon—2*[{accounts-daemon}] |-acpid |-at-spi-bus-laun-+-dbus-daemon | `-3*[{at-spi-bus-laun}] |-at-spi2-registr—{at-spi2-registr} |-atd |-avahi-daemon—avahi-daemon |-bluetoothd |-colord—2*[{colord}] |-console-kit-dae—64*[{console-kit-dae}] […]