一个函数定义为:
do_something () {
do it
}
Run Code Online (Sandbox Code Playgroud)
我可以理解它的名称“do_something”和大括号来封装操作代码,但我无法理解()这里的目的是什么,因为 Bash 脚本中没有命名参数。将其定义为可能更好更直接
do_something {
do it
}
Run Code Online (Sandbox Code Playgroud)
这与它当前的语法没有冲突,甚至更多地声明没有命名参数。什么是的用法()吗?
当尝试从命令行安装 dropbox 时,我阅读了命令
cd ~ && wget -O - "https://www.dropbox.com/download?plat=lnx.x86_64" | tar xzf -
Run Code Online (Sandbox Code Playgroud)
-这里是什么 意思?是以前的目录吗?
在 Kubuntu 中,我将桌面背景设置为“Bing's Picture of the Day”。
有些图片太好了,我想储存它们以供进一步参考。
但是,图片不在~/Pictures.
这些背景图片保存在哪里?
根据这个问题,如何在 linux 上从命令行将一系列图像转换为 PDF?, ImageMagick 可以将多个图像转换为单个 PDF。
如何反转操作并将多页的 PDF 转换为多张图像?
我尝试了以下命令,但显示错误:
$ convert test.pdf test-%02.png
convert-im6.q16: attempt to perform an operation not allowed by the security policy `PDF' @ error/constitute.c/IsCoderAuthorized/408.
convert-im6.q16: no images defined `test-%02.png' @ error/convert.c/ConvertImageCommand/3258.
Run Code Online (Sandbox Code Playgroud)
gs 已安装:
$ gs --version
9.26
Run Code Online (Sandbox Code Playgroud)
Ubuntu 版本:
$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 19.04
Release: 19.04
Codename: disco
Run Code Online (Sandbox Code Playgroud) 每次启动机器时,我都运行以下程序:
$ cat start.sh
#! /bin/bash
google-chrome &> /dev/null &
lantern &> /dev/null &
xdg-open . &> /dev/null &
emacs &> /dev/null &
code ~/Programs/ &> /dev/null &
xdg-open ~/Reference/topic_regex.md &> /dev/null &
Run Code Online (Sandbox Code Playgroud)
繁琐&> /dev/null &......我怎么能缩短逻辑?
ls在当前目录上运行命令并获取输出:
$ ls
Applications Documents Library Music Public
Desktop Downloads Movies Pictures
Run Code Online (Sandbox Code Playgroud)
我想列举它们,如:
1. Applications
2. Desktop
3. Documents
4. Downloads
5. Library
6. Movies
7. Music
8. Pictures
9. Public
Run Code Online (Sandbox Code Playgroud)
这可以通过less中间方式实现
ls | less -N
Run Code Online (Sandbox Code Playgroud)
如何以直接的方式枚举它们?
在检查进程状态时,我读到了许多奇怪的状态
D
I
I<
R+
Rl
S
S+
S<
Sl
Sl+
SLl
SLl+
SN
SNsl
S<s
Ss
Ss+
S<sl
Ssl
Ssl+
STAT
Tl
Run Code Online (Sandbox Code Playgroud)
我学会了 I (idle,) R(running) , Sleep, 但不知道S+ S<,
他们的意思是什么?应该咨询什么样的材料?
我正在处理根目录并希望打印以大写字母开头的目录条目。
$ echo [A-Z]*
Applications Library Network System Users Volumes bin cores dev etc home installer.failurerequests net private sbin tmp usr var vm
Run Code Online (Sandbox Code Playgroud)
结果让我困惑,因为我没想到
cores dev etc home installer.failurerequests net private sbin tmp usr var vm会匹配我的模式。
如何编写仅匹配大写字母的 glob 模式?
该read内建命令有 -e选项
-e Use Readline to handle input. This permits input editing in the same
manner as the command line.
Run Code Online (Sandbox Code Playgroud)
Readline规范中有什么:
$ man readline
No manual entry for readline
$ man Readline
No manual entry for Readline
Run Code Online (Sandbox Code Playgroud)
没有readline的详细信息。
我正在研究 KDE Plasma 5。
当按Alt+Tab切换应用程序时,它们会显示在屏幕左侧。
如何让它们像 Gnome 一样显示在屏幕中央?
任务切换器设置不提供此类选项。