yankılanan dosya stdout?


0

Çıktıyı log.txt dosyasına kaydeden bir işlem var. Sürecin durumunu gerçek zamanlı olarak görmek istersem, günlüğü bir metin düzenleyicide açmak ve sürekli olarak yeniden yüklemek yerine, bu çıktının stdout'a yankılanmasının bir yolu var mı?

Yanıtlar:


7

Terminal'de gerçekten basit bir çözüm için:

% tail -f log_file.log

Kuyruk ana dosyasından (yani man tail):

 -f      The -f option causes tail to not stop when end of file is reached,
         but rather to wait for additional data to be appended to the input.
         The -f option is ignored if the standard input is a pipe, but not if
         it is a FIFO.

 -F      The -F option implies the -f option, but tail will also check to see
         if the file being followed has been renamed or rotated.  The file is
         closed and reopened when tail detects that the filename being read
         from has a new inode number.  The -F option is ignored if reading
         from standard input rather than a file.

2

tail -fBir dosyanın sonunu görüntülemek için kullanın ve büyüdükçe "izleyin".


2

kullanın:

tail -f log.txt

veya farklı bir tatta:

watch tail log.txt
Sitemizi kullandığınızda şunları okuyup anladığınızı kabul etmiş olursunuz: Çerez Politikası ve Gizlilik Politikası.
Licensed under cc by-sa 3.0 with attribution required.