Linux note

Structure of directory

/ -- bin (システム標準のコマンド)
     boot (bootに必要なファイル)
     dev (デバイス用のファイル)
     etc (システム用の設定ファイル) -- rc.d (初期化スクリプト)
     home (ユーザー用のディレクトリ) -- max
     lib (共有ライブラリ)
     lost+found (破損ファイルなど)
     misc (サンプルファイルなど)
     mnt (マウントポイント) -- mac
     opt (?)
     proc (カーネル検査用ファイル)
     root (root用のディレクトリ)
     sbin (システム管理用コマンド)
     tmp (テンポラリーファイル)
     usr (ユーザー用のディレクトリ) 
         -- X11R6 (X window用のディレクトリ)
            bin (システム標準のコマンド)
	    dict (?)
	    doc (ドキュメントファイル用のディレクトリ)
	    etc (設定ファイル)
	    games (ゲーム用ディレクトリ)
	    include (ヘッダファイル)
	    lib (共有ライブラリ)
	    libexec (?)
	    local (ユーザー用のディレクトリ)
	          -- bin (システム標準ではないコマンド)
		     doc (システム標準ではないドキュメント)
		     etc (システム標準ではない設定)
		     games (システム標準ではないゲーム)
		     info (?)
		     lib (システム標準ではないライブラリ)
		     man (システム標準ではないマニュアル)
		     sbin (システム標準ではない管理用コマンド)
		     src (システム標準ではないカーネルやアプリケーションのソースファイル)
	    man (オンラインマニュアル)
	    ppc-redhat-linux (?)
	    sbin (管理用コマンド)
	    share (機種に依存しないファイル)
	    src (カーネルやアプリケーションのソースファイル)
	    vine (?)
     var (ログファイルなど)

Special Key assignment

control + C:処理を停止する
control + S:画面出力を停止する
control + Q:画面出力を再開する
   (control + S で停止したものは contorol + Q でないと再開できない。)
control + Z:処理を一時中断する or バックグラウンドに回す
   control + Z で停止した後、
   $ bg
   とタイプすることよって実行中のプロセスを
   バックグラウンドに回すことが出来る。フォアグラウンドに戻すには、
   $ fg %ジョブ番号
   とする。
control + D:入力を終了する
control + L:画面をクリアする ($ clearと同様)

Edit command line

control + A:行の先頭へ
control + E:行の最後へ
control + K:カーソル位置から行末まで削除
control + U:行頭からカーソル直前まで削除

command + B:カーソルを一単語前へ
command + F:カーソルを一単語後ろへ

Regular expression in command line

c.f.
Regular Expression
* (wild card)
 空文字を含めた任意の文字列に対応する。
 e.g. test* => test2, test, or test.txt

?
 任意の一文字と対応。
 e.g. test? => test1, test6, or testt

[ ]
 [ ]内のいずれかの一文字と対応。
 e.g. test[abc] => testa, testb, or testc
      test[a-z] => testa, ... testh, ... testz

{ }
 { }内のいずれかの文字列と対応。文字列は","で区切る。
 e.g. test{ab, cd, ef} => testab, testcd, or testef

Permission

  user group others
-  rwx  rwx   rwx
read:読み出し可能 = 4

wright:書き込み可能 = 2

execute:実行可能 = 1

Mount HFS volume

$ su
# mount -t hfs /dev/hda9 /mnt/mac

→現在は/etc/fstabで、起動時に自動的にmountするように指定してある

How to use LaTeX

Create TeX file by text editor. (e.g. xxx.tex)

Compile

$ latex filename.tex    (English version)
$ platex filename.tex   (Japanese version)
Check dvi file
$ xdvi filename.dvi
Create ps file
$ dvi2ps filename.dvi
         OR
$ dvips -o filename.ps filename.dvi
Check ps file
$ gv filename.ps
Print out
$ lpr -Pprintername filename.ps

misc

setting for prompt(bash)
   /etc/bashrcのPS1を調整
   なぜか
   $ PS1='hogehoge'
   ではうまくいかない。

alt key = command key

Mac-on-Linux
  $su
  #startmol

windowの切替え
 次のwindow:  control + ↑
 前のwindow:  control + ↓
 windowの循環:  control + space

workspaceの切替え
 右のworkspace:  control + →
 左のworkspace:  control + ←

  *window / workspaceの切替えの設定
   GNOME control center → Sawmillウィンドウマネージャー 
   → ショートカット

$ stands for prompt for bash.
% stands for prompt for tcsh.
# stands for prompt for root.