/**************************************************************
> File Name: tail.c
> Author: 逮枫灵
> mail: Albert@sshenp.com
> Created Time: 2020年06月13日 星期六 20时55分43秒
**************************************************************/
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <errno.h>
#include <fcntl.h>
#include <unistd.h>
#define BUFF_SIZE 1024
int strchrcnt(char *src, char c);
off_t get_start(int n);
void tail_print(int n);
const char *filename;
off_t offset;
int fd;
int main(int argc, char *argv[])
{
int n = 10;
if(argc == 4 || argc == 3 && strncmp(argv[1], "-n", 2) == 0
linux tail 命令的简单实现
最新推荐文章于 2024-04-09 22:13:39 发布
![](https://img-home.csdnimg.cn/images/20240611030827.png)