Wow! I'm just starting with sed & grep. I'm no bash voodoo but I try to get around. So if I get this straight your finding every regular file in a directory, using sed your identifying the correct lines and replacing that with a backreference \1. I'm reading up on back-references but it isn't clear to me yet. '{}' tells sed what file we're working on and I don't get the last \...
While sorting, I wouldn't use -k1 since the output file will contain some white space in front of the numbers. It is formatted as so:
100
[space]10
[space][space]1
Hope this is kinda clear
I used -i since I didn't want to miss anything (just in case), and -r because there are many files that I'm extracting the passwords from. I always underestimate the power of piping, and always forget you can end a bash line with ;
Again, thank you very much for that, awesome stuff.
Edit: Woah! Somebody posted while I was writing this. Loving these forums
On OS X \t isn't supported, you have to actually press tab. It uses an older version of sed... Also, cut -c9- wont really work since there are many numbers of different lengths. You can pipe it back into
and it should be ok. Or am I missing something ?
While sorting, I wouldn't use -k1 since the output file will contain some white space in front of the numbers. It is formatted as so:
100
[space]10
[space][space]1
Hope this is kinda clear
I used -i since I didn't want to miss anything (just in case), and -r because there are many files that I'm extracting the passwords from. I always underestimate the power of piping, and always forget you can end a bash line with ;
Again, thank you very much for that, awesome stuff.
Edit: Woah! Somebody posted while I was writing this. Loving these forums
(06-14-2012, 07:35 PM)M@LIK Wrote: Optimization?
Code:type *.* | sed '/pass=/I!d;s/pass=\(.*$\)/\1/I;s/^[ \t]*//;s/[ \t]*$//' | sort | uniq -c | sort -nr | cut -c9- > wordlist_FINAL.txt
On OS X \t isn't supported, you have to actually press tab. It uses an older version of sed... Also, cut -c9- wont really work since there are many numbers of different lengths. You can pipe it back into
Code:
sed 's/^[ ]*[1234567890]*[ ]//'
and it should be ok. Or am I missing something ?