0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

【Linux】whatisコマンドが使えないときの対処法

Last updated at Posted at 2023-12-11

はじめに

Linuxのwhatisコマンドが使えなかったときに行った対処法を、備忘録として残しておきます。

エラー解消のヒントになれば幸いです。

whatisコマンドを使えるようにする手順

Linuxの勉強がてらプロンプトにコマンドを打ち込んでいると、以下のようなエラーに遭遇。

[user@localhost ~]$ whatis passwd
passwd: 適切なものはありませんでした。

whatisコマンド自体はあるみたいですが、うまく実行できてないようです。

書籍やネットで色々調べると、どうやらrootユーザーにログインしてmandbコマンドを実行すればよさげだとわかりました。

ということで実践↓

[user@localhost ~]$ sudo su -
[sudo] username のパスワード:
[root@localhost ~]# mandb

mandbコマンドが無事実行できたら元のユーザーに戻り、whatisコマンドを試してみましょう。

[root@localhost ~]# exit
ログアウト
[user@localhost ~]$ whatis passwd
passwd (1)            - ユーザパスワードを変更する
passwd (5)            - password file
passwd (1ossl)        - OpenSSL application commands

うまく実行できました。めでたしめでたし。

最後まで読んでいただき、ありがとうございました!

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?