Opensourcetechブログ

OpensourcetechによるLinux・オープンソース・IT技術などに関するブログです。

manコマンド(マニュアル)について

 

 

こんにちは、LinuCエバンジェリストこと、鯨井貴博@opensourcetechです。

 

今回は、manコマンド(マニュアル参照)について簡単にまとめてみます。

 

 

manコマンド

以下のリンクにあるように、コマンドの使い方/オプション・ファイルフォーマットなど様々なことを知ることが出来るものです。

Man page of man

 

困ったら、「man」というやつですね。

 

 

manで参照できる情報

 manを実行した場合には、数字やアルファベットなど 出力情報の種類を表すセクション番号というものがあります。

以下の例では、「(8)」という部分です。

※man sysctlの例。

SYSCTL(8)                                                                                           SYSCTL(8)

名前
sysctl - 実行時にカーネルパラメータを設定する

書式
sysctl [-n] [-e] variable ...
sysctl [-n] [-e] [-q] -w variable=value ...
sysctl [-n] [-e] [-q] -p <filename>
sysctl [-n] [-e] -a
sysctl [-n] [-e] -A

説明
sysctl はカーネルのパラメータを実行時に修正するのに用いる。変更できるパ
ラメータは /proc/sys/ 以下にリストされているものである。 Linux における
sysctl の機能には procfs が必要である。 sysctl は sysctl データの読み書
き両方に使える。

 

 セクション番号は、以下のように決められており、

「(8)」はシステム管理用のコマンドに関するマニュアルであることがわかります。

1 実行プログラムまたはシェルのコマンド
2 システムコール (カーネルが提供する関数)
3 ライブラリコール (システムライブラリに含まれる関数)
4 特殊なファイル (通常 /dev に置かれているもの)
5 ファイルのフォーマットと約束事。例えば /etc/passwd など
6 ゲーム
7 マクロのパッケージとその約束事。例えば man(7), groff(7) など
8 システム管理用のコマンド
9 カーネルルーチン [非標準]
n 新しいもの [最近では使われない]
l システムローカルなもの [最近では使われない]
p パブリックなもの [最近では使われない]
o 古いもの [最近では使われない]

 

 

man実行に必要なパッケージ

CentOSの場合ですが、以下のパッケージが導入されていれば、manコマンドを実行することが出来ます。

・man(CentOS7では、man-db)

・man-pages(日本語版はman-pages-ja、その他言語用もman-pages-**)

 

CentOS6

[root@CentOS6 ~]# rpm -ql man
/etc/cron.daily/makewhatis.cron
/etc/man.config
/usr/bin/apropos
/usr/bin/man <-------manコマンド
/usr/bin/man2html
/usr/bin/manpath
/usr/bin/whatis
/usr/libexec/man-cmp.sh
/usr/sbin/makewhatis
.
.
省略
.
.
[root@CentOS6 ~]# yum search man-
読み込んだプラグイン:fastestmirror
Loading mirror speeds from cached hostfile
* base: ftp.iij.ad.jp
* extras: ftp.iij.ad.jp
* updates: ftp.iij.ad.jp
============================== N/S Matched: man- ===============================
man-pages-fr.noarch : French version of the Linux man-pages <-------フランス語
ctan-cm-lgc-roman-fonts.noarch : CM-LGC Type 1 fonts, serif font faces
libwsman-devel.i686 : Open-source Implementation of WS-Management
libwsman-devel.x86_64 : Open-source Implementation of WS-Management
man-pages.noarch : Man (manual) pages from the Linux Documentation Project <-------英語
man-pages-cs.noarch : Czech man pages from the Linux Documentation Project <-------チェコ語
man-pages-es.noarch : Spanish man pages from the Linux Documentation Project <-------スペイン語
man-pages-es-extra.noarch : Extra manual pages - Spanish versions
man-pages-it.noarch : Italian man (manual) pages from the Linux Documentation
: Project <-------イタリア語
man-pages-ja.noarch : Japanese man (manual) pages from the Japanese Manual
: Project <-------日本語
man-pages-ko.noarch : Korean(Hangul) Man(manual) Pages from the Korean Manpage <-------韓国語(ハングル)
: Project
man-pages-overrides.noarch : Complementary and updated manual pages
man-pages-pl.noarch : Polish man pages from the Linux Documentation Project
man-pages-ru.noarch : Russian man pages from the Linux Documentation Project
man-pages-uk.noarch : Ukrainian man pages from the Linux Documentation Project
.
.
省略
.
.

 

CentOS7

[root@localhost ~]# rpm -ql man-db
/etc/cron.daily/man-db.cron
/etc/man_db.conf
/etc/sysconfig/man-db
/usr/bin/apropos
/usr/bin/catman
/usr/bin/lexgrog
/usr/bin/man <-------manコマンド
/usr/bin/mandb
/usr/bin/manpath
/usr/bin/whatis
.
.
省略
.
.
[root@localhost ~]# yum search man-
読み込んだプラグイン:fastestmirror
Loading mirror speeds from cached hostfile
* base: ftp.iij.ad.jp
* extras: ftp.iij.ad.jp
* updates: ftp.iij.ad.jp
============================== N/S matched: man- ===============================
man-pages-fr.noarch : French version of the Linux man-pages
byteman-javadoc.noarch : Javadocs for byteman
libguestfs-man-pages-ja.noarch : Japanese (ja) man pages for libguestfs
libguestfs-man-pages-uk.noarch : Ukrainian (uk) man pages for libguestfs
libmodman-devel.i686 : Development files for libmodman
libmodman-devel.x86_64 : Development files for libmodman
libwsman-devel.i686 : Open source Implementation of WS-Management
libwsman-devel.x86_64 : Open source Implementation of WS-Management
man-db.x86_64 : Tools for searching and reading man pages
man-pages.noarch : Man (manual) pages from the Linux Documentation Project
man-pages-cs.noarch : Czech man pages from the Linux Documentation Project
man-pages-es.noarch : Spanish man pages from the Linux Documentation Project
man-pages-es-extra.noarch : Extra manual pages - Spanish versions
man-pages-it.noarch : Italian man (manual) pages from the Linux Documentation
: Project
man-pages-ja.noarch : Japanese man (manual) pages from the Japanese Manual
: Project
man-pages-ko.noarch : Korean(Hangul) Man(manual) Pages from the Korean Manpage
: Project
man-pages-overrides.x86_64 : Complementary and updated manual pages
man-pages-pl.noarch : Polish man pages from the Linux Documentation Project
man-pages-ru.noarch : Russian man pages from the Linux Documentation Project
man-pages-zh-CN.noarch : Chinese Man Pages from Chinese Man Pages Project
openwsman-client.i686 : Openwsman Client libraries
openwsman-client.x86_64 : Openwsman Client libraries
openwsman-perl.x86_64 : Perl bindings for openwsman client API
openwsman-python.x86_64 : Python bindings for openwsman client API
.
.
省略
.
.

 

 

manの実行

セクション番号を付与してコマンドを実行する場合、以下のようにします。

[root@CentOS6 ~]# man 2 sysctl
[root@CentOS6 ~]# man 3 sysctl
No entry for sysctl in section 3 of the manual <-------該当するものなし
[root@CentOS6 ~]# man 5 sysctl.conf

 

 

 

www.slideshare.net

github.com

www.facebook.com

twitter.com

www.instagram.com

 

 

にほんブログ村 IT技術ブログ Linuxへ
Linux

にほんブログ村 IT技術ブログ オープンソースへ
オープンソース

 

 

Ansible を v2.7.4へアップグレード

 

 

こんにちは、LinuCエバンジェリストこと、鯨井貴博@opensourcetechです。

 

Ansible v2.7.4がリリースされたので、アップグレード!

ansible/CHANGELOG-v2.7.rst at stable-2.7 · ansible/ansible · GitHub

 

 

Changelogs

バグフィックス 1件。

Bugfixes

powershell - add lib/ansible/executor/powershell to the packaging data

 

アップグレード

XYZ:~ Yoshiki$ pip list | grep ansible
ansible 2.7.3
XYZ:~ Yoshiki$ pip install --upgrade ansible
Collecting ansible
Downloading https://files.pythonhosted.org/packages/9e/df/b7ce359f9cc16864e0d5c9c93efe69f576fc437e74549bcc142f02cd4216/ansible-2.7.4.tar.gz (11.8MB)
100% |████████████████████████████████| 11.8MB 1.8MB/s
Requirement already satisfied, skipping upgrade: jinja2 in ./anaconda3/lib/python3.6/site-packages (from ansible) (2.10)
Requirement already satisfied, skipping upgrade: PyYAML in ./anaconda3/lib/python3.6/site-packages (from ansible) (3.12)
Requirement already satisfied, skipping upgrade: paramiko in ./anaconda3/lib/python3.6/site-packages (from ansible) (2.4.1)
Requirement already satisfied, skipping upgrade: cryptography in ./anaconda3/lib/python3.6/site-packages (from ansible) (2.2.2)
Requirement already satisfied, skipping upgrade: setuptools in ./anaconda3/lib/python3.6/site-packages (from ansible) (39.1.0)
Requirement already satisfied, skipping upgrade: MarkupSafe>=0.23 in ./anaconda3/lib/python3.6/site-packages (from jinja2->ansible) (1.0)
Requirement already satisfied, skipping upgrade: pyasn1>=0.1.7 in ./anaconda3/lib/python3.6/site-packages (from paramiko->ansible) (0.4.4)
Requirement already satisfied, skipping upgrade: pynacl>=1.0.1 in ./anaconda3/lib/python3.6/site-packages (from paramiko->ansible) (1.2.1)
Requirement already satisfied, skipping upgrade: bcrypt>=3.1.3 in ./anaconda3/lib/python3.6/site-packages (from paramiko->ansible) (3.1.4)
Requirement already satisfied, skipping upgrade: idna>=2.1 in ./anaconda3/lib/python3.6/site-packages (from cryptography->ansible) (2.6)
Requirement already satisfied, skipping upgrade: asn1crypto>=0.21.0 in ./anaconda3/lib/python3.6/site-packages (from cryptography->ansible) (0.24.0)
Requirement already satisfied, skipping upgrade: six>=1.4.1 in ./anaconda3/lib/python3.6/site-packages (from cryptography->ansible) (1.11.0)
Requirement already satisfied, skipping upgrade: cffi>=1.7 in ./anaconda3/lib/python3.6/site-packages (from cryptography->ansible) (1.11.5)
Requirement already satisfied, skipping upgrade: pycparser in ./anaconda3/lib/python3.6/site-packages (from cffi>=1.7->cryptography->ansible) (2.18)
Building wheels for collected packages: ansible
Running setup.py bdist_wheel for ansible ... done
Stored in directory: /Users/Yoshiki/Library/Caches/pip/wheels/e0/9f/50/64105336fc05fac4316cff41724ac5d6f32dab36540c7400cc
Successfully built ansible
Installing collected packages: ansible
Found existing installation: ansible 2.7.3
Uninstalling ansible-2.7.3:
Successfully uninstalled ansible-2.7.3
Successfully installed ansible-2.7.4
XYZ:~ Yoshiki$ pip list | grep ansible
ansible 2.7.4

 

 

 

 

www.slideshare.net

github.com

www.facebook.com

twitter.com

www.instagram.com

 

 

にほんブログ村 IT技術ブログ Linuxへ
Linux

にほんブログ村 IT技術ブログ オープンソースへ
オープンソース

 

 

Ansible を v2.7.3へアップグレード

 

 

こんにちは、LinuCエバンジェリストこと、鯨井貴博@opensourcetechです。

 

Ansible v2.7.3がリリースされたので、アップグレード!

ansible/CHANGELOG-v2.7.rst at stable-2.7 · ansible/ansible · GitHub

 

 

Changelogs

マイナーチェンジ 5件、バグフィックス 15件。

Minor Changes

・Document Path and Port are mutually exclusive parameters in wait_for module.
・Puppet module remove --ignorecache to allow Puppet 6 support
・dnf properly support modularity appstream installation via overloaded group modifier syntax
・proxmox_kvm - fix exception.
・win_security_policy - warn users to use win_user_right instead when editing Privilege Rights

Bugfixes

・Fix the issue that FTD HTTP API retries authentication-related HTTP requests.
・Fix the issue that module fails when the Swagger model does not have required fields.
・Fix the issue with comparing string-like objects.
・Fix using omit on play keywords (https://github.com/ansible/ansible/issues/48673)
Windows - prevent sensitive content from appearing in scriptblock logging (CVE 2018-16859)
・apt_key - Disable TTY requirement in GnuPG for the module to work correctly when SSH pipelining is enabled (https://github.com/ansible/ansible/pull/48580)
・better error message when bad type in config, deal with EVNAR= more gracefully https://github.com/ansible/ansible/issues/22470
・configuration retrieval would fail on non primed plugins
・cs_template - Fixed a KeyError on state=extracted.
・docker_container - fix idempotency problems with docker-py caused by previous init idempotency fix.
・docker_container - fix interplay of docker-py version check with argument_spec validation improvements.
・docker_network - driver_options containing Python booleans would cause Docker to throw exceptions.
・ec2_group - Fix comparison of determining which rules to purge by ignoring descriptions - https://github.com/ansible/ansible/issues/47904
・pip module - fix setuptools/distutils replacement (https://github.com/ansible/ansible/issues/47198)
・sysvinit - enabling a service should use "defaults" if no runlevels are specified

 

 

アップグレード

XYZ:~ Yoshiki$ pip list | grep ansible
ansible 2.7.1
XYZ:~ Yoshiki$ pip install --upgrade ansible
Collecting ansible
Downloading https://files.pythonhosted.org/packages/4d/6e/33c2bd77ea2154386fe84325e606e01c057e818f6415e0a4ad83de092612/ansible-2.7.3.tar.gz (11.8MB)
100% |████████████████████████████████| 11.8MB 1.8MB/s
Requirement already satisfied, skipping upgrade: jinja2 in ./anaconda3/lib/python3.6/site-packages (from ansible) (2.10)
Requirement already satisfied, skipping upgrade: PyYAML in ./anaconda3/lib/python3.6/site-packages (from ansible) (3.12)
Requirement already satisfied, skipping upgrade: paramiko in ./anaconda3/lib/python3.6/site-packages (from ansible) (2.4.1)
Requirement already satisfied, skipping upgrade: cryptography in ./anaconda3/lib/python3.6/site-packages (from ansible) (2.2.2)
Requirement already satisfied, skipping upgrade: setuptools in ./anaconda3/lib/python3.6/site-packages (from ansible) (39.1.0)
Requirement already satisfied, skipping upgrade: MarkupSafe>=0.23 in ./anaconda3/lib/python3.6/site-packages (from jinja2->ansible) (1.0)
Requirement already satisfied, skipping upgrade: pynacl>=1.0.1 in ./anaconda3/lib/python3.6/site-packages (from paramiko->ansible) (1.2.1)
Requirement already satisfied, skipping upgrade: pyasn1>=0.1.7 in ./anaconda3/lib/python3.6/site-packages (from paramiko->ansible) (0.4.4)
Requirement already satisfied, skipping upgrade: bcrypt>=3.1.3 in ./anaconda3/lib/python3.6/site-packages (from paramiko->ansible) (3.1.4)
Requirement already satisfied, skipping upgrade: idna>=2.1 in ./anaconda3/lib/python3.6/site-packages (from cryptography->ansible) (2.6)
Requirement already satisfied, skipping upgrade: asn1crypto>=0.21.0 in ./anaconda3/lib/python3.6/site-packages (from cryptography->ansible) (0.24.0)
Requirement already satisfied, skipping upgrade: six>=1.4.1 in ./anaconda3/lib/python3.6/site-packages (from cryptography->ansible) (1.11.0)
Requirement already satisfied, skipping upgrade: cffi>=1.7 in ./anaconda3/lib/python3.6/site-packages (from cryptography->ansible) (1.11.5)
Requirement already satisfied, skipping upgrade: pycparser in ./anaconda3/lib/python3.6/site-packages (from cffi>=1.7->cryptography->ansible) (2.18)
Building wheels for collected packages: ansible
Running setup.py bdist_wheel for ansible ... done
Stored in directory: /Users/Yoshiki/Library/Caches/pip/wheels/17/6d/62/f4525f25425c49de1d493a43e42473d2934f58a282dd880dd1
Successfully built ansible
Installing collected packages: ansible
Found existing installation: ansible 2.7.1
Uninstalling ansible-2.7.1:
Successfully uninstalled ansible-2.7.1
Successfully installed ansible-2.7.3
XYZ:~ Yoshiki$ pip list | grep ansible
ansible 2.7.3

 

 

 

 

www.slideshare.net

github.com

www.facebook.com

twitter.com

www.instagram.com

 

 

にほんブログ村 IT技術ブログ Linuxへ
Linux

にほんブログ村 IT技術ブログ オープンソースへ
オープンソース

 

 

Opensourcetech by Takahiro Kujirai