我使用该mkfifo <file>命令创建了命名的 FIFO,其中一个进程写入文件,另一个进程从文件中读取。
现在,我知道该mknod命令能够创建命名管道。这些命名管道是否等同于由创建的 FIFO mkfifo,或者它们具有不同的功能?
我一直在 AWK ( gawk) 中尝试使用十六进制数字,但有时当我使用 eg 打印它们时printf,它们会在打印时屏蔽掉一些 LSB,如下例所示:
awk 'BEGIN { x=0xffffffffbb6002e0; printf("%x\n", x); }'
ffffffffbb600000
Run Code Online (Sandbox Code Playgroud)
为什么我会遇到这种行为,我该如何纠正?
我gawk在 Debian Buster 10 上使用。
考虑 的共享对象依赖项/bin/bash,其中包括/lib64/ld-linux-x86-64.so.2(动态链接器/加载器):
ldd /bin/bash
linux-vdso.so.1 (0x00007fffd0887000)
libtinfo.so.6 => /lib/x86_64-linux-gnu/libtinfo.so.6 (0x00007f57a04e3000)
libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007f57a04de000)
libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f57a031d000)
/lib64/ld-linux-x86-64.so.2 (0x00007f57a0652000)
Run Code Online (Sandbox Code Playgroud)
检查/lib64/ld-linux-x86-64.so.2表明它是一个符号链接/lib/x86_64-linux-gnu/ld-2.28.so:
ls -la /lib64/ld-linux-x86-64.so.2
lrwxrwxrwx 1 root root 32 May 1 19:24 /lib64/ld-linux-x86-64.so.2 -> /lib/x86_64-linux-gnu/ld-2.28.so
Run Code Online (Sandbox Code Playgroud)
此外,file报告/lib/x86_64-linux-gnu/ld-2.28.so本身是动态链接的:
file -L /lib64/ld-linux-x86-64.so.2
/lib64/ld-linux-x86-64.so.2: ELF 64-bit LSB pie executable, x86-64, version 1 (SYSV), dynamically linked, BuildID[sha1]=f25dfd7b95be4ba386fd71080accae8c0732b711, stripped
Run Code Online (Sandbox Code Playgroud)
我想知道:
/lib64/ld-linux-x86-64.so.2) 本身如何动态链接?它在运行时链接自己吗?/lib/x86_64-linux-gnu/ld-2.28.so记录在案以处理 a.out 二进制文件 ( man ld.so),但是/bin/bash …是否可以使用 输出完整的命令名称lsof -nP -i4UDP?
我一直在手册中寻找合适的选项,例如-V(见下文),但它不会产生全COMMAND名,即systemd-resolve显示为systemd-r:
$ sudo lsof -V -nP -i4UDP
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
avahi-dae 437 avahi 12u IPv4 12982 0t0 UDP *:5353
avahi-dae 437 avahi 14u IPv4 12984 0t0 UDP *:45006
cups-brow 449 root 7u IPv4 12149 0t0 UDP *:631
systemd-r 485 systemd-resolve 12u IPv4 14694 0t0 UDP 127.0.0.53:53
systemd-r 485 systemd-resolve 13u IPv4 14695 0t0 UDP *:5355
dhclient 629 root 6u IPv4 …Run Code Online (Sandbox Code Playgroud) 检查man test,我看到在概要下test是可能性test EXPRESSION和test。
[ EXPRESSION ], [ ] and [OPTION下面是什么意思?
为什么括号是空的,为什么没有[OPTION括号?有人可以为我解释一下吗?
NAME
test - check file types and compare values
SYNOPSIS
test EXPRESSION
test
[ EXPRESSION ]
[ ]
[ OPTION
Run Code Online (Sandbox Code Playgroud) 根据 Bash 手册,shell-expand-lineGNU Readline 命令应该扩展命令行,就像 Bash 通常所做的那样,包括别名和历史扩展。
当前设置可以通过以下方式查看bind -P | grep shell-expand-line:
shell-expand-line can be found on "\e\C-e".
Run Code Online (Sandbox Code Playgroud)
我的问题是~在下面的示例中只展开了第一个波浪号 ( ):
~/foo/bar ~/foo/baz
Run Code Online (Sandbox Code Playgroud)
按“\e\Ce”后:
/Users/nlykkei/foo/bar ~/foo/baz
Run Code Online (Sandbox Code Playgroud)
为什么?
我想使用安装“文件”包apt,因为我的 Docker 容器缺少该file命令。在安装之前,我会检查软件包详细信息(见下文)。
我如何查看这些软件包的发布/更新日期?他们的描述说他们支持 5 年,但这毫无意义,因为我看不到他们何时发布/更新?
另外,为什么apt列出两个“文件”包?当我运行时,会安装其中哪一个apt install file?
root@eca1fcd5655a:/mnt/dotnetcore# apt show -a file
Package: file
Version: 1:5.32-2ubuntu0.3
Priority: important
Section: utils
Origin: Ubuntu
Maintainer: Ubuntu Developers <ubuntu-devel-discuss@lists.ubuntu.com>
Original-Maintainer: Christoph Biedl <debian.axhn@manchmal.in-ulm.de>
Bugs: https://bugs.launchpad.net/ubuntu/+filebug
Installed-Size: 81.9 kB
Depends: libc6 (>= 2.4), libmagic1 (= 1:5.32-2ubuntu0.3)
Homepage: http://www.darwinsys.com/file/
Task: minimal
Supported: 5y
Download-Size: 22.1 kB
APT-Sources: http://archive.ubuntu.com/ubuntu bionic-updates/main amd64 Packages
Description: Recognize the type of data in a file using "magic" numbers
Package: file …Run Code Online (Sandbox Code Playgroud) 我希望llvm-objcopy安装在 macOS 上,因为它的对应项llvm-objdump与其他 LLVM 工具(例如clang.
llvm-objcopy在 macOS 上使用的等效工具是什么?
我想使用 MinGW 在 Linux 上编译一个简单的 Windows 应用程序。
我编译如下:
x86_64-w64-mingw32-g++ -L. -l:mathlib.dll -o fib main.cpp mathlib.h
Run Code Online (Sandbox Code Playgroud)
这将生成一个可执行文件fib,该可执行文件使用从mathlib.dll.
现在,fib在 Windows 上执行时,它会抱怨libgcc_s_seh-1.dll并且libstdc++-6.dll丢失了。
如果我将这些 DLL 复制到 Windows,那么一切正常,但我不想将这些 MinGW 依赖项与每个可执行文件一起复制。
我如何静态链接这些 MinGW 依赖项,这样除了不foo依赖其他 DLL 之外mathlib.dll?
Bashdeclare foo和foo=Bash 中的区别是什么?
如果我打印出来的价值foo,那么它foo和foo=""用于declare foo和foo=分别。
foo和的值是否foo=""相等?如果不是,这些值之间有什么不同(两者-n和-zfor 的[[ ... ]]行为相同)?
$ foo=
$ declare -p foo
declare -- foo=""
$ declare -p bar
bash: declare: bar: not found
$ declare bar
$ declare -p bar
declare -- bar
Run Code Online (Sandbox Code Playgroud)