cat

What is the “M- notation” and where is it documented?

五迷三道 提交于 2019-12-05 04:47:39
The Man-Page of cat says: -v, --show-nonprinting use ^ and M- notation, except for LFD and TAB What is the M- notation and where is it documented? Example: $cat log -A wrote 262144 bytes from file test.x in 9.853947s (25.979 KiB/s)^M$ ^M> ^H^H ^H^H> What means ^M and ^H ? I was wondering this too. I checked the source but it seemed easier to create a input file to get the mapping. I created a test input file with a Perl scrip for( my $i=0 ; $i < 256; $i++ ) { print ( sprintf( "%c is %d %x\n", $i, $i ,$i ) ); } and then ran it through cat -v Also if you see M-oM-;M-? at the start of a file it

快速查看linux 系统信息查看小命令

旧时模样 提交于 2019-12-05 04:07:27
一.查看CPU 1.1 查看CPU个数 ]# cat /proc/cpuinfo | grep "physical id" | uniq | wc -l uniq命令:删除重复行;wc –l命令:统计行数** 1.2 查看CPU核数 ]# cat /proc/cpuinfo | grep "cpu cores" | uniq cpu cores : 4 1.3 查看CPU型号 ]# cat /proc/cpuinfo | grep 'model name' | uniq model name : Intel(R) Xeon(R) CPU E5630 @ 2.53GHz 总结:该服务器有2个4核CPU,型号Intel(R) Xeon(R) CPU E5630 @ 2.53GHz 二.查看内存 2.1 查看内存总数 ]#cat /proc/meminfo | grep MemTotal MemTotal: 32941268 kB //内存32G 注:想要获得哪些系统信息,cd到/proc下查看相关的信息,再添加过滤规则,就缺输出想要得到的信息 uname -a   # 查看内核/操作系统/CPU信息的linux系统信息 head -n l /etc/issue   # 查看操作系统版本 cat / proc/cpuinfo   # 查看CPU信息 hostname   #

查看Linux内核版本命令

北慕城南 提交于 2019-12-05 01:53:36
一、查看 Linux 内核版本命令(两种方法): 1、cat /proc/version 2、uname -a 二、查看Linux系统版本的命令(3种方法): 1、lsb_release -a即可列出所有版本信息: 这个命令适用于所有的Linux发行版,包括Redhat、SuSE、Debian…等发行版。 2、cat /etc/redhat-release这种方法只适合Redhat系的Linux: 3、cat /etc/issue此命令也适用于所有的Linux发行版。 来源: https://www.cnblogs.com/exmyth/p/11896114.html

curl: (3) Illegal characters found in URL

半城伤御伤魂 提交于 2019-12-05 01:17:54
I want to bulk lookup ip details at ipinfo.io Here is my code. $ cat ips.txt | xargs -I% curl http://ipinfo.io/%/region The file "ips.txt" contains three ip addresses each on a separate line: (1) 8.8.8.8 (2) 8.8.4.4 (3) 1.2.3.4 This resolves only the last ip address. It should give (1) California (2) Colorado (3) Washington. I get the below: curl: (3) Illegal characters found in URL curl: (3) Illegal characters found in URL Washington If I write ips.txt with only one ip address (for example 8.8.8.8) I get good results. I think there is something wrong with either my text file or the way I am

C#函数(构造函数)的重载

只谈情不闲聊 提交于 2019-12-05 00:18:05
using System; namespace test { class Program { static void Main(string[] args) { Cat cat = new Cat();//不含参数的构造方法 Console.WriteLine("姓名是{0},年龄是{1}",cat.name,cat.age); Cat cat1 = new Cat("一只猫");//含1个参数的构造方法 Console.WriteLine("姓名是{0},年龄是{1}", cat1.name, cat1.age); Cat cat2 = new Cat("又一只猫",18);//含2个参数的构造方法 Console.WriteLine("姓名是{0},年龄是{1}", cat2.name, cat2.age); } class Cat { public string name; public int age; public Cat() { } public Cat(string nameValue) { name = nameValue; } public Cat(string nameValue, int ageValue) { name = nameValue; age = ageValue; } } } } using System; namespace test {

Bash and Script help generating files with variable content

▼魔方 西西 提交于 2019-12-04 22:25:43
Extending this question: How to Create several files from a list in a text file? Summary: cat file_full_of_files_names | tr ' \t' '\n\n' | while read filename; do if test -f "$filename"; then echo "Skipping \"$filename\", it already exists" else cp -i initial_content "$filename" fi done works great for what I want, but I'd like to extend it. The content below is what is found in 'initial_content' <?xml version="1.0" encoding="UTF-8"?> <selector xmlns:android="http://schemas.android.com/apk/res/android"> <item android:drawable="@drawable/com_aac_cachemate_demo_cachemate" /> </selector> I'd like

Run cat on remote computer and send output a variable using expect

喜你入骨 提交于 2019-12-04 22:06:55
I have a bash+expect script which has to connect via ssh to the remote comp (and i can't use ssh keys, need password identification in here), read the file there, find specific line with the "hostname" (like "hostname aaaa1111") and store this hostname into the variable to be used after while. How can i get the value of the "hostname" parameter? I thought that line content will be in $expect_out(buffer) variable (so i can scan it and analyze), but it's not. My script is: #!/bin/bash ----bash part---- /usr/bin/expect << ENDOFEXPECT spawn bash -c "ssh root@$IP" expect "password:" send "xxxx\r"

Merging multiple log files by date including multilines

被刻印的时光 ゝ 提交于 2019-12-04 18:29:45
问题 I have several logs containing lines all starting with a timestamp, so that the following works as expected to merge them: cat myLog1.txt myLog2.txt | sort -n > combined.txt Problem is, that myLog2.txt can also contain lines without a timestamp (e.g. java stack traces). Is there an easy way without any custom scripts to still merge them and preserve the multiline content? Example myLog1.txt 11:48:18.825 [main] INFO org.hibernate.cfg.Environment - HHH000206: hibernate.properties not found 11

Copy and append files to a remote machine: cat error

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-04 16:31:47
So, I have a bit of a problem: Originally I was using scp to copy a file from a local machine to a remote machine before I realized that scp overwrites instead of appends. But I need it to append. So I did some Googling and this alternative using cat and ssh popped up instead: cat localfile | ssh user@remoteserver "cat >> remotefile" Problem is, I get this interesting error whenever I use that method: bash: cat: command not found When I normally ssh into my remote machine, I can cat just fine, so I'm looking for either help fixing this problem or finding a way to append using only commands

实现:抽象类和多态的实例

五迷三道 提交于 2019-12-04 15:22:19
示例代码如下: #include<iostream> #include<string> using namespace std; class Animal { public: virtual void speak() = 0; }; class Dog :public Animal{ public: void speak() { cout << "小狗在说话" << endl; } }; class Cat :public Animal { public: void speak() { cout << "小猫在说话" << endl; } }; void aaa(Animal * animal) { animal->speak(); //因为是指针,所以我们调用的时候使用-> delete animal; //用完之后释放内存 } void test01() { Animal * a1 = new Cat; aaa(a1); } int main() { test01(); system("pause"); return 0; } 来源: https://www.cnblogs.com/zpchcbd/p/11871380.html