Linux Tricks

Only available on StudyMode
  • Topic: File system, Bash, Working directory
  • Pages : 169 (39450 words )
  • Download(s) : 18
  • Published : May 14, 2013
Open Document
Text Preview
Linux 101 Hacks

www.thegeekstuff.com

Table of Contents
Introduction........................................................... 7 About the Author.................................................... 8 Copyright & Disclaimer............................................ 9 Version.............................................................................. 9

More eBooks from The Geek Stuff..........................10
Bash 101 Hacks............................................................... 10 Sed and Awk 101 Hacks................................................... 11 Nagios Core..................................................................... 12 Vim 101 Hacks................................................................. 13

Chapter 1: Powerful CD Command Hacks................14
Hack Hack Hack Hack Hack Hack 1. 2. 3. 4. 5. 6. Define CD Base Directory Using CDPATH ...............14 Use CD Alias to Navigate Up the Directory.............15 Perform mkdir and cd Using a Single Command ....18 Toggle Between Directories ................................. 19 Manipulate Directory Stack.................................. 20 Automatically Correct Mistyped Directory Names . 23

Chapter 2: Essential Linux Commands ...................24
Hack Hack Hack Hack Hack Hack Hack Hack Hack Hack Hack Hack 7. Grep Command ................................................... 24 8. Regular Expression in Grep.................................. 26 9. Find Command .................................................... 29 10. Suppress Standard Output and Error Message ....31 11. Join Command ................................................... 32 12. Change the Case ............................................... 33 13. Xargs Command ................................................ 34 14. Sort Command .................................................. 35 15. Uniq Command .................................................. 37 16. Cut Command ................................................... 38 17. Stat Command .................................................. 39 18. Diff Command ................................................... 41 2

Linux 101 Hacks

www.thegeekstuff.com

Hack Hack Hack Hack Hack Hack Hack Hack Hack

19. 20. 21. 22: 23. 24. 25. 26. 27.

Display Total Connect Time of Users ...................42 Execute Commands in the Background ...............43 Sed Basics - Find and Replace Using RegEx ........45 Awk Introduction – Print Examples ..................... 50 Vim Editor Navigation Fundamentals ..................56 Chmod Command Examples................................ 60 View Multiple Log Files in One Terminal ..............62 Less Command................................................... 64 Wget Examples ................................................. 68

Chapter 3: SSH Commands and Tips.......................76
Hack Hack Hack Hack Hack 28. 29. 30. 31. 32. Debug SSH Client Session .................................. 76 Toggle SSH Session using SSH Escape Character . 77 Display SSH Session Statistics ........................... 78 Change OpenSSH Security Options......................79 Transfer All PuTTY Sessions................................ 85

Chapter 4: Date Manipulation ............................... 87 Hack Hack Hack Hack Hack 33. 34. 35. 36. 37. Set System Date and Time ................................. 87 Set Hardware Date and Time .............................88 Display Date and Time in a Specific Format ........89 Display Past Date and Time ............................... 90 Display Future Date and Time ............................91

Chapter 5: PS1, PS2, PS3, PS4 and PROMPT_COMMAND.............................................. 93 Hack Hack Hack Hack Hack Hack Hack 38. 39. 40. 41. 42. 43. 44. PS1 - Default Interaction Prompt .......................93 PS2 - Continuation Interactive Prompt ...............94 PS3 - Prompt Used by Select Command...............95 PS4 - Prompt to Prefix Tracing...
tracking img