J2Q4X


## TLDR: MAN PAGES, SIMPLIFIED

Links.

  https://tldr.sh/

  https://linuxconfig.org
  /how-to-install-nodejs-on-debian-9-stretch-linux
  
Prerequesites:

  # apt install curl
  # curl -sL https://deb.nodesource.com/setup_10.x > setup_10.x 
  # chmod +x setup_10.x
  # ./setup_10.x
  # apt-get install -y nodejs
  
Install TLDR
  
  # npm install -g tldr
  
First use example:

✔ Page not found. Updating cache...
✔ Creating index...

  tar

  Archiving utility.
  Often combined with a compression method, such as gzip or bzip.
  ...

Important UNIX commands:

01. Files and folders (13/13)
    
  pwd, cd ( . , .. , ~ , ~user), mkdir (-p)
  ls ( -l, -d, -a, -i, -1, --color)
  ln ( -s)
  cp, mv, rm ( -f, -r), touch
  cmp, diff, patch (-pN)
  find

File tree

  /          root directory
    /bin     programs
    /boot    kernel
       grub  bootloader
    /etc     configuration files
       X11   graphics
    /home    users home
    /lib     libraries 
    /mnt     mount here
    /root    root's home
    /sbin    system programs
    /tmp     temporary
    /proc    some kernel tables, switches, report (in RAM)
    /usr     level 2
       bin
       sbin
       lib
       local   level 3
           bin
           lib
           sbin
       src
  var        log files, cache, chrooted files, ...


02. Files and folders: properties and permissions (3/16) 

  chown, chgrp, chmod (744, +x, +s)

  -rw-------  1 user  user      289 2008-09-21 17:27 .bash_history

  drwxr-xr-x  2 root  root       80 2008-10-12 14:00 bsg
  lrwxrwxrwx  1 root  root        3 2008-10-12 14:00 cdrom -> sr0
  brw-rw----  1 root  floppy 2,   0 2008-10-12 14:00 fd0
  srw-rw-rw-  1 root  root        0 2008-10-12 14:00 log
  crw-rw----  1 root  uucp   4,  64 2008-10-12 14:00 ttyS0

03. stdin, stdout, stderr

  >, >>, <, |, (0<, 1>, 2>), |&, >&, >>& (2>&1), tee

04. Dealing with archives (3/19)

  tar (c v f x j z), bzip2 (-d), gzip (-d)

05. File systems (9/28)

  fdisk, mkfs.ext4, mkswap, fsck,
  dd ( if=/dev/zero if=/dev/random if=/dev/sda if=/dev/sdb1,
       of=/dev/null bs=512 count=63)
  df, du ( -s),
  mount (-o, -t, /etc/fstab), umount

  /etc/fstab
  /dev/sda1     /        ext3    defaults    1 1
  /dev/sda2     swap     swap    defaults    0 0

06. Text editors (2/30)

  ed, nano

07. Scripting (1/31)

  sh

    #!/bin/sh,
    environment variables,
    "", '', ``
    test (-lt -le -eq -ge -gt),
    if .. ; then .. ; fi
    while .. ; do .. ; done
    for $x in .. ; do .. ; done
    seq, 
    expr (index length match substr)
    $(( expression ))

08. Filters and log files (12/43).

  grep (-i, -v, -r, -l -n -H) 'regexp' [filename]

++++++++++++++++++++++++++++++++++++++++++++++++++++++++

  ( ^  $ . [A-Za-z] [0123] [^A] () | )

  cat (-n), wc (-l, -c, -w), less, head (-n 3), tail (-n)
  tr, sed, gawk '{ print $3,$1 }', sort, uniq (-u), paste

  /var/log/messages

09. Users (3/46)

  passwd, su (-), sudo (-s, -i)

  /etc/passwd
  root:x:0:0:root:/root:/bin/bash
  kasutaja:x:500:500::/home/kasutaja:/bin/bash

  /etc/group
  root:x:0:root
  kasutaja:x:500:

10. Processes (5/51)

  ps (-A), kill (-9), jobs, fg, bg

11. Boot (2/53)

  dmesg, uname (-a, -r), /etc/issue

  init (0, 1, 2, 3, 4, 5, 6)
  ntsysv, rcconf

  /boot/grub/menu.lst
  /etc/inittab

12. Networking (6/59)

  ping, traceroute, ip, nslookup, dig, nmap

  /etc/resolv.conf
  nameserver 193.40.160.3

13. Programming (2/61)

  gcc, make

14. Setup (Debian/BSD) (2/63)

  apt (install, remove, search, autoremove), 
  dpkg (-i, -r)

15. Miscellaneous (1/64)

  crontab, mail

As list:

  pwd, cd, mkdir, ls, ln, cp, mv, rm, touch, cmp, diff, patch, find,
  chown, chgrp, chmod,
  tar, bzip2, gzip,
  fdisk, mkfs, mkswap, fsck, dd, df, du, mount, umount,
  ed, nano,
  sh,
  grep, cat, wc, less, head, tail, tr, sed, gawk, sort, uniq, paste
  passwd, su, sudo
  ps, kill, jobs, fg, bg,
  dmesg, uname,
  ping, traceroute, ip, nslookup, dig, nmap,
  gcc, make,
  apt, dpkg,
  crontab
  
Todo:

Build a script to create a file with tldr man pages for the commans listed above (in "As list:" section). commands not supported by tldr, have to be marked in script report as "TLDR: missing help for xxxx".

