Linux5-echo,>,tail

1.echo命令

echo是输出命令,类似printf

例如:echo "hello world",输出hello world

echo 'pwd',输出pwd的位置。''是键盘上~

2.重定向符> >>

>指把左边内容覆盖到右边

echo 'hello world'>test.txt

>>把左边内容追加到右边

3.tail命令

tail用于查看末尾内容,默认为末尾10行

例如:tail test.txt

选项-num,例如tail -5 test.txt,查看末尾5行

选项-f,例如tail -f test.txt,实时跟踪(如果添加数据,这里立即显示,如果要退出追踪,按Ctrl+c)

相关推荐
Yana.nice7 小时前
Linux 只保留 30 天内日志(find命令删除日志文件)
linux·运维·chrome
DFT计算杂谈10 小时前
无 Root 权限在 Tesla K80 零门槛部署 DeepSeek 大模型
linux·服务器·网络·数据库·机器学习
Zhang~Ling11 小时前
从 fopen 到 struct file:从零开始拆解 Linux 文件 I/O
linux·运维·服务器
DeeplyMind11 小时前
Linux 深入 per-VMA lock:Linux 缺页路径如何摆脱 mmap_lock
linux·per-vma lock
爱写代码的森12 小时前
蒙三方库 | harmony-utils之FileUtil文件重命名与属性查询详解
linux·运维·服务器·华为·harmonyos·鸿蒙·huawei
XMAIPC_Robot13 小时前
软硬协同实时控制|RK3588业务调度+FPGA硬件时序,ethercat实现半导体设备微秒级响应(125us)
linux·arm开发·人工智能·fpga开发
重生的黑客13 小时前
Linux 进程优先级、切换与调度:从孤儿进程到 O(1) 调度模型
linux·运维·服务器·进程优先级·nice
骑上单车去旅行14 小时前
MD5校验对比脚本
linux·服务器·windows
平生幻15 小时前
Linux 常用命令
linux
ShirleyWang01216 小时前
让headlamp控制台能访问
linux·服务器·python·k8s·k3s