Created
January 16, 2013 09:58
-
-
Save baijian/4546026 to your computer and use it in GitHub Desktop.
tail -f 引发的思考
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
tail -f => tail --follow=descriptor | |
tail -F => tail --follow=name --retry | |
example1: | |
-----start---- | |
first: | |
tail -f testfile | |
tail -F testfile | |
then: | |
rm -f testfile | |
then: | |
see the difference... | |
then: | |
touch testfile | |
then: | |
see the difference... | |
------end------ | |
example2: | |
----start---- | |
touch testfile | |
echo 'test' > testfile | |
tail -f testfile | |
$Pid = ps aux | grep 'tail' | grep -v 'grep' | |
rm testfile | |
ls -l /proc/$pid/fd/ | |
cp /proc/$pid/fd/4 /tmp/testfile | |
then, file recovery. | |
----end--- | |
proc learning | |
http://www.linuxdiyf.com/bbs/viewthread.php?tid=2683 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment