忍者ブログ

[PR]

2025年04月22日 ()
×

[PR]上記の広告は3ヶ月以上新規記事投稿のないブログに表示されています。新しい記事を書く事で広告が消えます。

find: patternA or patternB

2008年08月02日 (linux)

command

# find / -name "*bashrc" -or -name "*bash_profile"                   #1
# find / -name "*bashrc" -or -name "*bash_profile" | grep -v root    #2

1./以下の"*bashrc"もしくは"*bash_profile"に一致したものを検索.
2.1+grepパイプ,文字列rootの出力行を除外.

note

cf.
% man find
% man grep
% grep --help | grep invert

invert : 〜を逆さまにする,ひっくり返す
PR

mount usb flash memory

2008年08月02日 (linux)

command

# mount -t msdos /dev/sdb1 /mnt    # mount
# umount /mnt                      # unmount

note

USBフラッシュメモリーはsdb*, sda*に認識される.

cf.
% man mount
% man umount

/etc/passwd format

2008年08月02日 (linux)

例:
httpd:x:501:httpd:/usr/local/httpd:/bin/bash

各フィールドは:で区切る.

  1. ログイン名
  2. パスワード,シャドウパスワードの場合はx
  3. ユーザID
  4. グループID,グループIDとグループ名の対応は/etc/group
  5. Gecosフィールド,ユーザの一般情報など
  6. ホームディレクトリ
  7. ログインシェル

/etc/group format

2008年08月02日 (linux)

例:
httpd:x:502:

各フィールドは:で区切る.

  1. グループID
  2. パスワード,シャドウパスワードの場合はx
  3. グループID
  4. グループリスト

/etc/shadow format

2008年08月02日 (linux)

例:
httpd::0:0:99999:7:::

各フィールドは:で区切る.

  1. ユーザ名
  2. 暗号化されたパスワード
  3. パスワードの最終更新日
  4. 変更可能最短期間
  5. 変更可能最長期間
  6. 警告日
  7. ログインしないと無効になる日数
  8. アカウント失効までの日数
  9. フラグ(未使用)