度々使うLinuxのコマンド

度々使うLinuxのコマンド

度々使うLinuxのコマンド

度々使うLinux(Redhat系)のコマンドを紹介します。



find / -name "*.jpg" -print

ファイルを検索する


dhclient -r

IPアドレスを開放


dhclient

IPアドレスを取得


iptables -L

ファイアウォールに関する設定内容の表示


/etc/sysconfig/network-scripts/ifcfg-eth0

eth0のIPアドレス等を設定するファイル


pwd

現在のディレクトリを表示


cd ..

1つ上の階層へ移動


touch

空ファイルを作成
※元はタイムスタンプを変更するコマンド


/etc/resolv.conf

使用するDNSサーバー(nameserver)の指定


vi /etc/sysconfig/iptables

iptablesの編集
ファイアウォール設定画面の呼び出しは

system-config-securitylevel


chkconfig -l

サービスの自動起動のリスト表示


rndc flush

BINDのキャッシュデータ削除
※BIND9.2.0から。


ps aux | grep named

起動中のnamedプロセスの起動ユーザー、起動オプションを表示


netstat -an | grep LISTEN

LISTEN状態にあるポート番号を調べる


lsof -i

LISTEN状態にあるポートを出力


postconf -n

Postfixのmain.cfの記載の中で、デフォルト値のままでは無く、
明示的に変更した設定を一覧表示する


postmap /etc/postfix/transport

postfixのtransport.dbを再構築する