View Single Post
shallimus's Avatar
Posts: 568 | Thanked: 969 times | Joined on Dec 2009 @ Toronto
#9
Code:
grep -A 13 lock_code /dev/mtd1|tail -1
An explanation of some of what you typed in to Xterm:
  • grep searches for a word within a file (or other input); *nix people will often refer to needle (the word) and haystack (the file or other input)
  • lock_code is the needle
  • /dev/mtd1 is the haystack: the file which contains the hash of your lock code
  • -A 13 tells grep to also show the 13 lines after the matching line in /dev/mtd1; this is because the hash is a number of lines after the occurrence of the word lock_code (guess how many?)
  • | (aka 'pipe') means take the output of the previous command (the grep) and send it into the following command as input
  • tail -1 means show only the last line of the input (the input in this case being the output of grep which you piped into tail)
__________________
tinfoilhat.dll: Trojan horse detected
Sailfish want list: calendar bugfixes, glanceable agenda, Swype or similar
Evolution continues (but we're still pre-Cambrian)


Last edited by shallimus; 2010-08-30 at 14:42.
 

The Following 4 Users Say Thank You to shallimus For This Useful Post: