文書 | |
---|---|
.txt | 平文(plain)のテキスト |
.html | ハイパーテキスト(HTML) |
.tex | TeX形式の文書 |
アーカイブ | |
.tar | UNIXのtarコマンドによってまとめたファイル |
圧縮ファイル | |
.Z | UNIXのcompressコマンドによる圧縮ファイル |
.gz | GNUのgzipコマンドによる圧縮ファイル |
画像ファイル | |
.gif | Graphics Interchange Format (GIF) 形式の画像ファイル |
.jpg | JPEG 形式の画像ファイル |
.ps | PostScript 形式の(プリンタ用)ファイル |
プログラム・スクリプトファイル | |
.c | C言語のソースファイル |
.h | C言語のヘッダファイル |
.py | Python言語のソースファイル |
.awk | awk スクリプトファイル |
.sh | sh スクリプトファイル |
.csh | csh スクリプトファイル |
.cgi | Web CGI ファイル |
/ --- (ルート) +- bin +- usr -+- bin | +- include | +- lib | +- ... +- home -+- user1 +- user2 -+- myfile +- mydir - myfile2
現在位置を知るコマンド ... pwd |
カレントディレクトリを変更するコマンド ... cd | |
一般形 ... cd ディレクトリへのパス | |
使用例 | 説明 |
---|---|
cd / | ルートディレクトリへ移動 |
cd .. | ひとつ上のディレクトリへ移動 |
cd | ホームディレクトリへ移動 |
cd tx302 | tx302 というディレクトリへ移動 |
cd /home/tkikuchi/tx302 | /home/tkikuchi/tx302 というディレクトリへ移動 |
ディレクトリの中にどんなファイルがあるかを知るコマンド ... ls |
一般形 ... ls ディレクトリへのパス |
使用例 |
---|
tkikuchi@tws% cd tkikuchi@tws% cd tx302 tkikuchi@tws% ls tx.scr tx.usr tkikuchi@tws% ls -al 合計 14 drwxr-xr-x 2 tkikuchi isstaff 512 10月 8日 10:51 . drwxr-xr-x 33 tkikuchi isstaff 1536 11月 4日 09:43 .. -r--r--r-- 1 tkikuchi isstaff 2299 10月 21日 15:40 tx.scr -r--r--r-- 1 tkikuchi isstaff 160 10月 21日 15:43 tx.usr tkikuchi@tws% cd tkikuchi@tws% ls .netscape archive key3.db proxyconf bookmarks.html liprefs.js registry ... |
ディレクトリを作成するコマンド ... mkdir |
一般形 ... mkdir 新しいディレクトリ名 |
注意 ... 既に同じ名前のディレクトリがある場合はエラーになる。 |
ディレクトリを削除するコマンド ... rmdir |
一般形 ... rmdir 空のディレクトリ |
注意 ... ディレクトリが空でない場合はエラーになる。 |
ファイルを削除するコマンド ... rm |
一般形 ... rm ファイル名 |
touchコマンドを使う |
touch はファイルを「触る」つまり、 1. ファイルが無ければ空のファイルを作成する 2. ファイルが既にあれば、作成時刻を更新する |
>で標準出力をファイルにリダイレクトする |
標準出力は通常ディスプレイ(端末エミュレータ)へ出力される 例: tkikuchi@tws% echo "Hi, Computer." Hi, Computer. |
tkikuchi@tws% cd tkikuchi@tws% mkdir coreinfo tkikuchi@tws% cd coreinfo tkikuchi@tws% touch myfile tkikuchi@tws% ls -l 合計 0 -rw-r--r-- 1 tkikuchi isstaff 0 11月 4日 13:43 myfile tkikuchi@tws% echo "Hi, Computer." > computer tkikuchi@tws% ls -l 合計 2 -rw-r--r-- 1 tkikuchi isstaff 14 11月 4日 13:46 computer -rw-r--r-- 1 tkikuchi isstaff 0 11月 4日 13:43 myfile tkikuchi@tws% touch computer tkikuchi@tws% ls -l 合計 2 -rw-r--r-- 1 tkikuchi isstaff 14 11月 4日 13:47 computer -rw-r--r-- 1 tkikuchi isstaff 0 11月 4日 13:43 myfile |
catコマンドを使う |
tkikuchi@tws% cat computer Hi, Computer. |
moreコマンドを使う |
スペースキーを使って1画面分ずつ表示する |
tkikuchi@tws% more /usr/include/sys/param.h /* * Copyright (c) 1986-1999 by Sun Microsystems, Inc. * All rights reserved. */ .... -- 継続 --(6%) |
tkikuchi@tws% cat > intro Hi, Computer! My name is Tokio Kikuchi. ^D |
tkikuchi@tws% dtpad intro & |
Hello, Computer! My name is My_Name. Nice to meet you. |
<a href="http://www.is.kochi-u.ac.jp/~tkikuchi/>菊地のホームページ