20
14

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 5 years have passed since last update.

コマンド名: command not foundと言われたのでwhereisコマンドでしらべました。

Posted at

コマンドを叩いた時にcommand not foundと言われて困る時があります。

今回の例ではuseraddコマンドを実行したところエラーが出ました。

useraddコマンドが見つからない
useradd pugi_user
-bash: useradd: command not found

useraddコマンドが無いと言われています。pugi_userを追加しようとして失敗しました。

whereisコマンドでコマンドを調べる

コマンドが本当に無いかwhereisコマンドで調べます。

whereisコマンドでuseraddコマンドを調べる
whereis useradd

useradd: /usr/sbin/useradd /usr/share/man/man8/useradd.8.gz

/usr/sbin/useradduseraddがあるとわかりました。

コマンドをパス付きで実行

パス付きでコマンドを実行してみます。

パスを指定してコマンドを実行
/usr/sbin/useradd pugi_user

今度はpugi_userが追加できました。

20
14
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
20
14

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?