Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- March 10th Notes
- Reviewing Useful Tools For UDR1
- --------------------------------
- 1. dd
- 2. bc - Binary Calculator ( CTRL + D - Exit)
- 3. du
- 4. bash shell scripting
- 5. od - Octal Dump
- 6. hexedit - Hex Editor, Displays Information
- 7. bvi - Binary VI
- Bash + BC
- ---------
- echo "2+2" | bc --> 4
- a =`echo "2+2" | bc` --> A is now 4
- bc -q --> Doesn't display banner
- bc -l --> Adds decimal points
- Advanced BC
- -----------
- ibase=16 --> Changes input base to 16 --> Output remains Decimal
- obase=2 --> Changes output base to 2 --> Output is now 2 (Binary)
- echo "2^64" | bc | wc -c --> Total size of an input 64-bits can hold
- bc --> Great for calculations
- dd --> Great for file surfing (Backing-up)
- Regular Expressions (RegEx) - grep
- ----------------------------------------
- |
- . match any single character |
- [] match any one of enclosed |
- [^] do not match any one of enclosed |
- \^ match start of word | Basic
- \> match end of word | RegEx
- ^ match start of line |
- $ match end of line |
- * 0 or more of the previous |
- |
- ----------------------------------------
- Extended Grep - egrep
- ----------------------------------------
- \( \) GROUP | Extended
- | OR | RegEx
- ----------------------------------------
- More RegEx
- ----------
- cat words | grep '^...$' | wc -l --> Displays all words with 3-characters
- cat words | grep '^.[aeiou].[aeiou]$' | wc -l --> Displays 4-characters 2 and 4 are vowels
- cat words | grep '^[listOfLetters][repeat]$' | wc -l --> Displays characters for that length in Scrabble
- 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