Advertisement
Guest User

Untitled

a guest
Mar 12th, 2015
23
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.66 KB | None | 0 0
  1. March 10th Notes
  2.  
  3. Reviewing Useful Tools For UDR1
  4. --------------------------------
  5.  
  6. 1. dd
  7. 2. bc - Binary Calculator ( CTRL + D - Exit)
  8. 3. du
  9. 4. bash shell scripting
  10. 5. od - Octal Dump
  11. 6. hexedit - Hex Editor, Displays Information
  12. 7. bvi - Binary VI
  13.  
  14. Bash + BC
  15. ---------
  16.  
  17. echo "2+2" | bc --> 4
  18. a =`echo "2+2" | bc` --> A is now 4
  19. bc -q --> Doesn't display banner
  20. bc -l --> Adds decimal points
  21.  
  22. Advanced BC
  23. -----------
  24.  
  25. ibase=16 --> Changes input base to 16 --> Output remains Decimal
  26. obase=2 --> Changes output base to 2 --> Output is now 2 (Binary)
  27. echo "2^64" | bc | wc -c --> Total size of an input 64-bits can hold
  28.  
  29. bc --> Great for calculations
  30. dd --> Great for file surfing (Backing-up)
  31.  
  32. Regular Expressions (RegEx) - grep
  33. ----------------------------------------
  34. |
  35. . match any single character |
  36. [] match any one of enclosed |
  37. [^] do not match any one of enclosed |
  38. \^ match start of word | Basic
  39. \> match end of word | RegEx
  40. ^ match start of line |
  41. $ match end of line |
  42. * 0 or more of the previous |
  43. |
  44. ----------------------------------------
  45.  
  46. Extended Grep - egrep
  47. ----------------------------------------
  48. \( \) GROUP | Extended
  49. | OR | RegEx
  50. ----------------------------------------
  51.  
  52. More RegEx
  53. ----------
  54.  
  55. cat words | grep '^...$' | wc -l --> Displays all words with 3-characters
  56. cat words | grep '^.[aeiou].[aeiou]$' | wc -l --> Displays 4-characters 2 and 4 are vowels
  57. cat words | grep '^[listOfLetters][repeat]$' | wc -l --> Displays characters for that length in Scrabble
  58. cat words | grep '^[listOfLetters]*$' | wc -l --> Displays any length with those letters inside of it
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement