cat filename.txt | fold -80 -s
fold can also be told to wrap at bytes instead of columns, but I've never been quite sure how that would be useful.
cat haystack | grep needle > !ouch
cat filename.txt | fold -80 -s
fold can also be told to wrap at bytes instead of columns, but I've never been quite sure how that would be useful.
sort test1.txt > test1-sorted.txt
sort test2.txt > test2-sorted.txt
This will show you lines only in test1.txt:
comm -23 test1-sorted.txt test2-sorted.txt
This will show you lines only in test2.txt:
comm -13 test1-sorted.txt test2-sorted.txt
This will show you lines only common to both files:
comm -12 test1-sorted.txt test2-sorted.txt
We can also do some neat tricks with uniq/sort -u:
cat test1.txt | sort > test1-sorted.txt
cat test1.txt | sort -u > test1-sorted-u.txt
This will show you lines only in test1-sorted-u.txt, which means those are the lines that appear multiple times in your original test1.txt file:
comm -13 test1-sorted.txt test1-sorted-u.txt
Neat, huh?
user1:passwd1
user2:passwd2
Then run the command:
cat passwords.txt | chpasswd
Don't forget to delete your passwords.txt file just after you're done. Seriously bad idea to leave this file hanging around.
If you're looking for a way to automatically generate a whole bunch of passwords that your users won't balk at, the pwgen command may be installed on your system already!
If not, and you don't want to go hunting for one, try this: http://www.multicians.org/thvv/gpw.html
fuser filename
Sure, you can use options in the fuser command to automatically kill off all those processes, but that would make me really nervous if I wasn't absolutely sure what each of them was... killing one of those off could be worse than having a full filesystem.