cat

How to merge files in bash in alphabetical order

允我心安 提交于 2020-01-12 05:23:07
问题 I need to merge a bunch of mp3 files together. I know that simply doing cat file1.mp3 >> file2.mp3 seems to work fine (at least it plays back correctly on my Zune anyway). I'd like to run cat *.mp3 > merged.mp3 but since there are around 50 separate mp3 files I don't want to be surprised halfway through by a file in the wrong spot (this is an audio book that I don't feel like re-ripping). I read through the cat man pages and couldn't find if the order of the wildcard operator is defined. If

Spring自动装配Bean

我的未来我决定 提交于 2020-01-11 23:17:24
自动装配Bean可以简化我们的代码,这里以一个例子进行讲解,首先创建三个实体类 package com.zhiying.pojo; public class Cat { public void shout() { System.out.println("miao~"); } } package com.zhiying.pojo; public class Dog { public void shout() { System.out.println("wang~"); } } package com.zhiying.pojo; public class People { private String name; private Dog dog; private Cat cat; public String getName() { return name; } public void setName(String name) { this.name = name; } public Dog getDog() { return dog; } public void setDog(Dog dog) { this.dog = dog; } public Cat getCat() { return cat; } public void setCat(Cat cat) { this.cat =

awk基本用法

跟風遠走 提交于 2020-01-11 23:03:19
awk cat /etc/passwd | awk -F: '{print}' 默认全部字段,即列 cat /etc/passwd | awk -F: '{print $1 , $3 }' 以:为分隔符取1,3列 cat /etc/passwd | awk -F: '{print $1 "\t" $3 }' 以:为分隔符取1,3列并且以tab建隔开 df | awk -F "[[:space:]]+|%" '/^\/dev\/sd/{print $5 }' 取分区利用率 cat /etc/Passwd | awk -F ":" -v OFS = " " '/\<0\>/,/\<50\>/{print $1 , $NF }' 以:为分隔符取0-50uid用户的shell并以空格隔开 统计/etc/fstab文件中每个文件系统类型出现的次数 cat /etc/fstab | awk -F " " '/^UUID/{print $3 }' | sort | uniq -c 统计/etc/fstab文件中每个单词出现的次数 cat /etc/fstab | grep -o '\<[a-z]\+\>' | sort | uniq -c | sort -nr 提取出字符串Yd$C@M05MB%9&Bdh7dq+YVixp3vpw中的所有数字 echo "Yd $C@M05MB %9

Linux bonding config

谁都会走 提交于 2020-01-11 17:23:44
删除bond rmmod bonding rm -rf /etc/modprobe.d/bond.conf rm -rf /etc/sysconfig/network-scripts/ifcfg-bond0 reboot 服务器 ##确认是否删除,如果bonding目录不存在,这删除 cat /proc/net/bonding/bond0 ### config bond4 ##交换机需要配置lacp 和端口聚合 systemctl stop NetworkManager systemctl disable NetworkManager cat >/etc/sysconfig/network-scripts/ifcfg-eno1<<EOF DEVICE=eno1 TYPE=Ethernet ONBOOT=yes BOOTPROTO=none MASTER=bond0 USERCTL=no SLAVE=yes EOF cat >/etc/sysconfig/network-scripts/ifcfg-eno2<<EOF DEVICE=eno2 TYPE=Ethernet ONBOOT=yes BOOTPROTO=none MASTER=bond0 USERCTL=no SLAVE=yes EOF cat >/etc/sysconfig/network-scripts/ifcfg

Linux 输入输出(I/O)重定向

落爺英雄遲暮 提交于 2020-01-11 15:58:56
目录 1、概念 Linux 文件描述符 2、输出重定向 格式 示例 注意 3、输入重定向 格式 示例 4、自定义输入输出设备 解释 示例 最后说两句 1、概念 在解释什么是重定向之前,先来说说什么是文件描述符 Linux 文件描述符 文件描述符可以理解为 Linux 系统为文件分配的一个数字,范围是 0-3 ,用户也可以自定义文件描述符,但是自定文件描述符不在这里的讨论范围 文件描述符(file descriptor) 名称 类型 文件描述符 操作 标准输入 standard input 0 <,<< 标准输出 standard output 1 >,>> 标准错误输出 standard error output 2 2>,2>> 文件描述符的存储位置位于 /proc/self/fd ,文件描述符是通过一系列软链接指向的默认输出设备,这里我们的默认设备就是模拟终端 模拟终端的文件可以使用命令 tty 来查看 [divent@bash]$ ls -al /proc/self/fd total 0 lrwx------. 1 divent divent 64 Aug 15 14:09 0 -> /dev/pts/0 lrwx------. 1 divent divent 64 Aug 15 14:09 1 -> /dev/pts/0 lrwx------. 1 divent

Linux系统巡检脚本

孤街浪徒 提交于 2020-01-10 18:01:20
#!/bin/bash # auth:Bertram # created Time : 2019-12-26 # func:sys info check # sys:centos6.x/7.x ------------------------------------------------------------------------------------------------------------------------------------- [ $(id -u) -ne 0 ] && echo "请用root用户执行此脚本!" && exit 1 sysversion=$(rpm -q centos-release|cut -d- -f3) line="-------------------------------------------------" [ -d logs ] || mkdir logs #sys_check_file="logs/$(ip a show dev eth0|grep -w inet|awk '{print $2}'|awk -F '/' '{print $1}')-`date +%Y%m%d`.txt" sys_check_file="logs/$(ifconfig |awk 'NR==2{print $2}')-`date +%Y

Add a header to a tab delimited file

a 夏天 提交于 2020-01-09 19:09:30
问题 I'd like to add a header to a tab-delimited file but I am not sure how to do it in one line in linux. Let us say my file is: roger\t18\tcolumbia\tnew york\n albert\t21\tdartmouth\tnew london\n etc... and now I'd like to add a header that says: name\tage\tuniversity\tcity How would I do that in one line in linux? I am ok with awk, sed, cat, etc. not familiar at all with perl though. 回答1: There isn't a "prepend" operator like the "append" operator >> , but you can write the header to a temp

Add a header to a tab delimited file

扶醉桌前 提交于 2020-01-09 19:09:06
问题 I'd like to add a header to a tab-delimited file but I am not sure how to do it in one line in linux. Let us say my file is: roger\t18\tcolumbia\tnew york\n albert\t21\tdartmouth\tnew london\n etc... and now I'd like to add a header that says: name\tage\tuniversity\tcity How would I do that in one line in linux? I am ok with awk, sed, cat, etc. not familiar at all with perl though. 回答1: There isn't a "prepend" operator like the "append" operator >> , but you can write the header to a temp

grep+for实现批量排除文件

本小妞迷上赌 提交于 2020-01-08 12:02:40
说明: 文件a为所有待删除文件列表 文件b为需要保留的文件目录 需求: 排除文件a中需要保留的文件 实现方法: for i in `cat b`;do echo "$i";cat a|grep -Ev "$i" > filelist; mv filelist b -f ;done 遇到问题: 通过wc -l发现grep -v没有效果 解决办法: file b,检查文件格式: 发现有:with CRLF line terminators 使用dos2unix b 将文件b转换成Unix格式或Linux格式 来源: https://www.cnblogs.com/qiushi2/p/12165136.html

Best Quality CAT Caterpillar ET Diagnostic Adapter III

ぃ、小莉子 提交于 2020-01-07 21:11:34
2017A Version CAT Caterpillar ET Diagnostic Adapter III PLUS DELLd630 laptop (Real Caterpillar ET3 Adapter III ) we will install the software before ship, so you can get it work directly after you receive it. 2017A Cat ET software as Cat Caterpillar ET 2015A Software update version, 2017A Caterpillar Electronic Technician softwarer With Autel Tool CAT ET 3 Cat caterpillar adapter 3 support caterpillar diagnostic till 2017. Cat et Caterpillar Electronic Technician Software 2017A V1.0: Type of catalogue: Caterpillar Electronic Technician Diagnostic Software Make: Caterpillar Region: WorldWide