我很好奇df -H
and df -h
,然后man df
告诉我:
-h, --human-readable
print sizes in human readable format (e.g., 1K 234M 2G)
-H, --si
likewise, but use powers of 1000 not 1024
Run Code Online (Sandbox Code Playgroud)
那么使用 1000 次幂背后的原理是什么?
也许是一个附带问题(甚至相关):
root@host:~# df
Filesystem 1K-blocks Used Available Use% Mounted on
Run Code Online (Sandbox Code Playgroud)
K
区块是1024 还是 1000?
我在这里的问题是了解basic.target
启动我的 CentOS 7 服务器时的情况。
我认为我对 Systemd 的了解是正确的:
Requires=unit2
意味着有些只有在全部成功的情况unit1
下才会被激活unit2
Wants=unit2
unit1
表示无论列出的unit2是否成功,某些都会被激活
After=unit2
意味着有些unit1
只有在unit2激活后才会激活
Systemd 中的事物通常是并行开始的
.target
主要用于“分组”和“排序”(参见systemd.target)
实际上,必须在达到(这是服务器的默认运行级别basic.target
)之前激活(以及它所需和想要的一切)multi-user.target
好吧,我希望到目前为止我是对的。
现在,寻找basic.target
:
$ sudo cat /usr/lib/systemd/system/basic.target
[Unit]
Description=Basic System
Documentation=man:systemd.special(7)
Requires=sysinit.target
After=sysinit.target
Wants=sockets.target timers.target paths.target slices.target
After=sockets.target paths.target slices.target
Run Code Online (Sandbox Code Playgroud)
所以现在我的解释是:
basic.target
成功后 才会激活sysinit.target
此外,basic.target
希望能够sockets.target
跑步等
附加After=
手段,好的,请在、、激活basic.target
后才激活。失败也没关系。sockets.target
paths.target
slices.target
timers.target
那么为什么不将两者合而为一After=
呢?为什么不使用Require=
代替Wants
(除了timers.target …
我来自 Ubuntu。我知道如何在 Ubuntu 上安装 virtualenv 和配置东西。现在 Fedora 对我来说似乎很奇怪......
遵循这两个指南:
在 Fedora 上设置 virtualenv、pip、virtualenvwrapper 和 IPython
如何在 Fedora 16 / 15 / 14 中安装 Virtualenv
当我尝试设置我的 virtualenv 时,我得到了这个
bash: virtualenv: 命令未找到...
我是在root下安装的。如果我这样做ls
:
$ su -
[root@localhost ~]# ls
anaconda-ks.cfg bin lib
[root@localhost bin]# ls
virtualenv virtualenvwrapper.sh
[root@localhost bin]#
[root@localhost bin]# cd
[root@localhost ~]# cd lib
[root@localhost lib]# ls
python2.7
[root@localhost lib]# cd python2.7/
[root@localhost python2.7]# ls
site-packages
[root@localhost python2.7]# cd site-packages/
[root@localhost site-packages]# ls
virtualenv-1.7-py2.7.egg-info virtualenvwrapper
virtualenv.py virtualenvwrapper-2.11-py2.7.egg-info
virtualenv.pyc …
Run Code Online (Sandbox Code Playgroud) 为了实验的目的...
假设我这样做了
bash="unset DISPLAY; export DISPLAY"
Run Code Online (Sandbox Code Playgroud)
所以我可以使DISPLAY
未定义。如何恢复原始值集?或者至少知道它是什么?