我知道如何同时执行多个命令,但现在我需要的是多次运行相同的命令,并在命令执行之间有一些时间延迟。
I'm trying to use the date command to generate a file timestamp that the date command itself can interpret. However, the date command does not seem to like its own output, and I am not sure how to work around this. Case in point:
sh-4.2$ date
Fri Jan 3 14:22:19 PST 2014
sh-4.2$ date +%Y%m%dT%H%M
20140103T1422
sh-4.2$ date -d "20140103T1422"
Thu Jan 2 23:22:00 PST 2014
Run Code Online (Sandbox Code Playgroud)
date appears to be interpreting the string with an offset of 15 hours. Are …
我有一项特殊的服务,它记录罕见但重要的信息。几个月前我已经设置好了,今天我跑journalctl -n 50 --unit=my-service了却发现没有条目。
我对大多数单位的这种行为非常满意——我要么需要立即发生的事情(或最多几天前),我不关心几个月前的记录。
但是,有没有办法告诉journald对单个特定单元的记录有一个独立的存储和保留策略?我想保留这些特定的日志,比如说,5 年——不管它需要多大。其他单位的日志应该不受此影响,并保留其现有行为。
我有点失去了理解journald.conf(5),并且根本无法弄清楚何时可以进行每单位配置。如果是 - 希望有一个简短的具体示例 - 我应该编辑/创建哪个文件以及我应该写什么。或者,如果你确定这肯定是不可行的——那也是一个很好的答案。
注意:我的特殊情况涉及 Arch Linux 主机,但我想这应该无关紧要。
我不想评论文本文件或代码中的文本行。我正在寻找在.vimrc文件中插入块注释。插入单行注释"使用,例如:
" remove spaces and tabs as well at the end of line automatically while saving
autocmd BufWritePre * :%s/\s\+$//e
Run Code Online (Sandbox Code Playgroud)
现在,我在浏览 Internet 以添加很酷的功能后,多年来收集了相对大量的设置/配置/插件。我希望在我的 .vimrc 文件中添加一些大的注释块。添加"到每一行是一个选项,但我正在寻找块注释语法。类似于/**/C.
//等同于"
/* */等同于_ ____?
搜索 Unix.SE、SO 和谷歌搜索并没有多大帮助。
示例我有大/小文件系统JFS2/EXT3,无论(以及各种操作系统、Linux、AIX),但其中一些是例如:90%、95%、98% 的使用率。
问题:文件系统几乎满了会不会有什么坏处?性能问题或 FS 损坏或硬件问题?
更新:
问题是关于企业环境。有没有人有关于效果的真实文章/网址?:)
“这些文件系统上有哪些目录?” - 任何,例如:SAP、ORACLE 等。
磁盘通常来自 SAN。
受到这个问题的启发,标题为:内置命令何时加载到内存中,在尝试回答这个问题时,我尝试了以下命令,但对我无法运行它感到有点惊讶:
$ strace cd $HOME
Run Code Online (Sandbox Code Playgroud)
有没有一种方法可以用来为 Bash 的内置命令运行 strace?
OS: CentOS-6.5-x86_64-minimal
Run Code Online (Sandbox Code Playgroud)
我下载了最新版本的OpenSSL
提取它 tar -xvzf openssl-1.0.1e.tar.gz
cd openssl-1.0.1e
./config --prefix=/usr/local
make
Run Code Online (Sandbox Code Playgroud)
它给了我以下错误:
making all in crypto...
make[1]: Entering directory `/usr/local/src/openssl-1.0.1e/crypto'
making all in crypto/objects...
make[2]: Entering directory `/usr/local/src/openssl-1.0.1e/crypto/objects'
make[2]: Nothing to be done for `all'.
make[2]: Leaving directory `/usr/local/src/openssl-1.0.1e/crypto/objects'
making all in crypto/md4...
make[2]: Entering directory `/usr/local/src/openssl-1.0.1e/crypto/md4'
make[2]: Nothing to be done for `all'.
make[2]: Leaving directory `/usr/local/src/openssl-1.0.1e/crypto/md4'
making all in crypto/md5...
make[2]: Entering directory `/usr/local/src/openssl-1.0.1e/crypto/md5'
make[2]: Nothing to be done for `all'.
make[2]: Leaving directory `/usr/local/src/openssl-1.0.1e/crypto/md5'
making …Run Code Online (Sandbox Code Playgroud) 有没有办法从 bash 获取鼠标按钮状态?Xdotool 只能获取鼠标位置。
我想设置一些东西,我可以定义一个规则,当按下鼠标按钮时,可以执行脚本。
看看一些常用 Linux 发行版(分别是 ArchLinux 和 Debian)上的默认用户和组管理,我想知道关于它的两件事以及修改默认设置和配置的后果。
USERGROUPS_ENABin的默认值/etc/login.defs好像是“yes”,这体现在man中可以找到的“默认情况下,也会为新用户创建一个组”useradd,所以每次创建新用户时,都会出现一个组是用相同的名称创建的,只有这个新用户。有什么用吗,或者这只是一个占位符?
我觉得这样做我们正在失去作为用户/组/其他人的一部分权限管理。拥有一个组“用户”或“常客”或任何您想称其为每个用户的默认组而不是拥有自己的组会不会很糟糕?
我的问题的第二部分仍然基于我在 Arch 和 Debian 上看到的内容:默认情况下创建了很多用户(FTP、HTTP 等)。它们有什么用吗,还是只是因为历史原因而存在?
我正在考虑删除它们,但不想破坏任何可以使用它的东西,但我从未见过这样做的任何东西,也不知道可以做什么。对于我从未见过任何用户所属的默认组(tty、mem 等)也是如此。
我正在使用本地 BIND9 服务器来托管一些本地 dns 记录。在尝试挖掘本地域名时,如果我没有明确告诉 dig 使用我的本地 BIND9 服务器,我将无法找到它。
user@heimdal:~$ dig +short heimdal.lan.se
user@heimdal:~$ dig +short @192.168.1.7 heimdal.lan.se
192.168.1.2
Run Code Online (Sandbox Code Playgroud)
使用 Ubuntu 17.04 和 systemd-resolved。这是我的/etc/resolved的内容
# Dynamic resolv.conf(5) file for glibc resolver(3) generated by resolvconf(8)
# DO NOT EDIT THIS FILE BY HAND -- YOUR CHANGES WILL BE OVERWRITTEN
# 127.0.0.53 is the systemd-resolved stub resolver.
# run "systemd-resolve --status" to see details about the actual nameservers.
nameserver 127.0.0.53
Run Code Online (Sandbox Code Playgroud)
以及 systemd-resolve --status 的输出
Global
DNS Servers: 192.168.1.7
192.168.1.1
DNSSEC NTA: 10.in-addr.arpa …Run Code Online (Sandbox Code Playgroud)