全文検索:
- tar @02_freebsd:80_unixコマンド
- トリ以下のファイルをフロッピーディスク(/dev/fd0)にアーカイブする ==== <code console> # cd /etc # tar cf /dev/fd0 ./*\ </code> ==== アーカイブ内のファイル名を表示する ==== <code console> # tar tf /dev/fd0 |head etc/X11/ etc/aliases ... /code> ==== アーカイブ内のファイル名とファイル属性を表示する ==== <code console> root@vaio# tar tfv /dev/fd0 |head drwxr-xr-x r... gin </code> ==== アーカイブデータからファイルを取り出す ==== <code console> # tar xf /dev/fd0 </code> ==== 特定フォルダを除外する ===
- MySQLコマンド @02_freebsd:04_database:01_mysql
- ==== ===== ①ユーザ関係 ===== ==== ユーザの確認 ==== <code console> mysql> select host,user,password,Grant_priv from... n set (0.00 sec) </code> ==== 権限の確認 ==== <code console> mysql> SHOW GRANTS FOR testdb_user@localhost; +-... stデータベースに対して全ての権限を持ったmatsuiユーザ作成、パスワードはpass <code console> mysql> grant all privileges on test.* to matsu... 'pass'; </code> === ユーザ追加(ユーザ作成権限付き) === <code console> mysql> grant all privileges on test.* to matsu
- sed @02_freebsd:80_unixコマンド
- ^]が行頭の意味[$]が行末の意味 つまり行頭からいきなり行末の行を削除するという意味 <code console> $ cat test.txt -------------------------------... -- </code> ==== week.txtの1から5行目を削除する。 ==== <code console> $ cat week.txt -------------------------------... ------------- </code> === penを山本に置換する。 === <code console> $ cat test.txt -------------------------------... ---- </code> ==== 改行文字も含めて挿入(置換)する方法。 ==== <code console> $ cat test.txt -------------------------------
- fgとbg @02_freebsd:80_unixコマンド
- たコマンドがバックグラウンドで実行再開されます。 ===== コマンド例 ===== <code console> $ jobs バックグラウンド実行され
- ifconfig @02_freebsd:80_unixコマンド
- seT/UTP </code> ===== eth0にIPを設定する ===== <code console> # ifconfig eth0 10.15.201.201 netmask 255.255.0.
- Bonnie++ @02_freebsd:08_benchmarks
- Bonnie++ で I/O 性能を測定 ====== インストール ====== <code console> # cd /usr/ports/benchmarks/bonnie++/ # make cl... # make install </code> ====== 実行 ====== <code console> $ bonnie++ -d /var/tmp/ Writing a byte at a ti
- MySQL - シェルで枠まで出力する @02_freebsd:04_database:01_mysql
- MySQL - シェルで枠まで出力する ====== 下記のようなテーブルがある <code console> # mysql -u root testdb -e 'select * from table1'... </code> リダイレクトしたり、パイプでつなげたりすると枠は消えてしまいます。 <code console> # mysql -u root testdb -e 'select * from table1... にこの枠も欲しい場合がある。 「--table」を付けると枠も一緒に出力してくれます。 <code console> # mysql -u root testdb --table -e 'select * from
- 20 wait_timeoutとthread_cache_size @02_freebsd:04_database:01_mysql
- === デフォルトでは、MySQL側でconnectionを8時間保持し続けます。 <code console> mysql> show global variables like 'wait_timeout'
- ps @02_freebsd:80_unixコマンド
- グラウンドのプロセスグループに含まれている| ====== コマンド例 ====== <code console> > ps 自分が起動したプロセスのみが表示する。 PI... === プロセスの起動時間も確認 === こうすると、プロセスの起動時間を確認できる <code console> # ps ax -o pid,lstart,cmd | grep sshd 5875 Thu ... 6 08:33:05 2013 sshd: root@pts/41 </code> <code console> # ps axwf -o user,pid,pmem,pcpu,state,lstart,cmd
- MySQL - slow log @02_freebsd:04_database:01_mysql
- meで指定)なのでそのクエリを見直す。 これで動いてるプロセスを見ることもできる。 <code console> mysql > show full processlist; mysql> SHOW PROCE... OCESSLIST; </code> 以下がイコールなので、下だとwhereが使える <code console> mysql> SELECT * FROM information_schema.PROCESSL
- PostgreSQLインストール @02_freebsd:04_database:02_posgresql
- ==== server からインストールしようとしても、client からインストール <code console> # cd /usr/ports/databases/postgresql81-client ... *** Error code 1 ====== ソースからインストール ====== <code console> # wget ftp://ftp.sra.co.jp/pub/cmd/postgres/8.3... nstall </code> ====== postgresユーザ作成 ====== <code console> # pw groupadd postgres # pw useradd postgres -... or: readline library not found これでインストールできる <code console> # yum install readline-devel </code> ====== /e
- find @02_freebsd:80_unixコマンド
- ド例 ===== ■./以下から30日以上前に更新されたpng形式のファイルを検索する <code console> $ find ./ -name "*.png" -atime +30 </code> ■./以下でユーザーmatuiのファイルを検索し削除する。 <code console> $ find ./ -user matsui -exec rm -rf {} \; </code> ■./以下でファイルサイズが10M以上のものを表示。 <code console> $ find ./ -size +10000k -exec ls -ahl {} \; -r... p_JP.exe </code> ■ /var/log以下で1M以上のファイルを検索 <code console> $ find /var/log/ -size +1000k -exec ls -ahl {}
- file @02_freebsd:80_unixコマンド
- 構文 ===== file ファイル名 ===== コマンド例 ===== <code console> > file /etc/hosts /etc/hostsを調べる
- htpasswd @02_freebsd:80_unixコマンド
- ==== パスワードファイルを新規に作成、ユーザ名(matsui)を追加 ==== <code console> # htpaawd -c /etc/access.htpasswd matsui New pas... d for user matsui </code> ==== ユーザの追加 ==== <code console> # htpaawd /etc/access.htpasswd hgoehoge New pass... for user hogehoge </code> ==== ユーザの削除 ==== <code console> # htpasswd -D /etc/access.htpasswd matsui Deleti
- lsでタイムスタンプを秒まで表示 @02_freebsd:80_unixコマンド
- ====== lsでタイムスタンプを秒まで表示 ====== <code console> $ ls --full-time syslog.bak -rw-r--r-- 1 matsui users 49397... 最終ステータス変更時刻 (change time) | === mtime === <code console> $ ls -l --full-time syslog.bak -rw-r--r-- 1 mat... 000 +0900 syslog.bak </code> === ctime === <code console> $ ls -lc --full-time syslog.bak -rw-r--r-- 1 ma... 000 +0900 syslog.bak </code> === atime === <code console> $ ls -lu --full-time syslog.bak -rw-r--r-- 1 ma