Skip to content

Instantly share code, notes, and snippets.

@baijian
Created January 16, 2013 09:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save baijian/4546026 to your computer and use it in GitHub Desktop.
Save baijian/4546026 to your computer and use it in GitHub Desktop.
tail -f 引发的思考
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