我试图弄清楚我的计算机上的pulseaudio发生了什么,因为几乎每听一首歌曲20秒它就会冻结。
我试图killall pulseaudio && pulseaudio尝试在崩溃时获取pulseaudio的输出,但由于某些原因,它给了我一个错误。奇怪地与 ALSA 有关
E: module-alsa-card.c: Failed to find a working profile.
E: module.c: Failed to load module "module-alsa-card" (argument: "device_id="1" name="1" card_name="alsa_card.1" tsched=yes ignore_dB=no card_properties="module-udev-detect.discovered=1""): initialization failed.
Run Code Online (Sandbox Code Playgroud)
我不确定这是否是问题所在,但如果是,我仍然想知道如何监视尚未通过终端手动调用的程序的输出以供将来参考。
我在 iMac 上安装了 Ubuntu。起初,声音不起作用,但那是因为它在模拟立体声输出上,而不是在模拟环绕 4.0 输出上。但是现在,当我调整音量滑块时,无论它在哪里,它都会保持相同的音量(最响)。(静音除外)
当我戴上耳机时,一切正常。到目前为止,我基本上已经尝试了互联网上的所有解决方案,但找不到任何东西。出于某种原因,当我调整 PCM 时,音量会上下波动,但 Master 什么也不做。
我目前正在编写一个脚本来自动安装和配置 Samba 服务器。我想知道为什么这个命令sudo apt-get -y install samba > /dev/null && sudo systemctl enable smbd.service > /dev/null仍然给出这个输出。
Extracting templates from packages: 100%
Synchronizing state of smbd.service with SysV service script with /lib/systemd/systemd-sysv-install.
Executing: /lib/systemd/systemd-sysv-install enable smbd
Run Code Online (Sandbox Code Playgroud)
如何防止命令给出任何输出?
谢谢
Ubuntu 服务器 20.04.3 LTS
我有一个目录,其中包含一些 svg 图像。我使用以下命令列出它们ls以将输出保存在文件中:
ls *200px.svg > animList.js
Run Code Online (Sandbox Code Playgroud)
输出文件如下所示:
file1-200px.svg
file2-200px.svg
file3-200px.svg
...
fileX-200px.svg
Run Code Online (Sandbox Code Playgroud)
我需要编写文件名,以便'fileX-200px.svg',轻松地使该文件列表像 JavaScript 数组一样工作。即我需要输出文件为:
'file1-200px.svg',
'file2-200px.svg',
'file3-200px.svg',
...
'fileX-200px.svg',
Run Code Online (Sandbox Code Playgroud)
所以最后我只需要在var arr = [文件开头添加类似的内容,然后];在文件末尾添加即可作为 JavaScript 数组使用。Linux中有没有办法控制ls命令的输出显示?
我正在关注 Twitter 的开发人员,并希望对他们的过滤器实时 API 进行非常基本的调用。下面的代码几乎让我到达那里:
curl -s -u twitterusername:twitterpassword https://stream.twitter.com/1/statuses/sample.json -o "somefile.txt"
Run Code Online (Sandbox Code Playgroud)
我希望动态命名文件,以便捕获数据的每小时日志。
编辑:我希望这个命令保持打开状态,并且我收到的数据是连续的,这是毫无价值的。我希望每小时将输出重定向到不同的文件。
我对命令行和 ubuntu 完全陌生,所以我什至不知道从哪里开始。任何帮助都感激不尽。
我正在尝试使用 grep 在文件中查找所有匹配的字符串,并将它们在行的上下文中输出到另一个文件,同时在匹配的每一侧添加某种标记(最好是两个星号)。
例如,我有input.txt以下比赛的文件:
Dog walks in the park
Man runs in the park
Man walks in the park
Dog runs in the park
Dog is still
They run in the park
Woman runs in the park
Run Code Online (Sandbox Code Playgroud)
然后,我通过重定向到文件进行 grep 搜索:
grep -P ' runs? ' input.txt > output.txt
Run Code Online (Sandbox Code Playgroud)
它创建output.txt具有以下竞赛的文件:
Man runs in the park
Dog runs in the park
They run in the park
Woman runs in the park
Run Code Online (Sandbox Code Playgroud)
我想做的是获得该输出:
Man **runs** in the park
Dog …Run Code Online (Sandbox Code Playgroud) 我想git clone使用
git clone https://github.com/someRepository > git_clone.file
Run Code Online (Sandbox Code Playgroud)
但相反,我在终端中显示/更新了输出,例如
Cloning to 'someRepository' ...
remote: Counting objects: 2618, done.
remote: Compressing objects: 100% (14/14), done.
remote: Total 2618 (delta 2), reused 12 (delta 1), pack-reused 2603
Received objects: 100% (2618/2618), 258.95 MiB | 4.39 MiB/s, Done.
Resolving Differences auf: 100% (1058/1058), Done.
Check Connectivity ... Done.
Run Code Online (Sandbox Code Playgroud)
但文件git_clone.file已生成但仍为空。
我最初的目标是绕过输出git到函数中(请参阅我的问题here)。但是现在我意识到git甚至似乎没有产生stdout真正但不知何故不同的输出,因为没有任何内容写入文件。
如何从中获取此显示的输出git以将其重定向到文件/函数?
编辑
建议的stderr(and stdout)重定向没有解决问题。
git clone https://github.com/someRepository …Run Code Online (Sandbox Code Playgroud) 我有一个 Python 脚本EulerianCycle.py和一个输入文件euleriancycle.txt。
通过py EulerianCycle euleriancycle.txt > cat euleriancycleout.txt进入当前文件夹(py是 的别名python3),我能够获得正确的结果。
不过,我有在当前的一个叫另一个文件夹输出,而我希望我的所有输出文件中被引导。
我试过了 py EulerianCycle.py euleriancycle.txt | cd outputs/ | cat > euleriancycleout.txt
和 py EulerianCycle.py euleriancycle.txt | cat >cd outputs/euleriancycleout.txt
这给了我破碎的管道错误。
我想按行列出nginx服务器的所有模块,因此我输入以下内容:
nginx -V | tr -- - '\n'
Run Code Online (Sandbox Code Playgroud)
但它不会将模块排成一行。如果我这样做:
2>&1 nginx -V | tr -- - '\n'
Run Code Online (Sandbox Code Playgroud)
有用。但为什么?
今天我从 Ubuntu 18.04 LTS 升级到 18.10。更新运行时没有任何错误消息。更新声音设置后只显示“虚拟输出”。
$ pacmd list-cards
2 card(s) available.
index: 0
name: <alsa_card.pci-0000_01_00.1>
driver: <module-alsa-card.c>
owner module: 7
properties:
alsa.card = "2"
alsa.card_name = "HDA NVidia"
alsa.long_card_name = "HDA NVidia at 0xef080000 irq 17"
alsa.driver_name = "snd_hda_intel"
device.bus_path = "pci-0000:01:00.1"
sysfs.path = "/devices/pci0000:00/0000:00:01.0/0000:01:00.1/sound/card2"
device.bus = "pci"
device.vendor.id = "10de"
device.vendor.name = "NVIDIA Corporation"
device.product.id = "0e1b"
device.product.name = "GK107 HDMI Audio Controller"
device.string = "2"
device.description = "GK107 HDMI Audio Controller"
module-udev-detect.discovered = "1"
device.icon_name = "audio-card-pci" …Run Code Online (Sandbox Code Playgroud)