Loading

Bash - fonction tips

  1. function bashtips {
  2. cat <<EOF
  3. DIRECTORIES
  4. -----------
  5. ~-      Previous working directory
  6. pushd tmp   Push tmp && cd tmp
  7. popd        Pop && cd
  8.  
  9. GLOBBING AND OUTPUT SUBSTITUTION
  10. --------------------------------
  11. ls a[b-dx]e Globs abe, ace, ade, axe
  12. ls a{c,bl}e Globs ace, able
  13. \$(ls)      \`ls\` (but nestable!)
  14.  
  15. HISTORY MANIPULATION
  16. --------------------
  17. !!      Last command
  18. !?foo       Last command containing \`foo'
  19. ^foo^bar^   Last command containing \`foo', but substitute \`bar'
  20. !!:0        Last command word
  21. !!:^        Last command's first argument
  22. !\$     Last command's last argument
  23. !!:*        Last command's arguments
  24. !!:x-y      Arguments x to y of last command
  25. C-s     search forwards in history
  26. C-r     search backwards in history
  27.  
  28. LINE EDITING
  29. ------------
  30. M-d     kill to end of word
  31. C-w     kill to beginning of word
  32. C-k     kill to end of line
  33. C-u     kill to beginning of line
  34. M-r     revert all modifications to current line
  35. C-]     search forwards in line
  36. M-C-]       search backwards in line
  37. C-t     transpose characters
  38. M-t     transpose words
  39. M-u     uppercase word
  40. M-l     lowercase word
  41. M-c     capitalize word
  42.  
  43. COMPLETION
  44. ----------
  45. M-/     complete filename
  46. M-~     complete user name
  47. M-@     complete host name
  48. M-\$        complete variable name
  49. M-!     complete command name
  50. M-^     complete history
  51. EOF
  52. }

Comments