TLDR pages: Οι man σελίδες γίνονται πιο απλές και πιο χρήσιμες

dimitris | Δευ, 03/14/2022 - 12:06 | 4'

Όπως ίσως ξέρετε, κάθε "εντολή" του linux συνοδεύεται από μια man(ual) σελίδα για τη χρήση του (π.χ. δείτε man ls). Αυτές οι man σελίδες έχουν πολύ πληροφορία, αλλά συχνά τους λείπουν παραδείγματα. Εδώ έρχεται το TLDR pages, ένα κοινοτικό project για πιο απλές man σελίδες με αρκετά πρακτικά παραδείγματα.

Υπάρχουν πολλοί τρόποι για να εγκαταστήσετε το tldr στο linux σας. Π.χ. στο Ubuntu/Debian υπάρχουν clients σε haskell και Python που εγκαθιστάτε με τις εφαρμογές:

sudo apt install tldr     # version 0.4.0.1-1build2, or
sudo apt install tldr-py  # version 0.7.0-3

Όμως ο καλύτερος client είναι αυτός σε Node.js, που εγκαθιστάτε με την εντολή:

npm install -g tldr

Την πρώτη φορά που θα τρέξετε μια εντολή tldr για να δείτε την απλοποιημένη man page, θα πάρει λίγο χρόνο να κάνει τα μαγικά του, αλλά το αποτέλεσμα θα είναι σίγουρα χρήσιμο:

$ tldr wget
✔ Page not found. Updating cache...
✔ Creating index...

  wget

  Download files from the Web.
  Supports HTTP, HTTPS, and FTP.
  More information: https://www.gnu.org/software/wget.

  - Download the contents of a URL to a file (named "foo" in this case):
    wget https://example.com/foo

  - Download the contents of a URL to a file (named "bar" in this case):
    wget --output-document bar https://example.com/foo

  - Download a single web page and all its resources with 3-second intervals between requests (scripts, stylesheets, images, etc.):
    wget --page-requisites --convert-links --wait=3 https://example.com/somepage.html

  - Download all listed files within a directory and its sub-directories (does not download embedded page elements):
    wget --mirror --no-parent https://example.com/somepath/

  - Limit the download speed and the number of connection retries:
    wget --limit-rate=300k --tries=100 https://example.com/somepath/

  - Download a file from an HTTP server using Basic Auth (also works for FTP):
    wget --user=username --password=password https://example.com

  - Continue an incomplete download:
    wget --continue https://example.com

  - Download all URLs stored in a text file to a specific directory:
    wget --directory-prefix path/to/directory --input-file URLs.txt

Εξορισμού, η tldr δείχνει παραδείγματα χωρίς χρώματα. Μπορείτε να προσθέσετε χρώματα με την παράμετρο -t, π.χ.

tldr tar -t ocean

ή

tldr grep -t base16

Ένα ωραίο χαρακτηριστικό και χρήσιμο για όσους/όσες θέλουν να μάθουν περισσότερα για τις εντολές του linux είναι η προβολή τυχαίων σελίδων (-r) ή η προβολή τυχαίου παραδείγματος (-e):

$ tldr -e

PAGE usermod

  usermod

  Modifies a user account.
  See also: users, useradd, userdel.
  More information: https://manned.org/usermod.

  - Change a user id:
    sudo usermod --uid id username


See also: users, useradd, userdel

Μπορείτε να δοκιμάσετε live εδώ:

https://tldr.sh/

 

Δώσε αστέρια!

MO: 3.8 (ψήφοι: 4)