ラベル linux の投稿を表示しています。 すべての投稿を表示
ラベル linux の投稿を表示しています。 すべての投稿を表示

2012年8月5日日曜日

VirtualBoxで開発環境構築 アプリケーションのインストール

Apacheのインストール

  • Apacheのインストールコマンド
    • yum -y install httpd
  • Apacheの設定
    • ランレベルの設定
    •  /sbin/chkconfig httpd on
    •  /sbin/chkconfig --list httpd

MySqlのインストール

  • MySqlのインストールコマンド
    • yum -y install mysql-server
  • MySqlの設定
    • vi /etc/my.cnf
  • [mysqld] に追加
    • default-character-set = utf8
    • skip-character-set-client-handshake
    • character-set-server = utf8
    • collation-server = utf8_general_ci
    • init-connect = SET NAMES utf8
  • [mysqld_safe]の後に以下を書き込む
  • [client]
    • default-character-set = utf8
  • [mysql]
    • default-character-set = utf8
  • [mysqldump]
    • default-character-set = utf8
  • 自動起動設定
    • /sbin/chkconfig mysqld on
    • /sbin/chkconfig --list mysqld
  • 起動を確認
    • /etc/init.d/mysqld start

PHPのインストール

  • 取得先のGPG-KEY 取得
    • rpm –import http://www.jasonlitka.com/media/RPM-GPG-KEY-jlitka
  • 設定ファイルを作成
    • vi /etc/yum.repos.d/utterramblings.repo
[utterramblings]
name=Jason’s Utter Ramblings Repo
baseurl=http://www.jasonlitka.com/media/EL$releasever/$basearch/
enabled=1
gpgcheck=1
gpgkey=http://www.jasonlitka.com/media/RPM-GPG-KEY-jlitka
  • 取得先のGPG-KEY 取得
    • yum install php
    • yum install php-devel
    • yum install php-common
    • yum install php-gd php-mbstring php-pdo php-mcrypt php-mysql php-ncurses php-xml
  • バージョンの確認コマンド
    • php -v

Pearのインストール

  • Pearをインストール
    • yum -y install php-pear

Symfonyのインストール

  • symfonyのチャネルを登録
    • pear channel-discover pear.symfony-project.com
  • symfonyのチャネルを登録
    • pear channel-discover pear.symfony-project.com
  • Pearでsymfonyをインストール
    • pear install symfony/symfony-1.0.20
  • バージョンの確認コマンド
    • symfony -V

vsftpdのインストール

2012年8月4日土曜日

VirtualBoxで開発環境構築 セキュリティとネットワークの設定

参考にさせていただいたサイト

セキュリティの設定

  • userの作成
  • VirtualBoxのネットワークアダプタ設定
  • SELinuxの設定
  • iptablesの設定

userの作成

  • useradd 作成したいユーザ名
  • passwd 作成したいユーザ名
    • 警告が出るが作成は可能
rootだとなんでも出来てしまって危険なので基本はuserで作業する
suコマンドでrootになれる

VirtualBoxのネットワークアダプタ設定

  • ssh接続のための設定
    • VirtualBoxの「詳細」にある「ネットワーク」
    •  アダプタ1→ホストオンリーネットワーク(ゲストOSとホストOS間のネットワーク)
    •  アダプタ2→NAT(ゲストOSから外部へのネットワーク)
ゲストOS起動中の場合は一度停止してからでないと変更が出来ない

SELinuxの設定

  • SELinuxの無効化
    • # vi /etc/sysconfig/selinux
    •   SELINUX=enforcing
    •   ↓
    •   SELINUX=disabled
    • rebootコマンド→getenforceコマンドでdisabledであることを確認

iptablesの設定

  • 最初に設定
    • iptables -P INPUT ACCEPT (外部からのアクセスを許可)
    • iptables -P FORWARD DROP (次にデータを渡す)
    • iptables -P OUTPUT ACCEPT (外部にデータを渡す)
  • ルールの初期化
    • iptables -F (上のコマンドiptablesのルールの設定を反映させるためのコマンド)
  • icmp(ping) と自端末からの入力を許可
    • iptables -A INPUT -p icmp -j ACCEPT
    • iptables -A INPUT -i lo -j ACCEPT
  • Web、FTP、POP、smtp による接続を許可
    • iptables -A INPUT -p tcp --dport 80 -j ACCEPT
    • iptables -A INPUT -p tcp --dport 21 -j ACCEPT
    • iptables -A INPUT -p tcp --dport 110 -j ACCEPT
    • iptables -A INPUT -p tcp --dport 25 -j ACCEPT
  • ssh による接続を許可
    • iptables -A INPUT -p tcp --dport 22 -j ACCEPT
  • TCP の接続開始と応答、FTP データなどを許可
    • iptables -A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT
  • ルールをセーブする
    • /etc/init.d/iptables save
  • 設定の確認
    • cat /etc/sysconfig/iptables
  • 再起動する
    • reboot
VirtualBoxで開発環境構築 アプリケーションのインストールに続く

2012年8月1日水曜日

VirtualBoxで開発環境構築 CentOSのインストール

参考にさせてもらったサイト


詳しい手順が載ってます
感謝です

centOSのダウンロード


VirtualBoxでの作業

  • 新規の仮想マシンの作成
  • 仮想マシンを起動
    • isoイメージをマウントさせるように設定する
    • 初回起動ウィザードで、起動したときに選択肢がでる
    • 自動的にインストールに移行する
    • メニューバーのデバイス→CD/DVDデバイスの項目でも選択できる

インストール準備(BIOSっぽい設定)

  • インストールに使用する言語
    • japanese
    • 次の画面でtextモードでは英語になるという警告が出るのでOK
  • キーボードタイプ
    • jp106
  • Installation Method
    • HTTP
  • Configure TCP/IP
    • とりあえずDHCPで自動割り当て
    • IPv6 supportのチェックを外す(*をスペース入力で置き換える)
  • HTTP setup
    • web site name:ftp.riken.jp
    • CentOS directory:Linux/centos/5.1/os/x86_64

centOSのインストール

  • ドライブを削除する等の初期化
    • 許可してデフォルトでパーティションを作成させる
  • ネットワークデバイス
    • デフォルト
  • ホスト名を設定
    • DhCP経由で自動設定
  • rootのパスワードの設定
    • メモの保存を忘れずに
  • Desktop-Gnomeのチェックを外す
    • GUIは使わないので
  • 追加でソフトウェアリポジトリを加える
    • 今すぐカスタマイズするにチェック
  • セレクトボックスの開発を選択し以下の項目をチェック
    • レガシーなソフトウェアの開発
    • 開発ツール
    • 開発ライブラリ
  • 以上の設定を終えればインストールに入る
    • この作業は数分かかる
    • インストール成功後に自動的に再起動される
    • このときデバイスにネットインストールisoが選択されてる状態だともう一度インストールしようとするようだ
    • メニューバーのデバイス→CD/DVDデバイスの項目でisoイメージを選択解除できる
完了!

2012年4月27日金曜日

2012年04月26日 講義056日目

2012年04月26日
講義056日目
------------------------------1H------------------------------
★サーバ設定の復習
●SELinux
・firewallの設定
ポートを空けたりとかする
●色々とインストールする
・yumコマンド
インストールするためのコマンド
・ランレベルの設定
Linuxの動作モード
動作モードによって起動されるプログラムを設定する。基本2-5
・service --status-all
実行中のプログラムを全部表示させる
httpdとmysqldとvsftpdが動いている事を確認
・文字コードの設定
・symfonyのインストール
●NTP(Network Time Protocol)
・cron登録用のシェルを作成
・ファイル権限設定
・自動起動設定
●シェルスクリプト
サーバを自動で動かしたい時に書いておくもの
------------------------------2H------------------------------
★サーバ設定の復習
------------------------------3H------------------------------
★サーバにPHPで作ったwebサイトを移植する
●PHPファイル
・BBSをzipで圧縮
・FFFTPで圧縮したBBS.zipをサーバに上げる
●mysqlファイル
・コマンドプロンプトでデータベース.sqlをローカルにコピーする
・FFFTPでDBごとサーバに上げる
------------------------------4H------------------------------
★サーバにPHPで作ったwebサイトを移植する
●PHPファイルの解凍
・unzip bbs.zip
zipファイルを解凍する
・mysql -u ユーザ名 -p DB名 < ファイル名.sql
mysqlにDBをインポートする
●eclipseでリモート接続
eclipseのリモートシステムエクスプローラを使い、PHPファイルを編集する
------------------------------5H------------------------------
★サーバ上のPHPファイルを編集する
●修正
・localhostにとばされる部分をブラウザに紐付けたサーバ名に変更する
------------------------------6H------------------------------
★移行デバック
●ini_set("display_errors","On");
でエラーを出すようにしてデバック
★symfonyの準備
[nishi@localhost ~]$ mkdir sftest
[nishi@localhost sftest]$ symfony -V
symfony version 1.0.20
[nishi@localhost sftest]$ symfony init-project sftest
>> dir+      /home/nishi/sftest/plugins
>> dir+      /home/nishi/sftest/apps
>> dir+      /home/nishi/sftest/config
>> file+     /home/nishi/sftest/config/properties.ini
>> file+     /home/nishi/sftest/config/schema.yml
>> file+     /home/nishi/sftest/config/config.php
>> file+     /home/nishi/sftest/config/propel.ini
>> file+     /home/nishi/sftest/config/databases.yml
>> file+     /home/nishi/sftest/config/rsync_exclude.txt
>> dir+      /home/nishi/sftest/batch
>> dir+      /home/nishi/sftest/web
>> dir+      /home/nishi/sftest/web/uploads
>> dir+      /home/nishi/sftest/web/uploads/assets
>> file+     /home/nishi/sftest/web/.htaccess
>> dir+      /home/nishi/sftest/web/js
>> dir+      /home/nishi/sftest/web/css
>> file+     /home/nishi/sftest/web/css/main.css
>> dir+      /home/nishi/sftest/web/images
>> file+     /home/nishi/sftest/web/robots.txt
>> file+     /home/nishi/sftest/symfony
>> dir+      /home/nishi/sftest/cache
>> dir+      /home/nishi/sftest/data
>> dir+      /home/nishi/sftest/data/model
>> dir+      /home/nishi/sftest/data/sql
>> dir+      /home/nishi/sftest/lib
>> dir+      /home/nishi/sftest/lib/model
>> dir+      /home/nishi/sftest/doc
>> dir+      /home/nishi/sftest/log
>> dir+      /home/nishi/sftest/test
>> dir+      /home/nishi/sftest/test/bootstrap
>> file+     /home/nishi/sftest/test/bootstrap/unit.php
>> file+     /home/nishi/sftest/test/bootstrap/functional.php
>> dir+      /home/nishi/sftest/test/unit
>> dir+      /home/nishi/sftest/test/functional
>> tokens    /home/nishi/sftest/config/properties.ini
>> tokens    /home/nishi/sftest/config/propel.ini
>> tokens    /home/nishi/sftest/config/propel.ini
>> tokens    /home/nishi/sftest/config/config.php
>> chmod 777 /home/nishi/sftest/cache
>> chmod 777 /home/nishi/sftest/log
>> chmod 777 /home/nishi/sftest/web/uploads
>> chmod 777 /home/nishi/sftest/symfony
>> chmod 777 web/uploads/assets
-----------------------------memo------------------------------


2012年4月25日水曜日

2012年04月25日 講義055日目

2012年04月25日
講義055日目
------------------------------1H------------------------------
★Firewallの設定
●最初に設定
・iptables -P INPUT ACCEPT
外部からのアクセスを許可
・iptables -P FORWARD DROP
次にデータを渡す
・iptables -P OUTPUT ACCEPT
外部にデータを渡す
・iptables -F
上のコマンドiptablesのルールの設定を反映させるためのコマンド
●icmp(ping) と自端末からの入力を許可
・iptables -A INPUT -p icmp -j ACCEPT

・iptables -A INPUT -i lo -j ACCEPT

●Web、FTP、POP、smtp による接続を許可
・iptables -A INPUT -p tcp --dport 80 -j ACCEPT

・iptables -A INPUT -p tcp --dport 21 -j ACCEPT

・iptables -A INPUT -p tcp --dport 110 -j ACCEPT

・iptables -A INPUT -p tcp --dport 25 -j ACCEPT

●ssh による接続を許可
・iptables -A INPUT -p tcp --dport 22 -j ACCEPT

●TCP の接続開始と応答、FTP データなどを許可
・iptables -A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT

●ルールをセーブする
・/etc/init.d/iptables save
●cat /etc/sysconfig/iptables
設定の確認
●reboot
再起動するコマンド
------------------------------2H------------------------------
★Firewallの設定
●SELinuxを停止させる
他のプロセスに影響を及ぼさないようにする機能
・vi /etc/sysconfig/selinux
SELINUX=enforcing
↓
SELINUX=disabled
書き換える
・reboot
再起動
●アパッチのインストール
・getenforce
先ほどの変更がdisableであることを確認
・yum -y install httpd
httpdはアパッチのこと
●eclipseでサーバにリモート接続する
ウィンドウ→パースペクティブを開く→その他→リモートシステムエクスプローラ
リモートシステムタブの空白を右クリック→新規接続
puttyの設定と同じように、ホスト名にサーバのIPアドレスを入力
接続先の名前を設定して完了
・パスワードやユーザ名の入力を求められるので、CentOSで入力したものを使う
------------------------------3H------------------------------
★各種アプリケーションのインストール
●apache
●mysql
●PHP
●vsftpd
●ntp
------------------------------4H------------------------------
★アプリケーションのインストール
●
・ランレベル
[root@localhost ~]# /sbin/chkconfig httpd on
[root@localhost ~]# /sbin/chkconfig --list httpd
httpd           0:off   1:off   2:on    3:on    4:on    5:on    6:off
0:off   1:off   2:on    3:on    4:on    5:on    6:off
●apacheの起動
☆apacheの設定ファイルを書き換えた後などにも「restart」で使う
[root@localhost ~]# /etc/init.d/httpd start
httpd を起動中:                                            [  OK  ]
☆再起動させたい場合は
/etc/init.d/httpd restart
●Mysqlの起動
マイコンピュータからローカル環境のmysqlのmy.iniの
default-character-set = utf8
skip-character-set-client-handshake
character-set-server = utf8
collation-server = utf8_general_ci
init-connect = SET NAMES utf8
をコピー
・vi /etc/my.cnf
を貼り付け
[mysqld]
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock
user=mysql
# Disabling symbolic-links is recommended to prevent assorted security risks
symbolic-links=0

default-character-set = utf8
skip-character-set-client-handshake
character-set-server = utf8
collation-server = utf8_general_ci
init-connect = SET NAMES utf8

# To enable the InnoDB Plugin, uncomment the 2 next lines
#ignore-builtin-innodb
#plugin-load=innodb=ha_innodb_plugin.so

# To enable InnoDB-related INFORMATION_SCHEMA tables
# Join the following options to above directive
  ;innodb_trx=ha_innodb_plugin.so
  ;innodb_locks=ha_innodb_plugin.so
・[mysqld_safe]の後に以下を書き込む
[client]
default-character-set = utf8
[mysql]
default-character-set = utf8
[mysqldump]
default-character-set = utf8
・自動起動設定
[root@localhost ~]# /sbin/chkconfig mysqld on
[root@localhost ~]# /sbin/chkconfig  --list mysqld
mysqld          0:off   1:off   2:on    3:on    4:on    5:on    6:off
[root@localhost ~]# /etc/init.d/mysqld start
------------------------------5H------------------------------
★アプリケーションのインストール
●コマンド入力でバージョンを確認
[root@localhost ~]# mysql -V
mysql  Ver 14.14 Distrib 5.1.58, for redhat-linux-gnu (i686) using readline 5.1
[root@localhost ~]# php -v
PHP 5.2.17 (cli) (built: Aug 31 2011 17:06:47)
Copyright (c) 1997-2010 The PHP Group
Zend Engine v2.2.0, Copyright (c) 1998-2010 Zend Technologies
[root@localhost ~]# symfony -V
symfony version 1.0.20
●vsftpの起動
・自動起動設定
[root@localhost ~]# /sbin/chkconfig vsftpd on
[root@localhost ~]# /sbin/chkconfig --list vsftpd
vsftpd          0:off   1:off   2:on    3:on    4:on    5:on    6:off
[root@localhost ~]# /etc/init.d/vsftpd start
vsftpd 用の vsftpd を起動中:   
●ntp  (時間合わせ)
/usr/sbin/ntpdate ntp.jst.mfeed.ad.jp
●FFFTPにサーバの登録
puttyを参考に
------------------------------6H------------------------------
★サーバでPHPファイルを実行
●phpファイルを実行
・コマンドラインから直接実行して確認
[nishi@localhost ~]$ /usr/bin/php ./test.php
test
●hostsの編集
・ブラウザから確認
・ローカル側の設定
firefoxのswitchhostでアドレス名とサーバIPアドレスを紐付ける
・サーバ側の設定
[root@localhost ~]# cd /etc/httpd/conf
[root@localhost conf]#
・/etc/httpd/conf.dにファイルを作成
[root@localhost httpd]# cd /etc/httpd/conf.d
[root@localhost conf.d]# vi httpd-vhost.conf

NameVirtualHost *:80

<VirtualHost *:80>
    ServerName www.shonanbbs.com
    DocumentRoot /home/nishi/bbs
    <Directory "/home/nishi/bbs">
        AllowOverride All
        Options -Include -ExecCGI
    </Directory>
</VirtualHost>
・再起動
[root@localhost conf.d]# /etc/init.d/httpd restart
httpd を停止中:                                            [  OK  ]
httpd を起動中: Warning: DocumentRoot [/home/nishi/bbs] does not exist
                                                           [  OK  ]
・eclipse上でbbsフォルダを作成
phpファイルを作成してhostsファイルで設定したサーバ名を入力し、
ブラウザから表示してみる
●mysqlのユーザを作る
・puttyでサーバのmysqlに接続
[root@localhost conf.d]# mysql -u root
・データベースを作成
mysql> create database study;
Query OK, 1 row affected (0.00 sec)
・ユーザ作成
mysql> GRANT ALL ON *.* TO nishi@"localhost" IDENTIFIED BY "password";
Query OK, 0 rows affected (0.01 sec)

-----------------------------memo------------------------------
サーバ面白い

2012年4月24日火曜日

2012年04月24日 講義054日目

2012年04月24日
講義054日目
------------------------------1H------------------------------
★Linuxコマンド
●
・ps -e
サーバのプロセスを表示
・kill
プロセスを殺すことができる
使い方に注意
●ユーザを作る
・who am i
自分がどのユーザでログインしてるか見ることができる
・root以外のユーザを作る
rootだと無制限に色々できてしまうので、制限されたユーザを作る
・ユーザを作ると/homeにフォルダができる
・useradd ユーザ名
ユーザを作成
・passwd ユーザ名
入力したユーザ名のパスワード
パスワード的に問題があるなど色々警告が出るが、入力は出来る
------------------------------2H------------------------------
★Linuxコマンド
●コマンド
・コマンドでディレクトリを作ってみる
shonanbbsディレクトリを作って、その中にindex.phpを作る
[nishi@localhost ~]$ touch shonanbbs/index.php
[nishi@localhost ~]$ ls
shonanbbs
[nishi@localhost ~]$ ls shonanbbs
index.php

・find ./ -name index.php
index.phpを探して、表示
./はどこから探したいか、現在位置を表す
-nameは名前で探すオプション
探し方はオプションで色々出来る
ワイルドカードでも探せる
・rootにあるインストールログを新たに作ったユーザのフォルダにコピー
[root@localhost ~]# cp install.log /home/nishi
[root@localhost ~]# cd /home/nishi
[root@localhost nishi]# ls
install.log  shonanbbs
・新たに作ったユーザ側のフォルダ内を確認
[nishi@localhost ~]$ ls -l
合計 40
-rw-r--r-- 1 root  root  27783  4月 24 03:32 install.log
drwxrwxr-x 2 nishi nishi  4096  4月 24 03:18 shonanbbs
コピーされたrootのファイルはユーザではいじる事が出来ない
・ユーザの設定
グループとユーザ
・chown
ファイルのオーナーを変更
root側で
[root@localhost nishi]# chown nishi:nishi /home/nishi/install.log
ユーザ側で確認
[nishi@localhost ~]$ ls -l
合計 40
-rw-r--r-- 1 nishi nishi 27783  4月 24 03:32 install.log
drwxrwxr-x 2 nishi nishi  4096  4月 24 03:18 shonanbbs
・grep
ファイルの中身を検索できる
2byte文字を検索したい場合は""で囲む
ctrl+cで入力したコマンドを止めることも出来るので挙動がおかしくなったら使う
・findとgrepは組み合わせて使うことが多い
[nishi@localhost ~]$ find -name install.log | xargs grep test
------------------------------3H------------------------------
★Linuxコマンド
●Vi操作
・Linuxのテキストエディタ
[nishi@localhost ~]$ vi config.inc.php
・iまたはa
テキスト入力モードに出来る
・Esc
コマンド入力モードに戻る
どちらのモードか分からなくなったらEscを押してコマンド入力モードに戻ればいい
・:w
保存する
・:q
終了する
・:wq
保存して終了
・:q!
保存せず終了
・h,j,k,l
↑,↓,←,→
puttyでは十字キーで移動可能だが、コマンド
・:set number,:set nu
行数を表示させる
・set nonu
行数を非表示にする
・shift+g(G)
最後の行へ移動
・数字を入力→shift+g(G)
数字の行へ移動
数字を押し間違えたらEscして再入力
・u
undoコマンド
・yy
ヤンク(コピー)
・p
ペースト
------------------------------4H------------------------------
★Linuxコマンド
●コマンド
・ln
シンボリックリンクを作成
ショートカットのようなもの
水色のファイルが作成される
・su
スイッチユーザ
suだけ打つとrootになれるが、rootに許された操作が使えない場合もある
[nishi@localhost ~]$ su root
パスワード:
[root@localhost nishi]#
exitを入力するとスイッチ前のユーザに戻る
ルートでなければ入力できないコマンドなどが拒絶される
その場合は
su -
で、rootにスイッチしてもコマンドなどが通るようになる
------------------------------5H------------------------------
★Linuxコマンド
●コマンド
・chmod
ファイルへの読み込み権限、書き込み権限などを変更する
[nishi@localhost ~]$ ls -l
合計 52
lrwxrwxrwx 1 nishi nishi    14  4月 24 06:22 conf -> config.inc.php
-rw-rw-r-- 1 nishi nishi   114  4月 24 05:39 config.inc.php
-rw-r--r-- 1 nishi nishi 27783  4月 24 03:32 install.log
drwxrwxr-x 2 nishi nishi  4096  4月 24 03:18 shonanbbs
↑--ココ--↑
書き込みの許可を表す
4 2 1
r w x
読み込み、書き込み、実行
-rwxrwxrwx
オーナー(u)、グループ(g)、その他(誰でも)(o)の順番
[nishi@localhost ~]$ chmod 777 config.inc.php
[nishi@localhost ~]$ ls -l
合計 52
lrwxrwxrwx 1 nishi nishi    14  4月 24 06:22 conf -> config.inc.php
-rwxrwxrwx 1 nishi nishi   114  4月 24 05:39 config.inc.php
-rw-r--r-- 1 nishi nishi 27783  4月 24 03:32 install.log
drwxrwxr-x 2 nishi nishi  4096  4月 24 03:18 shonanbbs
別の書き方も出来る
[nishi@localhost ~]$ chmod g-w config.inc.php
[nishi@localhost ~]$ ls -l
合計 52
lrwxrwxrwx 1 nishi nishi    14  4月 24 06:22 conf -> config.inc.php
-rwxr-xrwx 1 nishi nishi   114  4月 24 05:39 config.inc.php
-rw-r--r-- 1 nishi nishi 27783  4月 24 03:32 install.log
drwxrwxr-x 2 nishi nishi  4096  4月 24 03:18 shonanbbs
●シェルスクリプト
[nishi@localhost ~]$ vi datemake.sh
/bin/date >> /home/nishi/date.log
/bin/echo "command end."
・>>
上書き
------------------------------6H------------------------------
★Linuxコマンド
●シェルスクリプト
・シェルスクリプトの内容は行頭に#でコメントアウト出来る
・crontab
定期的に実行する期間と実行ファイルを指定できる
分  時  日  月  曜日  実行内容
10 17 25 4 0 /home/nishi/hoge.sh

全部の日時等を指定したい場合は「*」
10 17 * * * /home/nishi/hoge.sh

範囲指定「n-n」、毎時「n/*」指定もできる
10-20 */1 * * * /home/nishi/home.sh
一時間ごとに。10分~20分の間で
●bash
シェルからカーネルへ渡す時に動いてくれる機能
・view
読み込み
!をつけると書き込める
[root@localhost nishi]# view /home/nishi/date.log

・xargs
それまでの出力結果を次のコマンドの引数とする
[nishi@localhost ~]$ ls
conf  config.inc.php  date.log  datemake.sh  install.log  shonanbbs
[nishi@localhost ~]$ wc config.inc.php
  8   7 114 config.inc.php
[nishi@localhost ~]$ ls | wc
      6       6      63
     
[nishi@localhost ~]$ ls | xargs wc
      8       7     114 conf
      8       7     114 config.inc.php
     59     246    1363 date.log
      2       8      83 datemake.sh
    554    1116   27783 install.log
wc: shonanbbs: ディレクトリです
      0       0       0 shonanbbs
    631    1384   29457 合計
lsの結果をwcに送ることで各ファイルの情報を取得できた
・du
ファイルの容量を表示する
[nishi@localhost ~]$ du ./
8       ./.mozilla/plugins
8       ./.mozilla/extensions
24      ./.mozilla
12      ./shonanbbs
140     ./
・man
オプションでコマンドを指定する(man cd)
ヘルプを出してくれる
qで戻る
・help
コマンド別にヘルプを出す
-----------------------------memo------------------------------
linuxは楽しいかも