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.

Filter by
Sorted by
Tagged with
1
vote
1answer
112 views

How to tail a file with a randomized name?

I have a log file that I'd like to tail -f. I know which directory the file is in and the name of the file, up to a point. But, I know that there will be a random 9 digits added to the end of the file ...
4
votes
1answer
689 views

Difference between head and tail

Why is there a difference between the meaning of NUM in head -c and tail -c? I will clarify what I mean with the following commands: $ echo "words" | tail -c +1 words $ echo "words" | tail -c +2 ...
0
votes
0answers
92 views

How to edit logs

I have some problems with ffmpeg logs. I am redirecting the stdout of three ffmpeg processes to create a log of what's happening with the processes, but when my script finishes I want to show on the ...
2
votes
1answer
107 views

How to find a binary name with only the prefix?

Context: I have a bash script that generates a windows import library from a MinGW cross-compiled DLL. As part of the build process, it runs llvm-dlltool-6.0, because that happens to be the specific ...
0
votes
1answer
610 views

tail: not found on a Chroot Directory, how i enable it?

I'm really a noob on Ubuntu, I'm facing a simple problem that I don't find anywhere, I follow this tutorial to make an ssh jail directory https://www.tecmint.com/restrict-ssh-user-to-directory-using-...
1
vote
0answers
322 views

'tail -F' behaving unexpectedly on truncated file

I'm trying to follow everything written to a log file in a terminal. In terminal 1 i do: tail --retry --follow=name /tmp/test_log or alternatively: tail -F /tmp/test_log In terminal 2 i ...
0
votes
1answer
49 views

Tailing Apache Logs - What is the number after the IP address

I am tailing the Apache error logs on my VPS so I can watch the traffic go by. I have been under a DOS attack, or a heavy port scan. I have the apache logging level set to LogLevel Warn. What does the ...
0
votes
1answer
27 views

Monitor log file event it was deleted and created again

I do file monitor with help of command: tail -f foo.csv After logging program restart file is deleted and created new one with the same name. But monitor window stops showing records of newly ...
5
votes
1answer
4k views

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?
0
votes
0answers
551 views

Getting line number in tail -n

I want to get the lines starting from line number of the actual file and also get the actual line number in output as well. I tried tail +30 log.log | nl but above one is giving the output line no....
3
votes
2answers
997 views

Start and terminate TAIL running via SSH using BASH

I am trying to monitor the changes of a file via SSH and copy the changes of it in local computer using BASH. I ran the following command to monitor and copy: ssh root@192.168.88.238 "tail -F /media/...
2
votes
1answer
166 views

monitor syslog and print line without `pattern`

I would like to monitor my /var/log/syslog continuously. However while monitoring, I would like to avoid certain pattern(s) while monitoring. I am interested only in the last 15 (for example) lines. ...
1
vote
2answers
6k views

What package is tail included with? [duplicate]

What package is tail (the command-line tool to see the end lines of a file) included with in the latest stable version of Ubuntu, if I want to install or uninstall it (and does it come installed by ...
0
votes
1answer
413 views

Ubuntu Service with tail not starting

I've managed to create my own service script, however it's having some problems starting. From the service I'm calling the following script in /usr/bin/myscript.sh: #!/bin/bash tail -f /path/to/error....
1
vote
2answers
57 views

Tail the last 5 lines, over-writing the last 5 displayed lines when more are added?

When using tail -f to display the last few lines of a file, how can I make it only ever display 5 lies, overwriting previous lines when the file is added to?
14
votes
6answers
13k views

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 ----------...
0
votes
0answers
2k views

How to extract files using the dd command?

I'm trying to extract a squashfs file from a .bin What I did so far: I used binwalk to locate the pointers: binwalk data.bin DECIMAL HEXADECIMAL DESCRIPTION -----------------------------...
0
votes
1answer
221 views

Tail - like tool for log files [duplicate]

I want a tool that offers tail-like functionality for large files. (which are in a remote server and mounted on my system, for what that matters). I am aware of glogg but I am having issues with auto ...
7
votes
4answers
3k views

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 ...
0
votes
1answer
288 views

Running tasks in remote server via SSH - life cycle?

Two related questions: If I ssh into a remote server and start a long running task in the foreground (:~$ ./my-task > out.log), will the process continue to run when my connection to the server ...
0
votes
1answer
724 views

Ending a tail -f on log files

I have to kill the tail -f process after using it to tail log files. Is there a way to end the process within the tail -f display of the logfile?
2
votes
2answers
293 views

tail -f grep for one paragraph

I have a flowing log file that is separated by empty lines. It's difficult to tail it with grep 'PID' - when I do that it shows only 1 line. This is the Sample: [7/12/16 17:00:12:206 WIB] ...
51
votes
3answers
55k views

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 ...
1
vote
0answers
265 views

Zombie being made from 'tail -f' cron job that grep's and launches shell script

I realize that a single zombie process like this is nothing to worry about, I just want a more professional outcome (no zombie) from my code. My cron job calling a shell script produces a single ...
1
vote
3answers
1k views

`tail` and append in oneliner

How could I tail and append a text in a file, in one line, in Bash? My failed attempt would be tail file.txt > file.txt && date >> file.txt
2
votes
1answer
791 views

Have bash script run against a live file - Is it possible?

I have a script I've written and (finally) have it working like I want it to, as long as I run it against a static file. Is there a way to tail a live file and have the script perform its actions ...
2
votes
1answer
94 views

Is there a maximum amount of time that tail -f can reliably run?

I have noticed that when I tail -f various log files (specifically Apache access/error logs), that it ceases to actively scroll output after a certain of number of hours. I am uncertain if this is a ...
2
votes
2answers
419 views

Command substitution using grep'ed and sed'ed tail -f output as argument source into 'at' command

This is for a home surveillance system, headless server running Ubuntu 15.04, and I want its security to be exemplary. I envision a command line solution (with optional script, if absolutely necessary)...
1
vote
2answers
1k views

Why redirection to a while loop doesn't print the messages?

Here is a shell code used to track changes in a file and output the content to the terminal: while read LINE do echo $LINE done < `tail -f /var/log/messages` It doesn't work, why?
1
vote
3answers
3k views

How do you get those nifty transparent log displays?

So I've seen plenty of displays of transparent logs or running logs or htop instances on what appear to be fixed areas of a desktop. I think this is something like root-tail but I can't get root-tail ...
4
votes
1answer
13k views

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, ...
2
votes
0answers
245 views

solaris tail on ubuntu

Is there a way to make linux tail understand the Solaris tail syntax (precisely like tail +2)? The short story is that I have some update scripts written for Solaris on the repo and I cannot modify ...
10
votes
2answers
3k views

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 ...
44
votes
2answers
24k views

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} ...
0
votes
1answer
269 views

KDE, how to have “tail -f” constantly on a dedicated panel?

Plasma has this nice plasmoid called File Watcher. At work I have 2 monitors. I would like to put this plasmoid on an empty panel on the second monitor. So that tail -f /var/log/apache2/error.log ...
4
votes
2answers
6k views

'tail' command not getting only the new lines

I'm using the command: tail -f -n 0 file.txt But it keeps repeating itself. What I'm doing is the following: Create the file in the first terminal: touch file.txt Start the tail in the second ...
2
votes
0answers
859 views

how to trace running a file?

I want to run a script (something.tcl) with a program (NS2-Network simulator )in Ubuntu 12.04. In order to run that program I have to write the below command: NS something.tcl when I type that ...
21
votes
5answers
5k views

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 ...
0
votes
4answers
199 views

How to tail a log file when removing lines (not appending) of the file?

I want to know how to tail a log file when lines in the files are updating(appending and removing)?
0
votes
1answer
33 views

Tailing only updated line of file

I want to tail only the updated line of the file not entire content tail -F /path to file displays all the line from the file. I need to display only the new lines added to the file can anyone help ...
4
votes
2answers
10k views

tail output of program

How do you use tail to get the last line outputted by a program. I've tried the following so far: echo `cmd` >> stdin && tail -1 stdin For instance: henry@henry-pc:~$ echo "abc\n123" &...
11
votes
4answers
58k views

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: ...
16
votes
6answers
46k views

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 ...
1
vote
2answers
2k views

How to display from line 10 to line 23 in from passwd using tail?

How to display from line 10 to line 23 in from passwd using tail? I know that using tail -1/etc/passwd It will display last line from passwd So please help.
4
votes
2answers
735 views

option like TAIL to keep track of WHOLE file

tail -f will update the file once new data is inserted , but if the whole file is being rewritten it will give an error . is there any other option to keep reloading the whole file ? Thank you
5
votes
3answers
12k views

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 ...
1
vote
3answers
1k views

tail stops displaying in case of a log rotation

I have to tail the log of a server (servicemix) and the log rotation is enabled. As soon as the rotation happens, tail stops displaying. I did some investigations and it is a bug in Debian : Debian ...
6
votes
1answer
604 views

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 ...
2
votes
1answer
813 views

How to make tail -f show time when line was appended?

I'd like to know the time when line was appended when file is being tail -f'ed. Is it possible to configure tail to do something like that?
24
votes
2answers
121k views

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 ...