Questions tagged [tail]
The tail is the part of a list that comes after the head. It's also a unix command that shows the last lines of a file.
1,034
questions
1
vote
2
answers
55
views
How to return the last two lines of summary output from a linear model in R?
After finding a regression prediction in lm I want to return only last two lines of the summary. What would be the best function to use?
my_model_lm(y ~ x1 + x2 + x3, data = [data])
summary_result <...
0
votes
1
answer
55
views
Questions about tail -c [closed]
When I open my terminal and input the command echo 987654321 | tail -c3, the output is 21.
However, when I create a file named test_tail.sh, write 987654321 into the file, the command tail -c3 ...
0
votes
1
answer
87
views
parsing a tail file to process commands
I have found some info on this, but not enough to get me going with this project. I have limited bash experience, trying to learn.
I have a log file that I would like to read (tail) and process lines ...
3
votes
2
answers
84
views
Bash script to remove folders older than X, but skipping newest N... Compatible with special characters in path
I am writing a backup script in bash and want to delete all backups older than X days, while leaving at least the newest N backups.
This seems so simple, yet I have not been able to find a solution to ...
0
votes
1
answer
922
views
Filament Many To Many Relation Manager , not working
I have the model Student
Student
groups : BelongsToMany
and model Group
Group
students: HasMany
of course there is a pivot table group_student with
group_id
student_id
I am trying, in Filament3, ...
1
vote
2
answers
51
views
Equivalent of Unix/Linux tail command for Powershell - that supports pipes?
I'm aware that Get-Content has a -Tail parameter, but as far as I can tell, there's simply no way to get it to accept piped input.
So how do I get something like this to work? I just want to be able ...
0
votes
0
answers
6
views
mitigate long tail problem in recommendation using Earth mover's distance with Latent Dirichlet Allocation
Can reduce A long tail problem in recommendation with EMD and LDA? Can these techniques work for this?
I am trying EMD and LDA techniques for reducing long tail problems in the recommendation and ...
0
votes
0
answers
37
views
the updated content can not shown on the screen when i use tail -f command
When I use the 'tail -f catalina.out' command to continuously monitor the content of a log file, the updated content is not showing on the screen. But when create a symbolic link to the log file, ...
3
votes
1
answer
1k
views
Docker Compose. Call a custom script
I have a simple docker-compose definition where I want to run a simple cmd/bash command:
basictests:
image: ${DOCKER_REGISTRY-}mytests
build:
context: .
dockerfile: MyTests/Dockerfile
...
0
votes
0
answers
65
views
Continuously read lines from a file (like "tail -n0 -F" in bash)
I need to write a PHP script which reads lines of a log file (which is frequently appending new lines) and I expect the script to:
When running the script, it should only read new appended lines and ...
0
votes
0
answers
67
views
Laravel dynamic display file content
I have a terminal that logs on a file linked in my app /storage/logs/output.log.
I have no problem displaying it inside my view, the only problem is that I want the content of this file to update ...
0
votes
1
answer
72
views
Tail vs sleep to wait on process
Currently I do:
while [ -d "/proc/$PID" ]; do
sleep 1
done
To wait for a process to exit. If I would replace it with:
tail --pid=$PID -f /dev/null
Would that be more efficient for the ...
2
votes
1
answer
124
views
Prepend tail -f output with filename
To monitor a system I need to constantly have a log tail running (it greps out some data as well). It's basically
tail -f *.log' | egrep -v '(str1|str2)
The output of tail is very noisy and it ...
0
votes
0
answers
39
views
How to sort Head() and Tail() function in a data item in COGNOS?
I have a quick question. I am working on crosstab in COGNOS. Here I want amount, count and average, variance1 (selected year/prior year) and variance (prior year/2year prior) of payment line code for ...
-5
votes
2
answers
37
views
Head() is not showing the result
import pandas as pd
df = pd.read_csv("stock_data.csv")
df.head()
Is not showing the result: suggestion for improvement?
0
votes
1
answer
186
views
td-agent-bit delivers only after restart and then stops
In my Office I am forced to work still with td-agent-bit, an upgrade to the recent fluent-bit should be possible later this year.
I have trouble with the following configuration:
[INPUT]
Name tail
...
0
votes
1
answer
23
views
Line breakes missing when using tail command
I'm using the tail command to monitor a log file on Os X.
command: tail -f path_to_file
When viewing the result in the terminal window, the line breaks are missing.
The log statements have '\r' to ...
0
votes
1
answer
147
views
Perl: Issue coming while running script via task scheduler (Windows) and not via command line
Below is the code which I am using (in windows(administrator mode)):
my $jobs=`bjobs -w | tr -s " " | cut -d " " -f7 | tail -n +2 | sort -u | grep -i "_PV_"`; ## ...
1
vote
1
answer
80
views
Perl regex one-liner hangs on tail -f, but not on tail
I'm obviously missing here something in between how the perl loop works, tail -f and regex.
Setup:
@$ echo xab > a
Test:
@$ tail a | perl -pe 's/[^a]/*/g'
a
@$ tail -f a | perl -pe '...
0
votes
2
answers
58
views
Problems inserting element at the tail of a list JAVA
My assignment is implementing a linkedList as a queue. I'm having a problem adding elements at the tail of the list. I get no Exception but the problem is that when adding a element, the list still is ...
0
votes
0
answers
39
views
adding series to a dynamic, already displayed plot in matplotlib
problem
I have a problem with matplotlib. I looked at a lot of things online (including an extensive amount of stack overflow questions) and did not find an answer to my problem. To be clear: I know ...
-1
votes
1
answer
189
views
How to check if a file is of type Human readable in Ansible
I need to check in ansible if the file is human-readable i.e tail -500f <filename> should work.
Is there a way to check if the file to be tail has human readable data?
If not, I wish to use ...
0
votes
1
answer
97
views
How to 'Follow' a File in Linux? Grep? Pipe? WGET Etc
The requirement is essentially to monitor changes on /HelloWorld.txt, so that any new lines that are added can be 'picked up' and piped to something like a WGET, for that single new line.
I'm still in ...
-1
votes
1
answer
130
views
How to "tail -f" with "grep" save outputs to an another file which name is time varying?
STEP1
Like I said in title,
I would like to save output of
tail -f example | grep "DESIRED"
to different file
I have tried
tail -f example | grep "DESIRED" | tee -a different
tail -...
0
votes
1
answer
139
views
I receive an Application error while trying to access the app in production
My Heroku App is not working anymore and is giving me back the attached error. Can someone help in troubleshooting? I have read about a plan upgrade needed in some cases, is this error related to ...
0
votes
0
answers
325
views
How to run tail and grep in a crontab
I am trying to run a tail and grep command that gets the last 10 lines containing Error in all logfiles in the folderevery minute using crontab and fill a text file with the output. The line below is ...
0
votes
1
answer
145
views
How to tail and use grep for all the log files inside a folder and subfolders using subprocess?
I am using flask and I am trying to tail and get the lines containing Error and or Warning in all the log files inside the folder and subfolders using subprocess. I show the outcome on the webapp ...
0
votes
1
answer
83
views
One line-command for less and shift+F
I would like to open a file with less and automatically go in "tail mode" , which I usually achieve by pressing shift+F when the file is already opened in "full screen mode" with ...
1
vote
5
answers
59
views
How to find first and last sections of an alphabetically sorted list in R
how would I go about sorting a vector alphabetically and then getting the first 10 names and last 10 names printed according to the new alphabetical order?
i know to use sort(names) to get the vector ...
0
votes
2
answers
75
views
Racket language Accumulator tail recursive
I am trying to write a tail-recursive function with an accumulator of joining two sorted lists.
input: (40 43 50)(42 46 48)
output: (40 42 43 46 48 50)
It needs to be done tail-recursive where we call ...
0
votes
2
answers
113
views
Bash command to copy a log file to another directory as soon as specified expression is found in it
I've got a log file that is rotated automatically when it reaches a certain size. The system keeps 5 rotated logs at a time, the older ones are deleted, and the lifetime of a log file is about 20 ...
2
votes
1
answer
261
views
How to use multitail with grep on each input file
My company's server runs Apache for MANY sites, but only has 1 (one) access.log and 1 (one) error.log. One of the sites gets a lot of traffic, causing the logs to fly by on the screen fairly quickly, ...
0
votes
1
answer
56
views
It seems that tail is buffering though -f option is set
I am writing a script for log parsing, made up with piped tail and grep commands.
For line numbering purpose, I use a command line which looks like (simplified) :
tail file_path -f|grep -n ""...
2
votes
1
answer
90
views
In julia `tail(DataFrame)` show tail not defined
In julia tail(DataFrame) show tail not defined. Anyone can help ?
tail(DataFrame)
0
votes
1
answer
418
views
TELEGRAF TAIL : Creating parser: Invalid data format: Grok
I am using Telegraf to get logs information from specific logs with Hexa data.
I am using tail but i still to get the same error : Invalid data format: Grok.
My log look like this :
18/08/2022 21:04:...
0
votes
1
answer
195
views
Picking last row data only from 2000 csv in the same directory and make single dataframe through R
Using R, I want to pick last row data only from over 2000 csv in the same directory
and make single dataframe.
Directory = "C:\data
File name, for example '123456_p' (6 number digit)
Each csv has ...
1
vote
2
answers
84
views
I want to create my own tail command with using getline and wihout use of lseek and fseek
I implemented below code but i want tailbuf[] should be in order. I want tailbuf[9] should be last line, tailbuf[8] second and so on. Please help me how i cant implement that in this code.
#include<...
-1
votes
2
answers
46
views
Script to search for values in the log [closed]
I have an update program that either completes the update successfully or goes into error and needs to be restarted.
I am implementing the task itself on Ansible, but to control the process, a dynamic ...
0
votes
2
answers
272
views
how can i print unicode characters when tailing a log?
I have log files have things like \u003c scattered throughout them. When I run a command like tail -f log.txt, I see escaped unicode characters everywhere, and am wondering what can I do to properly ...
-1
votes
2
answers
100
views
Tail and search in txt file
I need to make a search on a txt file. Originally I've thought to open the file and search for the word I'm looking for on the last line
remote_file = sftp_client.open('file.txt')
try:
lst = ...
1
vote
0
answers
203
views
Can you limit the files that telegraf tail to prevent linux opened files limit?
Before nothing thanks for the help, my problem is with a telegraf that writes from csv directory to influxdb, the csv generate one row every 10 minutes from that day and the next generates another csv ...
0
votes
1
answer
146
views
xv6 C skipping blank lines
I am trying to write a program in C (for xv6) that returns the last "n" number of lines of input text or a file (essentially tail) with the exception that it should not print blank lines(&...
1
vote
1
answer
482
views
tail command not working with nodejs exec command
I'm writing a quick test script that uses the tail command to monitor output that is added to a log file. When I execute the tail command directly in the console (I'm using OpenWRT), it works fine as ...
0
votes
1
answer
473
views
What is tail -n0 -f vs tail -n1 -f [closed]
I have wrote a simple script to keep monitor log file and append line and have implement some if statement if memet.
From my understanding, tail -n0 -f and tail -n1 -f both will does the job where you ...
0
votes
1
answer
2k
views
how to tail a rich progress bar outputed by a python module executed by subprocess.Popen
i have a python3 module which print a progress bar provided by rich module (./module/script.py)
import sys
from rich.console import Console
from rich.progress import Progress
import time
if __name__ ...
0
votes
1
answer
521
views
Count Lines, grep, head, and tail inside Feather Files
Setup: I am contemplating switching from writing large (~20GB) data files with csv to feather format, since I have plenty of storage space and the extra speed is more important. One thing I like about ...
0
votes
1
answer
667
views
Seek to the end of file and go up one line
Looking for some help navigating up one line in the following code.
I can't figure out a way to make it move one line up.
I have tried [1] and -1, but can't seem to move up one line.
Any help is ...
0
votes
2
answers
204
views
Is there a data structure for implementing a function equivalent to 'tail -n' command in C++?
I want to write a function equivalent to the Linux tail -n command in C++. While, I parsed over the data of that file line-by-line thereby incrementing the line count, if the file size gets really big(...
0
votes
0
answers
742
views
How to plot the last n records of a dataframe using pandas.DataFrame.tail()
I'd like to understand this odd behaviour from tail() when it is used inside a function. Here is the data:
| Date | Open | High | Low | Close | Adj Close | Volume | ...
0
votes
2
answers
2k
views
Last n rows of each files in a directory
Say I have a directory with N log files inside:
file1.log
file2.log
file3.log
...
fileN.log
Which linux command can I use to print the last n rows of each of those files above?
I know how to print it ...