# testcode **Repository Path**: AnKangCS/testcode ## Basic Information - **Project Name**: testcode - **Description**: No description available - **Primary Language**: Unknown - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2022-01-04 - **Last Updated**: 2026-09-30 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # [命令行的艺术](https://github.com/jlevy/the-art-of-command-line) # 问题处理 git中文乱码 git config --global core.quotepath false ; 记住密码 git config --global credential.helper store Cache内存占用过高 sync; sudo sysctl -w vm.drop_caches=3 dpkg -l |grep ^rc|awk '{print $2}' |sudo xargs dpkg -P 清理已卸载软件的配置 sudo usermod -aG vboxsf $(whoami) vbox共享权限 sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-11 40 --slave /usr/bin/g++ g++ /usr/bin/g++-11 sudo update-alternatives --config gcc # 文件操作 rsync -avz --delete --progress srcdir dstdir // 增量模式拷贝文件 unzip -O GB18030 处理中文乱码 find path -name file 详见:https://blog.csdn.net/l_liangkk/article/details/81294260 fsck 磁盘检查修复 ag tig fzf tar -cvf - my_folder/ | xz -T 0 -c > my_folder.tar.xz ;-T 0 代表尽可能多的使用 CPU 线程。 ## gcc Binutils ldd file type hexdump pmap -o 目标文件 -E 预处理 -S 汇编 -c 编译 -g 调试信息 -O 优化 -C -M -Wall -Werror -w -Wextra -I 头文件目录 -L 库目录 -l 库名称 -D 宏定义 -v 版本 -s 使用strip –static 静态链接 -pipe 编译阶段使用管道通讯 -fPIC 位置无关代码 -fopenmp -Wl,-Bstatic -ltest -Wl,-Bdynamic -Wl,-rpath=./lib 制定依赖查找目录 -Wl,--exclude-libs,ALL 将静态库中的所有符号转换为隐藏。 -Wl,--retain-symbols-file,export.map 静态链接库 -Wl,--no-undefined 如果有未定义符号,编译不通过。 -Wl,--whole-archive -Wl,-no-whole-archive # 静态链接 -Wl,--as-needed -Wl,--no-as-needed -fvisibility=hidden ## gdb set args 设置启动程序的参数 run 参数 带参数的调试启动 // https://www.cnblogs.com/kele-dad/p/9394568.html valgrind --tool=memcheck --track-origins=yes --leak-check=full --show-leak-kinds=all --log-file=leak.txt --error-limit=no ./program ## 网络设置 ip ethtool netstat nload // https://zhuanlan.zhihu.com/p/74812069 sudo tcpdump -i enp3s0 -vnn src host 192.168.2.10 and dst port 22 -w ./result.cap /etc/security/limits.conf username - rtprio 99 // 设置优先级 sudo setcap cap_sys_nice=ep exe_file stress 加压测试 fg 命令用于将后台作业放到前台终端运行 # 工具命令 ffmpeg -f x11grab -video_size 1920x1080 -framerate 30 -i :0.0 output.mp4 # 屏幕录制