`
whitesock
  • 浏览: 483705 次
  • 性别: Icon_minigender_1
  • 来自: 大连
社区版块
存档分类
最新评论

Several Frequently Used Commands

阅读更多

sed '/^\s*$/d' a.txt # delete ALL blank lines
sed '/./,$!d' a.txt # delete all leading blank lines at top of file

 

sed '=' a.txt | sed 'N;s/\n/\t/' # cat -n a.txt

sed '/./=' a.txt | sed '/./N; s/\n/\t/' # number each not blank line of file

 

sed '1!G;h;$!d' a.txt # reverse order of lines

sed '/./,$!d' a.txt # delete all leading blank lines at top of file

sed '$!N; /^\(.*\)\n\1$/!P; D' a.txt # delete duplicate, consecutive lines

 

gawk '$1~/[0-9].*/{total += $2} END{print total}' a.txt
gawk 'BEGIN {"cat c.txt | wc -l"|getline n} n>10 {print}' a.txt

ls | gawk -F. '{system("mv " $0 " " sprintf("%03d", $1) "." $2)}

 
分享到:
评论

相关推荐

    A few frequently used SSL commands

    SSL(Secure Sockets Layer)是网络安全领域中一种广泛使用的协议,用于在互联网上提供安全通信。它通过加密传输数据来保护用户的隐私和信息安全。本文将详细介绍一些常用的与SSL相关的OpenSSL命令,帮助你管理和...

    Frequently used Phrasal Verbs in Daily English(日常英语常用词及短语)

    在日常英语交流中,掌握一些常用的短语动词是至关重要的,它们能够帮助我们更自然、流畅地表达思想。以下是一些常见的短语动词及其用法: 1. **break** - 分解或破裂 - break down:设备故障,不能正常工作;...

    PowerCmd.V.2.2.326.Incl.Keygen.rar

    You can easily organize prompt windows, use Windows style text editing behavior, auto-log, highlight keywords, configure font and colors, customize a toolbar for frequently used commands or tools, ...

    matlab分时代码-Frequently-used-code-blocks:一些常用的代码块

    Frequently-used-code-blocks Some frequently used code blocks. Python project structure for a learning paper Reference: , Self's AnomalyDetection - Dataset(Fold) - 保存和处理真实数据集 - dataset1(Fold)...

    Some-frequently-used-C-code.zip_visual c

    在编程领域,C语言是一种非常基础且强大的编程语言,它被广泛应用于系统编程、嵌入式开发、软件工程等多个方面。Visual C++是微软公司推出的一款集成开发环境(IDE),专门用于编写C和C++代码,它提供了丰富的功能,...

    VA_X_Setup1624(包含解码器)

    强大的C++ IDE 帮助工具。 1.Visual Assist X simplifies large tasks by ... Type a shortcut to expand frequently used snippets of code. Visual Assist X has many features to help you code efficiently 3. etc

    Learning Docker

    What You Will LearnDevelop containerized applications using the Docker version 17.03Build Docker images from containers and launch ...yourself with the frequently used commands such as docker exec...

    页面置换算法(Linux下运行)

    4) 最不经常使用法(Least Frequently Used) 5) 最近未使用法(No Used Recently) 其中,命中率=1-页面失效次数/页地址流长度。试对上述算法的性能加以较:页面个数和命中率间的关系;同样情况下的命中率...

    Frequently Asked Questions for FreeBSD.pdf

    根据提供的文档信息,我们可以深入探讨FreeBSD操作系统的常见问题及其解答。这不仅涵盖了FreeBSD的基础知识,还涉及了具体的版本信息和技术细节。以下是从给定的文档标题、描述、标签和部分内容中提取的关键知识点。...

    Learning Docker - Second Edition [2017].azw3电子书下载

    Familiarize yourself with the frequently used commands such as docker exec, docker ps, docker top, and docker stats In Detail Docker is an open source containerization engine that offers a simple ...

    HANA FAQ (frequently asked question)

    35. Where can I find information about available, used and deprecated features? 36. Does SAP HANA provide a history of DDL operations? 37. What is the difference between the SAP HANA enterprise ...

    ginh:ginh不是直方图:直观地评估您的shell使用模式

    `ginh` generates a bar chart of your most frequently used shell commands, according to your shell's history file. Options: -a disable reversing aliases to find the command they reference -n NUM ...

    verilog_frequently_asked_questions.rar_Verilog_Frequently_earzoo

    这份名为“verilog_frequently_asked_questions.rar”的压缩包,显然包含了关于Verilog的常见问题及其解答,是学习和理解Verilog的重要资源。 在学习Verilog时,了解其基本语法和特性至关重要。Verilog支持结构化...

    Verilog_Frequently_Asked_Questions.pdf

    《Verilog常见问题》是一本专注于Verilog语言及其在数字IC设计和FPGA开发领域应用的电子书。本文将根据所给文件内容,深入解析Verilog语言中的一些基础知识点,包括连续赋值与过程赋值的区别、initial和always构造中...

    eBoostr V3 + Crack

    # mart caching of frequently used applications and files for maximum performance; # Supports both USB and non-USB removable media devices (CF, SD/SDHC, MMC, xD and other memory cards), as well as ...

    Android_Frequently_Asked_Questions

    ### Android在i.MX6平台上的常见问题解答 #### 一、如何配置构建信息? 对于每次构建,都需要定义`BUILD_ID`(构建标识)和`BUILD_NUMBER`(构建编号)。通常,我们会使用软件版本号作为`BUILD_ID`,并用构建用户...

    EDVR_REDS_deblur_L.pth

    SR: super-resolution with a fixed downsampling kernel (MATLAB bicubic downsampling kernel is frequently used). Most of the previous video SR methods focus on this setting. SRblur: the inputs are also ...

    cunchuguanli.rar_allocate memory asm_out_伙伴分配_页面置换

     4) 最不经常使用法(Least Frequently Used)  5) 最近未使用法(No Used Recently)  其中,命中率=1-页面失效次数/页地址流长度。  试对上述算法的性能加以较各:页面个数和命中率间的关系;同样情况下的...

Global site tag (gtag.js) - Google Analytics