On Sunday 06 October 2002 19.55, Stephen H Carbin wrote:
Thanks Anders, however that only seems to execute the tail command on the second file. Even if I change it to tail -2 , I still get more of the passwd file than just the last 2 lines. How would I change the syntax for that?
/etc> find . \( -name passwd -or -name motd \) -exec tail -2 {} \; 2>/dev/null Have a lot of fun... password required pam_unix2.so nullok use_first_pass use_authtok session required pam_unix2.so news:x:9:13:News system:/etc/news:/bin/bash uucp:x:10:14:Unix-to-Unix CoPy system:/etc/uucp:/bin/bash The "Have a lot of fun" line is from motd, which only has one line. The next two are from /etc/pam.d/passwd and the final two are from /etc/passwd so it seems to work for me the way I wrote it (sorry about the typo with "tail -f" though) If you only want files from the current directory, use "-maxdepth 1" //Anders -- 'Deserves [death]. I daresay he does. Many that live deserve death. And some that die deserve life. Can you give it to them? Then do not be too eager to deal out death in judgement. For even the very wise cannot see all ends.' --Tolkien, The Lord of the Rings