Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Linux basic command-tail displays text

2025-01-19 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/02 Report--

Tail

Displays part of the end of the text file, with the last 10 lines displayed by default.

The scope of this command: RedHat, RHEL, Ubuntu, CentOS, SUSE, openSUSE, Fedora.

1. Grammar

Tail [options] file

2. List of options

Option

Description

-- version

Display command version information

-- help

Show help documentation

-c |-- bytes=k

Show the last k bytes

-f

Continuous reading of text trailing data, usually used to monitor log files

-F

Equivalent to-- follow=name

-n |-- lines=k

Show the last k line

-- pid=PID

Used with-f to stop tail when the specified process number program ends

-Q |-- quite |-- silent

Do not display file name

-- retry

Continue to try to open the file, even if the file is inaccessible or becomes inaccessible.

-v |-- verbose

Show file name

3. Examples

1) Show the last line

[root@localhost weijie] # cat 1.c / / View the file

Hello world

I am david.

I love linux

Love code.

[root@localhost weijie] # tail-n 1 1.c / / Show the last line

Love code.

2) display the last few characters

[root@localhost weijie] # tail-c 10 1.c / / display the last 10 characters

Ove code.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report