shell
lylhw13_
喜欢探究Linux源码,喜欢从本质分析问题
展开
-
使用pandoc 生成带中文的pdf
安装pandocsudo apt install pandoc texlive-latex-base \ texlive-extra-utils texlive-latex-extra安装 xelatexsudo apt install texlive-xetex安装字体拷贝字体将windows的字体拷贝至Ubuntu系统目录/usr/share/fonts 下比如在WSL上mkdir -p /usr/share/fonts/truetype/windowsfontsudo cp -原创 2022-04-23 22:06:18 · 2415 阅读 · 0 评论 -
shell命令记录汇总
调整 shell 提示符长度有时候进入路径太长,在Ubuntu下面,shell 的提示符会特别长,可以通过一下命令设置,只显示最后三层的目录PROMPT_DIRTRIM=3shell 注释注释单行#this is comment注释多行: <<'END'the lines between END are commentsEND通过shell脚本动态生成文件将下面的 file_name 替换为自己的文件名。cat << 'EOF' > file_na原创 2022-04-10 09:21:53 · 497 阅读 · 0 评论 -
centos 7安装新版本 gcc
centos 7 安装 gcc 和 g++ 的命令分别如下:yum install gccyum install gcc-c++但是安装的版本是:(GCC) 4.8.5 20150623 (Red Hat 4.8.5-44)安装更高版本的 gcc 有两种方式这里以 gcc 7.3 为例1. 手动编译具体步骤参考:build gcc from source on centos 7可以编译成功,也可以正常使用,但是有些编译会2. 使用软件管理Software Collections ,原创 2022-03-27 18:21:08 · 10904 阅读 · 6 评论 -
使用man命令,出现 ”No manual entry for” 的解决办法
在使用man 命令的时候,经常会出现没有相关条目的情况。原创 2022-03-27 18:11:35 · 6584 阅读 · 1 评论 -
Linux 不产生 core 文件的解决方法
要注意,ulimit 命令只能影响当前的进程或者说终端。要保证所执行程序的终端的 core size 设置正确。以下步骤在 ubuntu 20.04 和 ubuntu 21.04 测试可行。停止 apport 服务sudo service apport stop为最终执行程序的终端设置 core sizeulimit -c unlimited...原创 2021-11-20 23:35:04 · 1448 阅读 · 0 评论 -
常用 tar 命令总结
常用格式tar 命令一般用来将文件归档并压缩,常用的文件格式如下:*.tar 仅将文件归档,不压缩*.tar.gz 将文件归档并压缩成 gz 格式*.tgz 上述格式的简写*.tar.bz2 将文件归档并压缩成 bz2 格式常用参数tar 的参数分为以下四类:主要操作模式: -A, --catenate, --concatenate append tar files to an archive -c, --create creat原创 2021-09-27 21:06:51 · 517 阅读 · 0 评论 -
shell 命令筛选不带后缀名的文件
cp -- !(*.*) /new/path/cp -- !(*.txt|*.c|*.py) /path/to/directoryyou could use: find . -type f ! -name "*.*"the ! negates the following expression, here a filename that contains a ‘.’you can also use the -maxdepth option to reduce the search depth.fin原创 2021-09-05 18:37:01 · 1409 阅读 · 0 评论 -
vscode中terminal不支持workon激活虚拟环境?试试修改默认shell
问题描述:vscode 在Windows下的默认shell 是 PowerShell,但是在PowerShell 下面virtualenv 的workon命令,只可以显示虚拟环境列表,却无法切换环境。解决办法是:修改vscode默认的Shell至Command Prompt(cmd) 或Git Bash 等。修改shell的步骤为:View -> Terminal打开vscode 的Terminal窗口点击Select Default Shell在弹出的窗口中选择需要的shell。原创 2020-05-16 17:46:08 · 1565 阅读 · 1 评论 -
windows, macos 和 linux 各平台的哈希校验方法汇总
macos 和 windows平台的哈希校验原创 2020-05-16 10:30:07 · 2024 阅读 · 0 评论 -
Linux 反汇编查看二进制文件的方法汇总
方法总共有三种od - dump files in octal and other formatsxxd - make a hexdump or do the reverse.hexdump, hd — ASCII, decimal, hexadecimal, octal dump这三种方法都是用来以指定格式查看文件,没有本质区别。其中只有 od 是 POSIX 标准,原因参考 Single UNIX rationale。以上面三种方式分别实现 hex + ASCII 显示:od$ od原创 2021-08-28 17:22:14 · 5907 阅读 · 0 评论 -
telnet server 和 ssh server 安装使用记录
telnet 客户端随 Ubuntu 默认安装,服务端需要单独安装。安装sudo apt install telnetd启动,关闭和查看状态sudo systemctl start inetdsudo systemctl stop inetdsudo systemctl status inetd使用客户端进行连接telnet 192.168.0.1...原创 2021-08-17 23:13:29 · 199 阅读 · 0 评论 -
netstat 常用总结
windows常用参数:-a 列出所有连接和端口-o 列出连接所属进程的 PID-n 使用数字形式的 IP地址,不进行解析-e 显示网卡的统计信息-r 显示路由表常用形式netstat -aon | findstr LISTENINGnetstat -aon | findstr CLOSE_WAITnetstat -rnetstat -eLinux常用参数-r, --route display routing table-i, --interfa原创 2021-08-17 23:52:19 · 156 阅读 · 0 评论 -
Linux 使用 dpkg 查询包名时遇到 no path found matching pattern 的解决方法
一般包名时会出现如下错误:$ dpkg -S <file_name>dpkg-query: no path found matching pattern <file_name>可能原因是:文件名是一个符号链接比如需要查询 nc 的包名称:$ which nc/usr/bin/nc$ dpkg -S /usr/bin/ncdpkg-query: no path found matching pattern /usr/bin/nc其中 which nc 查询出来的是原创 2021-08-17 00:01:03 · 2055 阅读 · 0 评论 -
Linux 查找具有相同 inode 号的文件
$ apt source iputils-pingReading package lists... DoneE: You must put some 'deb-src' URIs in your sources.list原创 2021-08-16 19:19:00 · 831 阅读 · 0 评论 -
解决 find 命令输出太多 Permission denied 等信息的问题
有时使用 find 命令输出太多 Permission denied, Operation not permitted 等无关信息,这些信息是错误信息,输出到标准错误输出。屏蔽所有错误信息:find ~ -name [file_name] 2>/dev/null屏蔽指定类型的信息find ~ -name [file_name] 2>&1 | grep -v "Operation not permitted"参考:How can I exclude all “permiss原创 2021-08-15 23:02:36 · 4002 阅读 · 0 评论