Linuxの知識-その1 | リフレプログラミング

Linuxの知識-その1

画像エディタ
Windows→Microsoft Photo Editor, ペイント
Linux → Eye of GNOME 画像 ビューワ


viエディタ
@ウィンドウ分割
:split
@置換
:%s/"置換対象"/"置換結果"/g


sshのユーザを限定する
@設定ファイル設定
/etc/ssh/sshd_config
を開き例えば、wuとoracleのみ許容であれば
"AllowUsers wu oracle"
と追加する。
@sshd再起動
/etc/rc.d/init.d/sshd restart


許容IPの制御をする
@IPTABLE 確認
/sbin/iptables -L

@IPTABLE 再起動
/sbin/iptables restart



Shellの知識
@Here Document ヒアドキュメント
sqlplus /nolog <<EOF
connect / as sysdba
shutdown abort
EOF

@入力待ちにする
read aaa
echo $aaa

@awk

ps -ef | grep sql | grep 27012 | awk '{print "kill -9 "$2}' | sh
awk に -F でトークンの指定

@tail

tail -fで最終行から
tail の反対は head

visudo
#
# This file MUST be edited with the 'visudo' command as root.
#
# See the sudoers man page for the details on how to write a sudoers file.
#

# Host alias specification
Host_Alias LOCAL = 192.168.1.0/24

# User alias specification

# Cmnd alias specification
Cmnd_Alias RM = /bin/rm

# Defaults specification

# User privilege specification
root ALL=(ALL) ALL
#oracle LOCAL=(ALL) ALL, !RM

# Uncomment to allow people in group wheel to run all commands
# %wheel ALL=(ALL) ALL

# Same thing without a password
# %wheel ALL=(ALL) NOPASSWD: ALL
oracle ALL=(ALL) NOPASSWD: ALL

# Samples
# %users ALL=/sbin/mount /cdrom,/sbin/umount /cdrom
# %users localhost=/sbin/shutdown -h now