当前位置:网站首页>[practical Script] obtain the line number of a file, and then delete the file content.
[practical Script] obtain the line number of a file, and then delete the file content.
2022-06-11 17:57:00 【Sighed and sighed】
Get the line number of a file , Then delete the file contents .
#!/bin/bash
lines=`wc -l 27754.txt`
newlines=`echo $lines | awk '{print $1}'`
sed -i "1,${newlines}d" 27754.txt
边栏推荐
- Test and analysis of tidb write hotspot
- 论文阅读 dyngraph2vec: Capturing Network Dynamics using Dynamic Graph Representation Learning
- tidb-gc相关问题
- Comparison of mongoose in express, KOA and egg
- Merge two ordered linked lists ---2022/02/24
- Intelligent overall legend, legend of wiring, security, radio conference, television, building, fire protection and electrical diagram [transferred from wechat official account weak current classroom]
- Port planning and APJ
- The top ten trends of 2022 industrial Internet security was officially released
- 6-7 file read / write operation
- Speed adjustment of tidb DDL
猜你喜欢

聚类方法汇总

Three steps of ffmpeg CBR precise bitstream control

Chorus translation

Install MariaDB 10.5.7 (tar package installation)

Seeing the sudden death of a 28 year old employee, I was silent

mysql8安装,navicat安装,sqli-labs搭建

Ffmpeg hard codec inter QSV

ffmpeg硬件编解码Nvidia GPU

端口规划与APJ
![[online problem] timeout waiting for connection from pool](/img/f0/7e8444ed7d0921b98d5e998e274bc8.png)
[online problem] timeout waiting for connection from pool
随机推荐
spawn ./ gradlew EACCES at Process. ChildProcess._ handle. onexit
【先收藏,早晚用得到】49个Flink高频面试题系列(一)
The top ten trends of 2022 industrial Internet security was officially released
6-3 batch sum (*)
合并K个升序链表---2022/02/26
【先收藏,早晚用得到】100个Flink高频面试题系列(三)
Service learning notes 03 front desk service practice
Hash表、 继承
送给大模型的「高考」卷:442人联名论文给大模型提出204个任务,谷歌领衔
Learning about canvas API
av_read_frame返回值为-5 Input/output error
光纤熔接知识汇总【转载自微信公众号弱电智能化工程2018】
使用exe4j 将.jar文件打包为.exe文件
Tidb CDC create task error unknown or incorrect time zone
Service学习笔记03- 前台服务实战
为什么udp流设置1316字节
There are three standards and three methods, i.e. fast growth and quick realization. How to choose the direction for making short videos of we media?
6-2 写文章(*)
require和ES6 import的区别
mysql8安装,navicat安装,sqli-labs搭建