PHP 或 Linux Shell : Fastest way to reduce a text file to only have the last 10 characters

标签 php linux

我需要在 PHP 或 Linux Command Shell 中以最快的方式减少文本文件以仅保留最后 10 个字符。需要明确的是,我需要在同一个文件上进行减少。

谢谢:)

最佳答案

Shell tail 命令:

tail filename.txt --bytes 10 > filename.txt

关于PHP 或 Linux Shell : Fastest way to reduce a text file to only have the last 10 characters,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11658796/

相关文章:

php - Laravel 关系数据库连接

php - 如何使用 PHP 从数据库中获取单个数字

linux - 将 FD 转换为句柄

php - 从 Linux 服务器发送 iMessage?

C 在不使用缓冲区的情况下流式传输 : Copy data from one stream to another directly,

linux - 如何使 ftrace 可以使用 linux 内核函数?

php - 试图在 PHP 中读取 StdClass 对象

javascript - 如何创建单词选择器以从文本中选择并突出显示和删除选定的单词?

ruby - 是否可以在 Chef 中使用 bash 设置 Ruby ENV?

php - 从 Wordpress 获取所有帖子作为 JSON