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.

Depending on the context tail may refer to:

  • the part of a list that comes after the head i.e. the list you obtain when you remove the first element.

  • the tail unix command which displays the last lines of a file. It's counterpart which displays the first lines is head (). Example: tail -n 10 file will output last 10 lines of file.


See also:

1032 questions
0
votes
2 answers

Tcl determine file name from browser upload

I have run into a problem in one of my Tcl scripts where I am uploading a file from a Windows computer to a Unix server. I would like to get just the original file name from the Windows file and save the new file with the same name. The problem is…
Matt
  • 1,328
  • 1
  • 16
  • 28
-1
votes
1 answer

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 should work. Is there a way to check if the file to be tail has human readable data? If not, I wish to use ansible's fail module and fail the Play. In shell scripting…
Ashar
  • 2,942
  • 10
  • 58
  • 122
-1
votes
1 answer

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 -f example | grep "DESIRED" >> different all of them not working and…
junglekim
  • 29
  • 5
-1
votes
2 answers

Script to search for values in the log

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 reading of the log using tail and grep is…
-1
votes
2 answers

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 = list(remote_file.readlines()) …
Inuyasha84
  • 50
  • 9
-1
votes
1 answer

using tail to view the access logs on my server

I'm on centOS and new to using tail to view the access logs on my server, and I'm not able to understand the meaning of every information I see. For example, one of the info it shows me is: 123.456.789.10 -- [03/Dec/2021:22:30:47 +0000] "POST /…
JJJ
  • 47
  • 1
  • 4
-1
votes
1 answer

What is splunk's log file collect technology

I'm using Splunk and Splunk forwarder (UF) for log collecting. I have questions that "How to Splunk collect log file?", "What is data collect technic?" So, I tried to find answer and found a few informations from Splunk doc, .conf's ppt, etc. But,…
heunji
  • 21
  • 1
-1
votes
1 answer

How can I insert an Item at the end of the List?

I am working on a project for my Data Structures class that asks me to write a class to implement a linked list of ints. Use an inner class for the Node. Include the methods below. Write a tester to enable you to test all of the methods with…
user16854661
-1
votes
2 answers

Do a tail -f untill pattern found BACKWARDS

I'm trying to get the last lines of a log file, and I've looked around, and found tail -f /path/to/file.log | sed '/^MYSTRING/ q' Is a common used way! BUT this one gets the data UNTIL it finds it match, not backwards. Let me explain; Logfile: (just…
-1
votes
2 answers

TCL tail file name

I used the tail command to capture the name from a file name before the ".". However, some of my files has name that looks like that (ie: abc.txt.gz). I only want abc and not abc.txt. Please advise. Current Output main_name = abc.txt What I want…
Kimi
  • 43
  • 1
  • 7
-1
votes
1 answer

tail -f -n 1 returns all content , not changes

part one: I have a text.txt file in linux ubuntu. I want to watch the file with tail for grabbing the last content of the file. # command linux tail -f text.txt this command returns all of the content. so I changed it to : # command linux tail…
Babak Abadkheir
  • 2,222
  • 1
  • 19
  • 46
-1
votes
1 answer

TAIL recursion to calculate Harmonic Series?

I'm trying to calculate the Harmonic Series with TAIL recrusion,simple recrusion works but not the terminal version , This is the simple recrusion version : #include float calcul(int n) {if(n==1) return 1; else return…
sahar
  • 3
  • 2
-1
votes
2 answers

Append filename with last 3 characters of the parent directory in Bash

EDIT: Thanks for the help on this. I was hoping to run it as a for loop so I could pass the extension in as an argument later eg: for file in (find . -type f -name '*.'$1); do etc... Could anyone add the best approach to adapting one of the…
-1
votes
1 answer

problems while reading log file with tail -n0 -F

i am monitoring the asterisk log file for peers that get offline. the if part is working correct, but the sed command is not executed in the else part, although the echo command works. What do i need to change tail -n0 -F /var/log/asterisk/messages…
calabash
  • 115
  • 1
  • 7
-1
votes
2 answers

Discrepency between line numbers from nl and tail

When using the following command: nl /etc/snort/snort.conf | grep output I get the following output: 33 # 6) Configure output plugins 445 # Step #6: Configure output plugins 450 # output unified2: filename snort.log, limit 128,…
RossAlexander
  • 423
  • 3
  • 10