随笔分类 -  Linux

Vim yank only 50 lines
摘要:https://vim.fandom.com/wiki/Copy,_cut_and_paste 阅读全文

posted @ 2021-03-11 17:18 liujx2019 阅读(42) 评论(0) 推荐(0)

按进程名终止进程
摘要:按进程名终止进程 #!/bin/bash echo "Terminate process(es) has " $1 " in name." echo "Self pid " $$ echo "Self name " $0 pids=$(ps -ef | grep $1 | grep -v grep 阅读全文

posted @ 2021-03-11 10:23 liujx2019 阅读(94) 评论(0) 推荐(0)

Shell 脚本 Tips
摘要:数组 filepath="everything mobaxterm gems" arr=($filepath) 打印某个元素 judgefile=${arr[0]} 打印全部元素 echo ${arr[@]} 循环打印每个元素 for x in ${arr[@]}; do echo $x done 阅读全文

posted @ 2021-03-10 18:51 liujx2019 阅读(58) 评论(0) 推荐(0)

Bash 脚本 逐行处理文本文件的内容
摘要:while read -r line; do echo "$line" done < /path/to/file.txt https://unix.stackexchange.com/questions/58040/what-is-the-fastest-way-to-process-line-by 阅读全文

posted @ 2021-03-10 14:31 liujx2019 阅读(200) 评论(0) 推荐(0)

Bash 脚本 从路径分离出文件夹和文件名
摘要:bash to get file name fspec="/exp/home1/abc.txt" filename="${fspec##*/}" # get filename dirname="${fspec%/*}" # get directory/path name other ways awk 阅读全文

posted @ 2021-03-10 14:25 liujx2019 阅读(301) 评论(0) 推荐(0)

Linux 跨平台编译调试
摘要:把修改过的代码发送到编译的机器 #!/bin/bash if [ $# -lt 1 ] then echo "Input the destination such as root@10.4.10.78:~/src/" exit fi file_list="file_list" update_scri 阅读全文

posted @ 2021-03-10 13:56 liujx2019 阅读(102) 评论(0) 推荐(0)

tr与sed命令:将换行符替换为空格
摘要:处理文本时需要将换行符替换为空格,若使用sed命令会比较麻烦,而使用tr命令非常方便。 cat country.txt | sed ':label;N;s/\n/ /;b label' cat country.txt | tr "\n" " " 两个命令输出一致,但是sed命令的输出结尾有换行符,而 阅读全文

posted @ 2021-03-10 13:37 liujx2019 阅读(2434) 评论(0) 推荐(0)

SpaceVim Tips
摘要:The default configuration file of SpaceVim is ~/.SpaceVim.d/init.toml 可用模块 = Available Layershttps://spacevim.org/layers/cscope/ 阅读全文

posted @ 2021-03-05 09:24 liujx2019 阅读(52) 评论(0) 推荐(0)

How to detect memory leaks in QtCreator on Windows?
摘要:https://stackoverflow.com/questions/6825376/how-to-detect-memory-leaks-in-qtcreator-on-windows 阅读全文

posted @ 2021-02-04 11:05 liujx2019 阅读(62) 评论(0) 推荐(0)

Using select() for non-blocking sockets
摘要:原问题 I am trying to use the select function to have non-blocking i/o between a server and 1 client (no more) where the communication flows nicely (can 阅读全文

posted @ 2021-02-04 10:16 liujx2019 阅读(124) 评论(0) 推荐(0)

Shell 脚本查看是谁调用的自己
摘要:用 ps aux | grep shell_script_name 可以看到父进程,也就是调用者。 output = 'ps aux | grep shell_script_name' logger -s $output 可以把结果记录在 syslog 里面 ps aux | grep system 阅读全文

posted @ 2021-01-12 09:36 liujx2019 阅读(1542) 评论(0) 推荐(0)

Apache 2.4 编译 configure: WARNING: Your APR does not include SSL/EVP support. To enable it: configure --with-crypto
摘要:编译 httpd 时会有如下警告 configure: WARNING: apr/apr-util is compiled without ldap supportconfigure: WARNING: apr/apr-util is compiled without ldap supportcon 阅读全文

posted @ 2021-01-07 09:19 liujx2019 阅读(489) 评论(0) 推荐(0)

RedHat 修改etc/resolv.com 添加DNS,重启网络,文件就被重置了
摘要:RedHat5.5的/etc/resolv.conf文件被复写的解决 [日期:2013-06-08] 来源:Linux社区 作者:wangyublues [字体:大 中 小] 公司RedHat5.5系统,配置了/etc/resolv.conf文件后重启网络服务,此文件内容就被复写了。经过查看红帽官方 阅读全文

posted @ 2021-01-06 17:51 liujx2019 阅读(445) 评论(0) 推荐(0)

Linux 创建指定大小的文件
摘要:dd if=/dev/zero of=16MB bs=4M count=4 https://ostechnix.com/create-files-certain-size-linux/ 待读 阅读全文

posted @ 2020-10-21 09:36 liujx2019 阅读(303) 评论(0) 推荐(0)

What is the Makefile Target `.c.o` for?
摘要:10.7 Old-Fashioned Suffix Rules Suffix rules are the old-fashioned way of defining implicit rules for make. Suffix rules are obsolete because pattern 阅读全文

posted @ 2020-06-05 13:12 liujx2019 阅读(181) 评论(0) 推荐(0)

CFLAGS [Makefile]
摘要:CFLAGS -Wall:选项可以打印出编译时所有的错误或者警告信息。这个选项很容易被遗忘,编译的时候,没有错误或者警告提示,以为自己的程序很完美,其实,里面有可能隐藏着许多陷阱。变量没有初始化,类型不匹配,或者类型转换错误等警告提示需要重点注意,错误就隐藏在这些代码里面。没有使用的变量也需要注意, 阅读全文

posted @ 2020-06-01 09:36 liujx2019 阅读(1083) 评论(0) 推荐(0)

RedHat 的 crontab
摘要:Chapter 39. Automated Tasks In Linux, tasks can be configured to run automatically within a specified period of time, on a specified date, or when the 阅读全文

posted @ 2019-12-27 10:30 liujx2019 阅读(369) 评论(0) 推荐(0)

VIM 批量缩进4个空格
摘要:vim /etc/vimrc 或 vim ~/.vimrc set smartindent set shiftwidth=4 按v选中多行,回车 然后shifit + 》 阅读全文

posted @ 2019-12-27 09:57 liujx2019 阅读(2318) 评论(0) 推荐(0)

List of common SCSI KCQs
摘要:CategoryKeyASCASCQError Condition No Sense 0 00 00 No error 0 5D 00 No sense - PFA threshold reached Soft Error 1 01 00 Recovered Write error - no ind 阅读全文

posted @ 2019-12-25 14:27 liujx2019 阅读(741) 评论(0) 推荐(0)

What does __GNUC__ mean?
摘要:It indicates that I'm a GNU compiler and you can use GNU extensions. https://stackoverflow.com/questions/19908922/what-is-this-ifdef-gnuc-about 阅读全文

posted @ 2019-12-03 18:01 liujx2019 阅读(100) 评论(0) 推荐(0)

导航