Linux 命令记录

1. 显示文件的首尾字符,用于查看日志等操作

\displays the first 6 lines of a file 显示档案的前 6 行

head -6 readme.txt

\displays the last 25 lines of a file 显示档案最后的 25 行

tail -25 mail.txt

\结合了 head 与 tail 的指令,显示档案的第 11 行到第 20 行:

head -20 file | tail -10

2. 查看文件大小信息

du -sh *

3. 查看当前系统磁盘使用空间

 df -h

 4. SCP 文件传输

scp -r xxxxx root@xx.xx.xx.xx:/data/program/test
该命令会把当前目录下的xxxxx文件夹拷贝到目标机器的test文件夹下--->/data/program/test/xxxxx
原文地址:https://www.cnblogs.com/yishilin/p/9627552.html