Questions tagged [tail]

Tail is a command-line program that by default outputs the last ten lines to standard output; with other command switches, particular numbers of lines can be specified and files can be monitored in real time.

64 questions
89
votes
2 answers

tail: Reading an entire file, and then following

I would like a tail -f type of behavior that reads the entire file and then continues to follow it as it's written to. SOLUTION Based on the answer I accepted, this works: tail -f -n +1 {filename} Why it works: The -f option continues to "follow"…
Sonny
  • 1,215
  • 1
  • 9
  • 14
64
votes
3 answers

User limit of inotify watches reached on Ubuntu 16.04

I just installed Ubuntu 16.04 and I get this warning when I start SmartGit: IOException: User limit of inotify watches reached Moreover I get this warning launching tail -f: tail: inotify resources exhausted tail: inotify cannot be used,…
Andrea
  • 1,047
  • 3
  • 9
  • 17
42
votes
7 answers

GUI for watching logs (tail and grep)

Could you recommend a GUI application with powerful log watching capabilities? Generally it would work as tail -f in GUI, but on top of that following features would be very useful: filtering out some lines based on (regular) expressions coloring…
Grzegorz Oledzki
  • 878
  • 2
  • 9
  • 17
28
votes
7 answers

tail: inotify cannot be used, reverting to polling: Too many open files

When I try to tail -f catalina.out, I get the error: tail: inotify cannot be used, reverting to polling: Too many open files I tried the answer in this post: Too many open files - how to find the culprit lsof | awk '{ print $2; }' | sort -rn |…
gbag
  • 281
  • 1
  • 3
  • 3
27
votes
2 answers

Tail - how to quit tail and restore terminal window?

Let's say we do: tail -f /var/log/apache2/error.log Then we see what we want to see, and then, we want to quit, so that we can navigate to other directories and so on... So, the question is: How can we quit tail ? I've tried to type: 'q', and…
MEM
  • 10,997
  • 12
  • 38
  • 42
21
votes
5 answers

How to view multiple files in single terminal?

Sometimes I may need to access multiple log files for troubleshooting , but I don't want to open them in different terminals. What I want is to open them in same terminal. Is there any way I can view tail part of the multiple log files in a same…
Raja G
  • 100,643
  • 105
  • 254
  • 328
15
votes
6 answers

Which is faster to delete first line in file... sed or tail?

In this answer (How can I remove the first line of a file with sed?) there are two ways to delete the first record in a file: sed '1d' $file >> headerless.txt ** ---------------- OR ----------------** tail -n +2 $file >> headerless.txt Personally…
WinEunuuchs2Unix
  • 99,709
  • 34
  • 237
  • 401
15
votes
4 answers

What does the 'tail' command do?

I'm new to Ubuntu. I previously ran a tail -f /var/logs/syslog and get the following displayed results: kernel: [ 2609.699995] [drm:gen6_sanitize_pm] *ERROR* Power management discrepancy: GEN6_RP_INTERRUPT_LIMITS expected 000d0000, was…
user174472
  • 159
  • 1
  • 1
  • 3
14
votes
4 answers

Tailing two log files

I have a web application that outputs to a number of log files with performance information. One log file outputs code execution times and another outputs SQL timings. I have no control over the logger or the code that produces the log files, but I…
Codemwnci
  • 1,219
  • 3
  • 15
  • 20
11
votes
2 answers

Ending tail -f after print n lines

I have the following. A Java process writing logs on file A shell script starting the Java process. I need to read the log file after start Java process to check correct starting. I have try with tail -f but it remain append forever. I need tail…
theShadow89
  • 215
  • 2
  • 9
7
votes
4 answers

Move only the last 8 files in a directory to another directory

I'm trying to move the last 8 files from the Documents directory to another directory, but I don't want to move them one-by-one to that specific directory. Is it possible to move them with a substitute of the tail command, but for directories…
Sandra Ross
  • 777
  • 3
  • 10
  • 20
7
votes
3 answers

Paginate with tail -f command

I am trying to tail file with pagination: tail -f foo.txt | more This works fine until file gets, lets say, 200 lines injected, when this happens nature of tail command is to go to end of file, at that point I lose track of trailing the log. Is…
Dolphin
  • 123
  • 1
  • 1
  • 6
6
votes
1 answer

How to unzip only the first few lines of a zip archive?

I have a zipped text file a.zip I want to read the first 10 lines of it. Is it possible to do that without unzipping the whole file?
yukashima huksay
  • 917
  • 5
  • 14
  • 29
6
votes
1 answer

Highlighting with grep doesn't work in Xterm

I've got a problem with Xterm. When I use the command tail -F example.log | grep -a -i -e 'examplestring' in Xterm the "grepped" strings aren't highlighted in red like they would be in the normal terminal. How can I fix this? Google didn't help me…
Bannix
  • 61
  • 2
4
votes
1 answer

Why won't `tail -f` follow my syslog when running live?

I want to monitor /var/log/syslog for any changes in realtime (or within-a-few-seconds-of-time), but tail -f won't update with any new changes. I'm running Ubuntu-based Linux Mint 17 XFCE live now, but this hasn't worked on live iso's of Ubuntu,…
Xen2050
  • 8,588
  • 4
  • 32
  • 51
1
2 3 4 5