linux下拷贝:文件指定个数拷贝/文件内容指定行数拷贝
linux-dash
A beautiful web dashboard for Linux
项目地址:https://gitcode.com/gh_mirrors/li/linux-dash

·
1、复制文件A的前N行数据到文件B中
在命令行直接输入:(将data.txt的前100000行复制到sample.txt中)
head -n 100000 data.txt > sample.txt
2、复制文件夹A中的N个文件到文件夹B中
查看文件夹下文件数目:
ls -l |grep "^-"|wc -l
复制前100个文件到文件夹temp中:
ls |head -n 100|xargs -i cp {} /tmp
复制后100个文件到文件夹temp中:
ls |tail -n 100|xargs -i cp {} /tmp
示例:




A beautiful web dashboard for Linux
最近提交(Master分支:5 个月前 )
186a802e
added ecosystem file for PM2 4 年前
5def40a3
Add host customization support for the NodeJS version 4 年前
更多推荐
所有评论(0)