Hi, What I would like to know is what will happen to my Linux syste or a log file if I am reading the log file contents via konqueror when it needs to update itself? Are the changes stored in RAM until I refresh the konqi window or are the changes lost? Are different files treated differently ie reading te /var/log/messages file would be catastrophic if the system needed to update the file, but reading the var/log/ntp file would be fine as the changes would be saved in RAM until the konqi window is closed or refreshed. Tnx -- ======================================================================== Currently using unpatched SuSE 9.2 Professional with KDE and Mozilla 1.7.2 Linux user # 229959 at http://counter.li.org ========================================================================
On Friday 20 October 2006 15:37, Hylton Conacher(ZR1HPC) wrote:
What I would like to know is what will happen to my Linux syste or a log file if I am reading the log file contents via konqueror when it needs to update itself? Are the changes stored in RAM until I refresh the konqi window or are the changes lost?
Nothing unusual happens, no data is lost. Konqueror (etc) gets a "snapshot" of the contents and the file can be modified independently of this. In Windows this doesn't work for many file types, because Windows is hard-core about not letting multiple processes use most files. e.g., you can't even COPY a file if it's in use by a process, which is not the case under Linux/Unix. And you certainly can't delete or overwrite a running .exe or .dll under Windows, but you can in Linux (not that doing so is a good idea, of course).
Are different files treated differently
Nope. It's all good.
ie reading te /var/log/messages file would be catastrophic if the system needed to update the file, but reading the var/log/ntp file would be fine as the changes would be saved in RAM until the konqi window is closed or refreshed.
If you want to dynamically view a changing log file, try: cd /var/log tail -f messages Then you'll see the changes as they are happening. Tap Ctrl-C to quit. -- ----- stephan@s11n.net http://s11n.net "...pleasure is a grace and is not obedient to the commands of the will." -- Alan W. Watts
stephan beal wrote:
On Friday 20 October 2006 15:37, Hylton Conacher(ZR1HPC) wrote:
What I would like to know is what will happen to my Linux syste or a log file if I am reading the log file contents via konqueror when it needs to update itself? Are the changes stored in RAM until I refresh the konqi window or are the changes lost?
Nothing unusual happens, no data is lost. Konqueror (etc) gets a "snapshot" of the contents and the file can be modified independently of this. In Windows this doesn't work for many file types, because Windows is hard-core about not letting multiple processes use most files. e.g., you can't even COPY a file if it's in use by a process, which is not the case under Linux/Unix. And you certainly can't delete or overwrite a running .exe or .dll under Windows, but you can in Linux (not that doing so is a good idea, of course).
Are different files treated differently
Nope. It's all good. Thanmks
ie reading te /var/log/messages file would be catastrophic if the system needed to update the file, but reading the var/log/ntp file would be fine as the changes would be saved in RAM until the konqi window is closed or refreshed.
If you want to dynamically view a changing log file, try:
cd /var/log tail -f messages
Then you'll see the changes as they are happening. Tap Ctrl-C to quit. COOL. Darn the CLI comes 'alive' when you enter the correct commands :)
Tnx Stephan Now I can open an X-term and gave a few tabs running the above command on different files. -- ======================================================================== Currently using unpatched SuSE 9.2 Professional with KDE and Mozilla 1.7.2 Linux user # 229959 at http://counter.li.org ========================================================================
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 The Saturday 2006-10-21 at 21:00 +0200, Hylton Conacher(ZR1HPC) wrote:
If you want to dynamically view a changing log file, try:
cd /var/log tail -f messages
Then you'll see the changes as they are happening. Tap Ctrl-C to quit. COOL. Darn the CLI comes 'alive' when you enter the correct commands :)
If you are using a laptop use instead "tailf messages". - -- Cheers, Carlos E. R. -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.2 (GNU/Linux) Comment: Made with pgp4pine 1.76 iD8DBQFFOpgHtTMYHG2NR9URAvJVAJ0Tjv+5vk4oq8VP0hBZ/5UTWWnUSACfavJ0 jMv536mAR//euoRltrcAXpg= =48Oo -----END PGP SIGNATURE-----
Carlos E. R. wrote:
The Saturday 2006-10-21 at 21:00 +0200, Hylton Conacher(ZR1HPC) wrote:
If you want to dynamically view a changing log file, try:
cd /var/log tail -f messages
Then you'll see the changes as they are happening. Tap Ctrl-C to quit.
COOL. Darn the CLI comes 'alive' when you enter the correct commands :)
If you are using a laptop use instead "tailf messages".
Tnx Carlos. I see from the man page it is similar to tail -f. It says that it displays the last 10 lines but this grows as the log file grows ie #tailf /var/log/messages did start with 10 lines but then as the file was updated so the output became more lines ie On executing the command: Line 1 Line 2 Line 3 Line 4 Line 5 Line 6 Line 7 Line 8 Line 9 Line 10 After a while: Line 1 Line 2 Line 3 Line 4 Line 5 Line 6 Line 7 Line 8 Line 9 Line 10 Line 11 Line 12 How can I get it to display only 10 lines ie as #11 is added so #1 drops off? -- ======================================================================== Currently using unpatched SuSE 9.2 Professional with KDE and Mozilla 1.7.2 Linux user # 229959 at http://counter.li.org ========================================================================
On Sun, 2006-10-22 at 12:51 +0200, Hylton Conacher(ZR1HPC) wrote:
I see from the man page it is similar to tail -f. It says that it displays the last 10 lines but this grows as the log file grows ie #tailf /var/log/messages did start with 10 lines but then as the file was updated so the output became more lines ie
On executing the command: Line 1 Line 2 Line 3 Line 4 Line 5 Line 6 Line 7 Line 8 Line 9 Line 10
After a while: Line 1 Line 2 Line 3 Line 4 Line 5 Line 6 Line 7 Line 8 Line 9 Line 10 Line 11 Line 12
How can I get it to display only 10 lines ie as #11 is added so #1 drops off?
watch tail -10 /var/log/messages The advantage with tailf over tail -f or watch is that it consumes less energy, which is why it's better on laptops running on battery power
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 The Sunday 2006-10-22 at 12:51 +0200, Hylton Conacher(ZR1HPC) wrote:
How can I get it to display only 10 lines ie as #11 is added so #1 drops off?
I does just that. It is the terminal who instead of pushing that top line into black nothingness allows you to go back in history and see it. - -- Cheers, Carlos E. R. -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.2 (GNU/Linux) Comment: Made with pgp4pine 1.76 iD8DBQFFO4UWtTMYHG2NR9URAjaCAJsFYjKzd9CfNxRgQAzhkW0R4GJoxwCdGNDY 9rnicocYyPHMcgk1n5qUgXg= =Ktao -----END PGP SIGNATURE-----
Carlos E. R. wrote:
The Sunday 2006-10-22 at 12:51 +0200, Hylton Conacher(ZR1HPC) wrote:
How can I get it to display only 10 lines ie as #11 is added so #1 drops off?
I does just that. It is the terminal who instead of pushing that top line into black nothingness allows you to go back in history and see it.
OK. Tnx Anders and Carlos. -- ======================================================================== Currently using unpatched SuSE 9.2 Professional with KDE and Mozilla 1.7.2 Linux user # 229959 at http://counter.li.org ========================================================================
participants (4)
-
Anders Johansson
-
Carlos E. R.
-
Hylton Conacher(ZR1HPC)
-
stephan beal