The tag has no wiki summary.

learn more… | top users | synonyms

4
votes
2answers
448 views

What does tail -f <directory name> do?

I mistakenly executed the following command in the terminal: tail -f /logs/applications/logs* I got the following output: tail: file shrunk! Error 0 I am not sure what exactly happened. I have ...
1
vote
2answers
44 views

What does tail -0a do?

In the documentation for logstash, they mention the command tail -0a I have never heard of the -a flag and I can't find any information on google, tail --help or the man pages. What is the ...
1
vote
1answer
49 views

Convert newlines to null-delimited when using tail

How can I change the output from tail to use null-terminated lines instead of newlines? My question is similar to this one: How to do `head` and `tail` on null-delimited input in bash?, but differs ...
21
votes
1answer
623 views

Do I need to worry about “tail: unrecognized file system type 0xbeefdead”?

I'm trying to follow a regular text file with tail -f -n 50 filename. I get the information from the file just fine, except I always get this error message: tail: unrecognized file system type ...
0
votes
3answers
59 views

Is it possible to change the default COUNT value of tail and head?

The less command accepts its defaults with an environment variable LESS, so you can export LESS='-F -g -i -M -R -S -w -X -z-4' at the beginning of your session. Is it possible to change the ...
1
vote
2answers
70 views

will tail with piping read whole file?

I want to read a big log file with 10000 lines everytime. and I use this command: tail -c +offset somefile | head -n 10000 my question is, with the piping of head, will tail read the whole file? ...
1
vote
1answer
89 views

how do i redirect output from tailf & grep to a file [duplicate]

All I wanted is to grep for specific lines in an ongoing log and re-direct it to some file.. tailf log | grep "some words" Now, I want the above command output to get re-directed to some file in ...
0
votes
1answer
36 views

Need to grep for specific lines from ongoing log and save it in some file

So, let me start with the overall outcome that i want to achieve. There is just one log, which will have info on certain devices, that i am upgrading. I use "tailf log" to monitor the log. Now, ...
7
votes
4answers
264 views

Grep from the end of a file to the beginning

I have a file with about 30.000.000 lines (Radius Accounting) and I need to find the last match of a given pattern. The command: tac accounting.log | grep $pattern gives what I need, but it's too ...
4
votes
2answers
36 views

Can less load lines which were appended to a file after opening?

When I am viewing a log file in less is it possible to make less reload the file to get lines which were appended to that file since it was opened?
0
votes
1answer
52 views

Stop tailing log

I have a problem, I accidentally did tail -f on a log, but now I cant quit! - Its the anaconda log during a redhat install. Control-C doesn't seem to work, I guess due to it saying sh: no job control ...
2
votes
1answer
51 views

Piping periodic data between Python scripts

How to receive data from the environment e.g. bash I am trying to launch two Python scripts in bash and pipe stdout from one of them to stdin of the other. The first script outputs a single ...
0
votes
2answers
123 views

Tail multiple files and output as additional column with 'find' results

Would like to pull the last line of text from a specific (multiple) files in a directory. Additionally, I'd like the results to be in a more traditional column format (like ls) with path, rather than ...
2
votes
3answers
141 views

How to tail a file over the network?

How can I tail -f a file that over the network, say at \\192.168.2.130\public\print.log? I have tried the variations of the following: tail -f //192.168.2.130/Southpaw/Tactic/print.log which erred ...
3
votes
2answers
97 views

How can I monitor a file that fully recreates during its run?

This is a follow-up question of Why are some file changes not shown in tail -f? With the use of capital F: tail -F I can monitor the output of tail -F ~/.mysql_history from the manual: ...
3
votes
1answer
77 views

Why are some file changes not shown in tail -f?

I tried to follow the mysql history file with: tail -f ~/.mysql_history in another window I entered as the same user: mysql -u someotheruser -p and none of the following commands are shown in my ...
5
votes
2answers
100 views

Show tail of files in a directory?

I have a directory that is too huge to browse by any means. Grepping returns argument lists too long, WINSCP crashes when trying to open the directory. Is there a way I can view just the last 200 ...
68
votes
3answers
2k views

Does tail read the whole file?

If I want to tail a 25 GB textfile, does the tail command read the whole file? Since a file might be scattered on a disk I imagine it has to, but I do not understand such internals well.
4
votes
1answer
127 views

How can I colorize head, tail and less, same as I've done with cat?

I've got 'color cat' working nicely, thanks to others (see How can i colorize cat output including unknown filetypes in b&w?). In my .bashrc: cdc() { for fn in "$@"; do source-highlight ...
1
vote
1answer
33 views

Get last changed content since last read

How can I get the last changed content of a file, since its last read? Something more precise that this: tail - <nr >file_1.txt >file_2.txt where file_2.txt gets the last modified ...
2
votes
1answer
312 views

Search and Filter Text on large log files

I use the tail, head and grep commands to search log files. Most of the time the combination of these 3 commands, in addition to using pipe, gets the job done. However, I have this one log that many ...
1
vote
4answers
152 views

How to change color of a character while tailing and tr

I regularly use this command line but I would like to change the color of the "|" to green in the output. Does anyone know how I can accomplish this? tail -f file.log | tr '\001' '|' | grep TEST
4
votes
5answers
208 views

Only output most recent 10 (or n) lines of a lengthy command output

I have currently worked alot with shell and bash on linux. I have made tons of backups scripts and much more. In many cases I have a command that outputs thousands of lines. I actually need these ...
1
vote
2answers
78 views

How to hide the . and .. from ls

When I run ls -l on a directory, I see an entry titled '.' How can I remove the row containing '.' from the output? ls -latr /foo | tail -n5 -rw-rw-r-- 1 guest bar 59169 Aug 20 12:22 ...
2
votes
1answer
245 views

Periodically get new lines from file, possibly logrotated

I'm looking for a fairly simple way (no development involved -- I could write this in Python but I'm hoping there's something already out there). I have a log file (in my case written by rsyslogd). ...
2
votes
3answers
154 views

Exception handling when using tail -f to monitor a log

I have a main script calling the script to do the monitoring. I am trying to catch the exception that the log is missing or not accessible anymore. tail -f is used instead of -F since the logs are ...
2
votes
2answers
74 views

whats a good tool to search tail -f output

I am dumping some debug info into a text file that I am using tail -f to monitor. Is there a tool that I can then pipe that tail -f data into to be able to search the text on screen using regular ...
1
vote
4answers
200 views

Tail -f the most recent log file

In a few spots I got this to work ls -rt /path/to/log/file/ | tail -1 | xargs tail -f But I can't figure out why it won't always work (This is quick fix until I get the log rolling fixed here)
2
votes
1answer
483 views

Using tail to follow daily log file in Bash

I have a task to use a bash script to monitor a couple of log files named with the current day, eg. YYYY-MM-DD.log. (1) I used tail -f to follow the file but unable to deal file rotation. Even if ...
3
votes
3answers
776 views

How do I make Vim behave like “tail -f”?

I would like to know if there is a way to make Vim behave like tail -f. Even the best Vim plugin I've found so far doesn't do what I expect. I really want to see the file update in real-time. Even ...
2
votes
1answer
426 views

Issue with real-time log inspecting piping tail, grep and cut

I have to inspect a growing log in real time, and I found an issue that makes me miss some lines (I can't understand exactly what lines) using tail -f or tailf, grep and cut. I use grep because I ...
3
votes
4answers
458 views

is there an alternative to tail -f that has convenient scrolling? [duplicate]

I'm usually inside GNU Screen or tmux, which doesn't give me excellent scrolling functionality. Is there an alternative to tail -f that allows me to quickly scroll up? A tool that is like most is to ...
3
votes
1answer
89 views

How to follow and seek in a file being piped through a filter, in less

I basically wish to seek, search and follow a growing log file after passing it through a sed filter. I figured I need to follow a file with tail -f pipe it to sed and then pipe that to less. For ...
1
vote
2answers
121 views

tail -f but suck in content of the file first (aka `cat -f`)

I need to display whole file before tracking it for a new changes, not only the last 10 lines (yep, I know it's not tail conceptually). In other words, something like cat -f would do, if it would ever ...
1
vote
1answer
125 views

POSIX head and tail not feature equivalent

The documentation for POSIX tail's -n option says that The origin for counting shall be 1; that is, -n +1 represents the first line of the file, -n -1 the last. So tail -n 10 (used later on the ...
2
votes
1answer
71 views

Making less's follow option show line movement

I often find myself using less to display log files that contain hundreds of contiguous, identical lines that are appended to the files at set intervals. For example, something happened something ...
9
votes
1answer
241 views

How to do `head` and `tail` on null-delimited input in bash?

find command can output names of files as a null-delimited strings (if -print0 is provided), and xargs can consume them with -0 option turned on. But in between, it's hard to manipulate that ...
0
votes
1answer
94 views

Tailing a New File with an Old Name [duplicate]

This is along the lines of How to start tailing a file that has not been yet created with a twist: a file with the name already exists. I have a program that is run multiple times; when the output ...
4
votes
0answers
72 views

Combing head and tail in a single call via pipe [duplicate]

On a regular basis, I am piping the output of some program to either head or tail. Now, suppose that I want to see the first AND last 10 lines of piped output, such that I could do something like ...
0
votes
3answers
210 views

Using tail command to create a file

This is what I did using tail command. When I try to output the file to screen the file is empty. ~]$ tail > AFS2F1 PASSES ALL DATA FROM INPUT TO OUTPUT PASSES ONLY SPECIFIED COLUMNS PASSES NUMBER ...
2
votes
2answers
327 views

Tail -f piped through grep not outputing to file, but outputs to console

I'm using the following command tail -f /mydir/myfile | grep "searchterm" >> outfile Without the -f it works fine, but with the -f, which I need, nothing is written to the file. The ...
11
votes
4answers
611 views

How to do a continous 'wc -l' with gnu texttools?

I know of course that cat logfile.txt | wc -l 120 will tell me the number of lines in a file. Whereas tail -f logfile.txt will show me the new lines that another program writes to logfile.txt. ...
3
votes
2answers
1k views

How to use tail -f with grep to show surrounding lines

I would like to see the output in a logfile greped by only one domain but also the following two lines. Example: tail -f /var/log/apache2/modsec_audit.log |grep mydomain.de this shows all lines, ...
2
votes
1answer
128 views

Does multitail follow the inode or the file name by default?

For logrotated files one usually uses tail -F instead of tail -f to follow the log file contents. Does multitail(1) automatically follow the name instead of the inode (which likely changes with the ...
1
vote
3answers
218 views

How to view output for ALL processes simultaneously?

I know that you can connect to various background processes to watch their console output, but is there a way to view the output of all processes at once? Likely it would scroll quickly and be hard to ...
4
votes
1answer
576 views

Observe multiple log files in one output

Is there an easy way to do something like tail -f mylogfile but to have the changes of more than one file displayed (maybe with the file name added as prefix to each line)? Or maybe a GUI tool? I am ...
2
votes
3answers
936 views

How do I tail a log file and keep tailing it when the latest one changes date?

I'm using RHEL 4. The normal tail -F file_name*.log doesn't update when the time flips over to 0000. Here's what I've tried so far from searching the web, both of which try to use nested tail: ...
0
votes
3answers
285 views

Graphical logviewer that auto reload when file changes?

I'm wondering if there's a graphical viewer, also it needs to support auto-reloading when log file has changed. ksystemlog doesn't reload automatically.
1
vote
1answer
463 views

How to tail/grep/awk the last N bytes of a file, rather than lines

I have an application that is logging to a plain text log file (myapp.log) but it doesn't seem to be writing new line characters at the end of each log entry. If I execute a command like tail -n 50 ...
0
votes
2answers
573 views

$(tail) into variable removing \n

I am doing the following: x="Hello to the world of tomorrow\n <pre>"; x="${x}$(tail -n 50 log/logfile.log)" x="${x}</pre>"; echo -e $x | ./perlscript The Perl script: #!perl # ...