近期遇到的shell指令相关问题整理

举报
Amrf 发表于 2020/08/06 19:56:24 2020/08/06
【摘要】 同一个目录下多个mk指定需要编译
  • 同一个目录下多个makefile指定需要编译的

https://stackoverflow.com/questions/12057852/multiple-makefiles-in-one-directory

  • tar单独一个横杠的含义

打包输入到标准输出或者从标准输入中解包

https://askubuntu.com/questions/1151909/what-does-the-hyphen-mean-in-tar-xzf 

https://unix.stackexchange.com/questions/85194/how-to-download-an-archive-and-extract-it-without-saving-the-archive-to-disk 

https://stackoverflow.com/questions/2597875/how-can-i-build-a-tar-from-stdin 

https://stackoverflow.com/questions/11524602/how-to-extract-tar-archive-from-stdin

https://superuser.com/questions/325504/howto-pipe-cp-tar-gzip-without-creating-intermediary-files

  • tar参数的含义

https://blog.csdn.net/pan_tian/article/details/7686408

  • tar设置排除exclude

https://stackoverflow.com/questions/984204/shell-command-to-tar-directory-excluding-certain-files-folders

  • tar打包绝对路径问题

https://blog.51cto.com/dihuo/1347236

https://blog.csdn.net/jiexunpc/article/details/72781681

https://blog.csdn.net/chenyulancn/article/details/45248069

  • GLIBCXX_3.4.14 not found

这个问题发生在我人为指定加载的libstdc++.so.6的版本比较低,可以sudo strings libstdc++.so.6 | grep GLIBCXX查看一下

https://medium.com/@akingsukh/how-to-solve-glibcxx-3-4-14-not-found-on-centos6-738d048b713f

  • 增加查找动态库的路径

Keep the previous path, don't overwrite it:

export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/your/custom/path/

You can add it to your ~/.bashrc:

echo 'export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/your/custom/path/' >> ~/.bashrc

export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:"$PWD"

Alternatively you can execute program with specified library dir:

/lib/ld-linux.so.2 --library-path PATH EXECUTABLE

https://stackoverflow.com/questions/13428910/how-to-set-the-environmental-variable-ld-library-path-in-linux

  • ldd列出程序依赖的动态库

Example:

$ ldd /bin/ls
readelf -d /bin/ls | grep 'NEEDED'

https://unix.stackexchange.com/questions/120015/how-to-find-out-the-dynamic-libraries-executables-loads-when-run

  • 生成指定大小文件

https://cloud.tencent.com/developer/article/1004339 

https://blog.csdn.net/beswkwangbo/article/details/46375795

  • 输出目录下文件的md5

find ./ -type f -exec md5sum '{}' +

https://unix.stackexchange.com/questions/392990/how-to-check-md5sum-between-two-directories

https://unix.stackexchange.com/questions/35832/how-do-i-get-the-md5-sum-of-a-directorys-contents-as-one-sum/35834

  • 在当前目录下查找

find "$pwd" -name xxx

过滤

 find "/" -type f -print | awk -F'/' '{printf "%s %s\n",$NF, $0}' | grep -e "^xx.*"
  • sftp,scp,rsync 的异同

https://segmentfault.com/a/1190000016151406

https://stackoverflow.com/questions/29624524/how-can-i-print-log-the-checksum-calculated-by-rsync

  • 其他rsync相关的查询

目录最后的斜杠对rsync有影响

https://github.com/thbar/rsync-windows

https://github.com/jbenden/rsync

https://stackoverflow.com/questions/15787676/rsync-how-to-do-a-checksum-on-rsync

https://stackoverflow.com/questions/14566355/how-to-get-files-list-with-checksums

https://serverfault.com/questions/426520/get-list-of-transferred-files-from-rsync 

https://stackoverflow.com/questions/10525748/rsync-with-checksum-from-local-to-local

https://serverfault.com/questions/363555/why-is-rsync-skipping-the-main-directory 

https://blog.csdn.net/niushuai666/article/details/16880061

https://blog.csdn.net/weixin_38599972/article/details/79528826  选项

https://blog.csdn.net/github_38336924/article/details/82700052

https://linux.die.net/man/1/rsync 手册

https://serverfault.com/questions/211005/rsync-difference-between-checksum-and-ignore-times-options 

https://unix.stackexchange.com/questions/57305/rsync-compare-directories

  • rsync工作原理

https://www.cnblogs.com/f-ck-need-u/p/7226781.html

  • 关于 rsync 中: 和 :: 及 rysnc 和 ssh 认证协议的区别

https://my.oschina.net/leejun2005/blog/75007

  •  rsync最大连接和超时

https://blog.csdn.net/caoshuming_500/article/details/22877861

  • rsync打印checksum

rsync -avnc --out-format="%i %n%L%C" --ignore-times --checksum  /xxx/ /xxx/
  • windows环境rsync上传文件到linux

D:\xxx\rsync.exe -av --no-o --no-g --delete -e "'D:\xxx\ssh.exe'" /cygdrive/D/dev/xxx root@xxx.xxx.xxx.xxx:/home/xxx

https://askubuntu.com/questions/719439/using-rsync-with-sudo-on-the-destination-machine 

https://blog.csdn.net/haoyiyide/article/details/70157004





【声明】本内容来自华为云开发者社区博主,不代表华为云及华为云开发者社区的观点和立场。转载时必须标注文章的来源(华为云社区)、文章链接、文章作者等基本信息,否则作者和本社区有权追究责任。如果您发现本社区中有涉嫌抄袭的内容,欢迎发送邮件进行举报,并提供相关证据,一经查实,本社区将立刻删除涉嫌侵权内容,举报邮箱: cloudbbs@huaweicloud.com
  • 点赞
  • 收藏
  • 关注作者

评论(0

0/1000
抱歉,系统识别当前为高风险访问,暂不支持该操作

全部回复

上滑加载中

设置昵称

在此一键设置昵称,即可参与社区互动!

*长度不超过10个汉字或20个英文字符,设置后3个月内不可修改。

*长度不超过10个汉字或20个英文字符,设置后3个月内不可修改。