review101LinuxHacks

Table of Contents

The other papers

1 Review 101 linux hacks

Having just downloaded TheGeekStuff's 101 Linux Hacks it seems like a good idea to do a quick review. Is each useful, does it lead somewhere, is there something really new, etc… So, here goes:

**

  1. CDPATH – by all means, pushd works, added "cdp" function
  2. cd Alias – functions still better
  3. function mkdircd – good idea, use "command cd" inside overwritten function cd
  4. toggle directory – see next idea, better
  5. directory stack – "dirs" not on all unix, peekd, swapd, etc.., addl functions
  6. shopt -s – with cd, what other commands?!

**

  1. grep – hardly a hack, but worth promoting
  2. grep with RE – ditto
  3. find – ditto grep
  4. supress stdout, stderr – functions ignore, quietly
  5. join – by all means, and see /rdb
  6. change case – functions UC lc toupper, tolower, take stdin OR args
  7. xargs – see find, and notice it only works with commands, alt: cmmd $(stuff)
  8. sort – see grep, find, xargs
  9. uniq – ditto
  10. cut – learn awk instead
  11. stat – yes, and time to introduce "set – $( … )"
  12. diff – again, sort, uniq, grep, find, xargs
  13. ac – Sys admins info, specialty. not the general audience
  14. background – direction of systems programmer, more general info
where "watch" must be linux-specific.  rather a "forever" loop function
  1. sed – list grows: diff, sort, uniq, grep, find, xargs
  2. awk – now we're getting somewhere; but, again NOT a "hack" per se.
  3. vim – fun stuff, but the other dimension.
  4. chmod – NAH, "Not A Hack"
  5. tail – yes, wrap the "watch" idea, not only admins, but systems, anyone
  6. less – see "more", "view",
  7. wget – i'll learn something here.

1.1 SSH Commands and tips

1.2 Date manipulation

  1. set date – sysadmins
  2. set hardware – sysadmin
  3. date format – should use %{a-zA-Z}, 4th e.g. ff
  4. past date – -v{+-}…
  5. future date – s/a above,

1.3 PS{1..4} PROMPT_

  1. PS1 – yes, .profile
  2. PS2 – yes, continuation prompt
  3. PS3 – no, K&P's "pick" command is both more general, and as simple
  4. PS4 – yes, by all means; default: '+ ' is sufficient for functions; see traceall
  5. PROMPT_ – yes, and need to escape the '$' in any command
  6. custom PS1 – see *-5, so, what's the value of PROMPT_ ?, value of command output is high
  7. color PS1 – yes, FUN

1.4 Archive and Compression

  1. zip – see find, grep, sed, … etc NAH
  2. zip++ – nice to know (about)
  3. zip w/password – again, ntka
  4. tar – more NAH
  5. zip1 – unstick the tar,
  6. bz – NAH, alternatives to
  7. cpio – yet another file archive. my favorite, actually

1.5 Command Line history

  1. bash history examples – fav function: ngh () { history | grep $*; }
* control R -- this is NEW info

2 Links

http://www.youtube.com/watch?v=_oYH9nRauRM MrTutorize use of "set –" http://www.youtube.com/watch?v=NflZf41fmYM MrTutorize function introduct

Footnotes:

1

DEFINITION NOT FOUND.

Author: Marty

Created: 2016-02-20 Sat 15:53

Emacs 24.4.1 (Org mode 8.2.10)

Validate