Linux Commands


http://rusmafia.org/linux/files/images//l1048750857-81.jpg

General Linux Commands

20 Sep 2006, 12 Oct 2006, 17 Oct 2006, 6 Nov 2006, 11 Dec 2006, 7 Sep 2007, 19 Sep 2007, 15 Oct 2007, 16 Oct 2007, 23 Oct 2007, 1 Feb 2008

afx –e execute <name.afx>

After logging into an AFX machine, go into the routing_clock/AFX directory to execute this command. This will run the pattern on the AFX

ddd extract -command=debug.sh

to load many break points to ddd when ddd crashes, where “clock” is the name of the executable

df -h .

Show the quota for the current server, the dot. h is for the human readability

du -skh *

Show the size of the sub-folders, the star matches all folders, the h is for human readability, k will display things faster, s is for summary

find <path> < expression>
find <path> -name <filename>

File a filename(s) within a folder hierarchy recursively.

for ...., batch rename Batch rename. For example,
'for FILE in *.jpg ; do NEWFILE=`echo $FILE | sed 's/^/body_art_/g'` ; mv "$FILE" "$NEWFILE "; done'
'for FILE in *.gif ; do NEWFILE=`echo $FILE | sed 's/.gif/.jpg/g'` ; convert -thumbnail 50x50 "$FILE" "$NEWFILE"; done'
'for FILE in *.GIF ; do NEWFILE=`echo $FILE | sed 's/.GIF/.jpg/g'` ; convert -thumbnail 50x50 "$FILE" "$NEWFILE"; done'

groups <username>

List the groups the user belongs to. Sample command: "groups billh"

ipstat -a

Find all the printers connecting to you

id -a <username>

List all the groups a user belongs to. Sample command: "id -a billh"

kill <PID>

Kill a particular process. Sample command: "kill 71483"

killall <program name>

Kill all process that matches the program name. Sample Command "killall fpga_editor"

ldd <executable file>

List all the shared object (like DLL in win32), for a given executable file. sample command = "ldd $EZPATH/xfndry/env/routing/lin64/extract"

ls

List current directory content

ls –ltr

Display all info of the files in the directory

ls --color

Display the content of the current folder with color

ln -s <path> .

Create a link (shortcut) to the path in the current directory

netstat -a | more

Display all the applications that are using the internet

nm –C <object file> | grep <string>

nm –C libEzutil.so | grep mCreateNewDesign

List all the header information about an object file. –C will print out the header information in a more readable way. mCreateNewDesign is the function we are asking. Similar to objdump, but might not work for dll files.

objdump –C –x <object file> | grep <string>
objdump –C –x libEzutil.so | grep mCreateNewDesign

List all the header information about an object file. –C will print out the header information in a more readable way, –x means all header, libEzutil.so is a library object file, and mCreateNewDesign is the function we are asking. Similar to nm.

par -w (–r) <input file> -gf <input file> -gm exact <output file>

Run PAR (Place and Route), -r means NOT to route the signals

perl –d:ptkdb <perl_scrip_name> <arguments>

Display the Graphical Perl Debugger

printenv <environment variable>

Print the environment variable. sample: printenv XCS_SANDBOX

ps

Processes that are currently running. This function tells you the PID (Process ID?) of each process.

ps -afe

List all the process started by any users on the current server

ps -fp <PID>

Display the origin of a process. The origin could be from which VNC session. Sample command "ps -fp 14003"

rlogin –l <user_name> <server_name>

remote login to a server with a specific username. Sample command: "rlogin –l easypath seismic"

rsync -arun <source> <destination>

Dry run the synchronization from the source path to the destination path. Sample command: "rsync -arun /proj/ezpathxap2/user/billh/xroads/ ~billh/xroads". Notice, the trailing "/" for the source path is needed. See reference: http://www.mikerubel.org/computers/rsync_snapshots/#Rsync

rsync -aruv <source> <destination>

Synchronize from the source path to the destination path, under verbose mode. Sample command: "rsync -aruv /proj/ezpathxap2/user/billh/xroads/ ~billh/xroads". Notice, the trailing "/" for the source path is needed. See reference: http://www.mikerubel.org/computers/rsync_snapshots/#Rsync

sed -i s/<old>/<new>/ <file>

substitute the <old>  with the <new> on <file>. The -i means in place replacement, without -i, it will just print to the shell. A sample command is: "sed -i s/50000/500/ *s.s"

sed -i s:<old>:<new: <file>

Use colon instead of backslash for the sed command.  This avoids special characters issues. For example, sed -i s:localhost/:www.: sitemap.xml

setenv <variable> <value>

set the environment variable for the shell

tail –f <executable>

Display the end of some output from the executable

tkdiff <filename>

Compare the file with the file in the CVS repository

tkdiff –r <revision number> <filename>

To compare files in the previous version of CVS repository. You get the revision number of “xcs log”

top
top -all

List of process that are being run

trce -v <ncd_file> <pcf_file>

Command to run Trace, the timing analysis tool

xbld –t make.t.clock

Compile a special makefile, called make.t.clock

xcs add <filename>

Add a new file to the CVS repository

xcs anno <filename> Show who edited which line of the file last

xcs info –put clock.c –num=5

Display the put info of the past 5 xcs check-in

xcs log <filename>

Show all the revision info. With all the comments of the (xcs put) updates .

xcs get

Update the local file with the repository files, also check out new repository files

xcs get –revision=1.4 <filename>

Get an older version of the file from xcs

xcs update

Update local files from the repository. Do NOT check out new files.

xdl –ncd2xdl <ncd name>

Convert a I-based NCD file into ASCII

vncconfig –display <server>:<port_number> –D disconnectClient=false

Set the VNC so that you can have multiple people logged into the. Sample command: "vncconfig –display seismic:4 –D disconnectClient=false"

vncserver –kill tremor:21

Kill the VNC session of tremor:21. tremor:21 can be other-server-name:port-number

vncserver -name linux -depth 16 -cc 3 -geometry 1400x1050

Start VNC with all the parameters

 

VI Colon Commands

30 May 2008

:q, quite

:w, write

:set number, display line number

:set ic, ignore case

Customize emacs indentation

15 May 2008

How to customize indentation in C, C++, and Java buffers?
=========================================================

   The Emacs `cc-mode' features an interactive procedure for
customizing the indentation style, which is fully explained in the `CC
Mode' manual that is part of the Emacs distribution, see *Note
Customization Indentation: (ccmode)Customizing Indentation.  Here's a
short summary of the procedure:

  1. Go to the beginning of the first line where you don't like the
     indentation and type `C-c C-o'.  Emacs will prompt you for the
     syntactic symbol; type <RET> to accept the default it suggests.

  2. Emacs now prompts for the offset of this syntactic symbol, showing
     the default (the current definition) inside parentheses.  You can
     choose one of these:

    `0'
          No extra indentation.

    `+'
          Indent one basic offset.

    `-'
          Outdent one basic offset.

    `++'
          Indent two basic offsets

    `--'
          Outdent two basic offsets.

    `*'
          Indent half basic offset.

    `/'
          Outdent half basic offset.

  3. After choosing one of these symbols, type `C-c C-q' to reindent
     the line or the block according to what you just specified.

  4. If you don't like the result, go back to step 1.  Otherwise, add
     the following line to your `.emacs':

          (c-set-offset 'SYNTACTIC-SYMBOL OFFSET)

     where SYNTACTIC-SYMBOL is the name Emacs shows in the minibuffer
     when you type `C-c C-o' at the beginning of the line, and OFFSET
     is one of the indentation symbols listed above (`+', `/', `0',
     etc.) that you've chosen during the interactive procedure.

  5. Go to the next line whose indentation is not to your liking and
     repeat the process there.

   It is recommended to put all the resulting `(c-set-offset ...)'
customizations inside a C mode hook, like this:

     (defun my-c-mode-hook ()
       (c-set-offset ...)
       (c-set-offset ...))
     (add-hook 'c-mode-hook 'my-c-mode-hook)

Using `c-mode-hook' avoids the need to put a `(require 'cc-mode)' into
your `.emacs' file, because `c-set-offset' might be unavailable when
`cc-mode' is not loaded.

   Note that `c-mode-hook' runs for C source files only; use
`c++-mode-hook' for C++ sources, `java-mode-hook' for Java sources,
etc.  If you want the same customizations to be in effect in _all_
languages supported by `cc-mode', use `c-mode-common-hook'.
 

Make emacs indent code with 2 spaces instead of tabs

15 May 2008
(setq c-mode-hook
(function (lambda ()
(setq indent-tabs-mode nil)
(setq c-indent-level 2))))
(setq c++-mode-hook
(function (lambda ()
(setq indent-tabs-mode nil)
(setq c-indent-level 2))))

GDB Commands

20 Apr 2008

 

b <source-file-name>:<line-number> break at certain file and certain line, for example, "b extractor.c:100"
ba backtrace
i b info break point, list all the current breakpoints
p <variable> print <variable>, display the value of certain variable. For example, "p i"
r restart
up after "where", we can up the frames by "up"
where backtrace

VI Repeat 100 Times Command

18 Mar 2008

yy <number> p, for example "yy 100 p" with repeat the current line 100 times

Useful Windows Script commands

6 Feb 2008

for i in *.JPG;
do mv $i ${i%%.JPG}.jpg;
done

http://linux.die.net/Linux-CLI/mass-rename.html

 

Perl search and replace text

To search and replace text in a file is to use the following one-line Perl command[1]:

$ perl -pi -e "s/oldstring/newstring/g;" filespec [RET]

In this example, "oldstring" is the string to search, "newstring" is the string to replace it with, and "filespec" is the name of the file or files to work on. You can use this for more than one file.

Example: To replace the string "helpless" with the string "helpful" in all files in the current directory, type:

$ perl -pi -e "s/helpless/helpful/g;" * [RET]

Also try using tr to do the same thing (see further above in th



--
Bill Hung

Basic VI Commands

8 Jan 2008

Editing a file called xxxx vi xxxx
Display file xx using vi editor in read only mode view xx
Enter Command mode (use before all commands) ESC
Quit discarding any changes :q!
Quit saving changes :wq!
Repeat last command .
Display line numbers to assist debugging error messages like “error in line 688” :set number
Undo the last command u (lower case)
 

[Edit section] Basic vi Navigation

Up k
Down j
Left h
Right l
Forward one page CNTL f
Backward one page CNTL b
Move forward to end of file G
Move forward to line nnn e.g. 1G moves to beginning of file nnnG
Move to beginning of current line 0 (number zero)
Move to end of current line $
 

[Edit section] Inserting, Editing, Changing

Move to end of current line and insert A
Insert text before the cursor i
Append text after the cursor a
Insert a new line below cursor o (Letter o )
Replace some text R
Replace a single character r
Replace a word (text up to space / , . etc) cw
Delete character at cursor x
Delete to end of line D
Undo changes to the line U (upper case)
Insert a new line before cursor O (Capital letter O )
 

[Edit section] Deletion, Copy, Pasting

Delete whole line dd
Delete 4 lines 4dd
Copy whole line yy
Copy 5 lines 5yy
Paste copied or deleted lines below cursor p
Paste copied or deleted lines above cursor P
 

[Edit section] Search and Replace

Search forward for text / text
Search backward for text ? text
Repeat search for last search argument n
Replace the text “old” with the text “new” on current line :s/old/new/
Replace the text “old trunk” with the text “new tuff” in entire document :%s/old trunk/new tuff/g
Replace text in entire document confirming replacement :%s/old jeans/new cords/gc
 

[Edit section] Display Configuration

The .vimrc file is the configuration file for the vim editor which is read every time the editor starts. This file is located in the user's home directory. vim is a modern variant of vi. the .exrc file is also valid and will be read by most vi clones as well as the original variant vi.

The following lines can be added for respective configurations to take effect:

  • set background=dark : Font colors ajusted for dark background
  • set shiftwidth=n : Sets the tab stops to every n characters
  • set expandtab : Expands tabs to spaces

[Edit section] VI Variants

  • ex
  • lemmy
  • vim
  • elvis
  • nvi
  • stevie
  • gvim
  • macvim
  • Vile (an acronym which stands for "VI Like Emacs" and featured in Chapter 12 of the O'Reilly book "Learning the vi Editor")

 

Konsole Tricks

7 Dec 2007

  1. If you right-click the tool bar of Konsole, and select Text Position->Text Only, you will be able to change the name of the Shell by pressing Ctrl+Alt+S.
  2. Furthermore, you can press Shift+Arrow keys to switch between Sessions
  3. Also, you can press Ctrl+Shift+Arrow to change the order of your Sessions.

 

Emacs Command Reference

15 Nov 2007

Source: http://www.magic.mediawars.ne.jp/tips/emacs_key.html

 

Emacs操 作キー一覧
C-a:Ctrl+a
M-a:Meta+a

機能

コマンド

操作キャンセル

C-g

抜けだし

M-x ESC ESC ESC

カーソル移動

左へ移動

C-b

下へ移動

C-n

上へ移動

C-p

右へ移動

C-f

行頭へ移動

C-a

行末へ移動

C-e

1単語右へ移動

M-f

1単語左へ移動

M-b

1画面進む

C-v

1画面戻る

M-v

指定行へ移動

M-x goto-line Enter

数値指定(例:5行下へ移動)

C-u 5 C-n

カーソル位置とマーク位置の 入替え

C-x C-x

直前のマークへ移動

C-u C-スペース

削除

カーソルの左の1文字削除

Del

カーソルのある1文字削除

C-d

カーソル位置から単語頭まで 削除

M-Del

カーソル位置から単語末尾ま で削除

M-d

カーソル位置から行末まで削 除

C-k

カット&ペースト、アンドゥ

カーソル位置にマーク

C-スペース

カーソル位置から行末まで カット

C-k

リージョンをカット

C-w

リージョンをコピー

M-w

ペースト

C-y

履歴ペースト

C-y後に、M-y 押すたびに過去履歴参照

バッファ全体をリージョン

C-x h

アンドゥ

C-x u

連続アンドゥ

C-_

名前付きバッファにコピー

C-x x name nameは一文字

名前付きバッファのペースト

C-x g name

矩形コピー

C-x r k

矩形ペースト

C-x r y

編集

前文字と入れ替え

C-t

後単語と入れ替え

M-t

前行と入れ替え

C-x C-t

大文字変換

M-c

カーソル位置から単語末尾ま で大文字変換

M-u

カーソル位置から単語末尾ま で小文字変換

M-l

マークを付けた行から現在の 行までの先頭にスペースを挿入する

C-x C-i

リージョンをコメントアウト

M-x comment-region

リージョンのコメントアウト 解除

C-u M-x comment-region

略語展開

M-/ バッファ内の単語と比較し て補完

スペースとTABを一つにまとめる

M-スペース

ファイル操作

ファイル読み込み

C-x C-f

別ウィンドウにファイル読み 込み

C-x 4 C-f

上書き保存

C-x C-s

指定ファイルに保存

C-x C-w

全バッファを保存(確認有 り)

C-x s

ファイル挿入

C-x i

編集途中のファイル復帰

M-x recover file

終了

一時中断

C-z 復帰はシェルからfg

強制終了

C-x C-c

画面移動

一画面分進む

C-v

一画面分戻る

M-v

左スクロール

C-x <

右スクロール

C-x >

ファイルの先頭へ

M-<

ファイルの最後へ

M->

ウインドウ操作

縦に2分割

C-x 2

横に2分割

C-x 3

別のウィンドウを消す

C-x 1

カーソルのあるウィンドウを 消す

C-x 0

ウィンドウ間でカーソル移動

C-x o

バッファのリスト

C-x C-b

直前のウィンドウへ

C-x b

指定バッファへ

C-x b バッファ名

ウィンドウ削除

C-x k

指定バッファ削除

C-x k バッファ名

バッファとウィンドウ削除

C-x 4 0

別ウィンドウスクロール

C-M-v もしくは、ESC C-v

ウィンドウを縦方向に拡大

C-x ^

ウィンドウを縦方向に縮小

M-x shrink-window

検索

インクリメンタル検索

C-s  C-sで次の候補を検索(Delで一つ前候補)

逆インクリメンタル検索

C-r  C-rで次の候補を検索(Delで一つ前候補)

文字列検索

C-s Esc 文字列

逆文字列検索

C-r Esc 文字列

置換

カーソル以降置換

M-x replace-string

カーソル以降置換(正規表 現)

M-x replace-regexp

カーソル以降置換(確認)

M-x query-replace

カーソル以降置換(正規表 現:確認)

M-x query-regexp

ブックマーク

ブックマーク登録

C-x r m

ブックマークへ移動

C-x r b

ブックマーク一覧

C-x r l n,pで上下、fで移動

その他

シェル

M-x term バッファ切り替え は、C-c C-x o
M-x shell

マニュアル

M-x man

telnet

M-x telnet

ftp

M-x ftp

マージン設定(例:70文字)

C-u 70 C-x f 現在のパラグラフに設定す るには、M-q

モード切替

M-x モード名(fundamental-modetext-modec-modec++-mode perl-modecperl-mode等)

文字コード切り替え

C-x f Enter 文字コード(sjiseuc-jp-unix

 

 


ディレクトリエディタ
 

機能

コマンド

起動

C-x d 別ウィンドウに開くには、C-x 4 d

移動

次の行へ

n, Space

前の行へ

p

削除

削除フラグを付ける

d

削除フラグを消す

u

削除フラグのついたファイル を実際に削除

x

削除フラグ一括付与

##のような自動保存ファイル

#

~の付いたバックアップファイ ル

~

番号付きバックアップファイ ル

.

正規表現REGEXPに一致するファイル

% d REGEXP

訪問

ファイルを開く

f, Enter 別ウィンドウに開くには、o 別ウィンドウに開くが選択 しない、C-o

ファイル閲覧

v

カレントファイル

m, * m

実行ファイル

* *

シンボリックリンク

* @

ディレクトリ(...以外)

* /

現在のサブディレクトリ内の ディレクトリ(...以外)

* s

正規表現REGEXPに一致するファイル

* % REGEXP もしくは、% m REGEXP

ファイル内容がREGEXPに一致するファイル

% g REGEXP

印を削除

u, * u

ポイントを前の行に移動しな がら印を削除

Del, * Del

全ファイルの印削除

!

全ての印の入れ替え

* t

印付きの次のファイルへ移動

* C-n

印付きの前のファイルへ移動

* C-p

diredウィンドウへのアンドゥ

C-_

ファイル操作

コピー

C NEW

削除

D

ファイル名変更

R NEW

ハードリンク作成

H NEW

シンボリックリンク作成

S NEW

モード変更

M MODESPEC

グループ変更

G NEWGROUP

所有者変更

O NEWOWNER

印刷

P COMMANDW COMMAND lpr-command lpr-swithches から候補を表示

圧縮

Z

Emacs Lispロード

L

Emacs Lispバイトコンパイル

BW

正規表現REGEXPに一致するものを検索

A REGEXP

正規表現で置換

Q REGEXP_FROM Enter REGEXP_TO Enter

シェルコマンド

シェルコマンドを指定ファイ ルに実行

!

ファイル名変換

選択ファイル名を大文字

% u

選択ファイル名を小文字

% l

正規表現でファイル名変更

% R REGEXP_FROM Enter REGEXP_TO Enter

正規表現でコピー

% C REGEXP_FROM Enter REGEXP_TO Enter

正規表現でハードリンク作成

% H REGEXP_FROM Enter REGEXP_TO Enter

正規表現でシンボリックリン ク作成

% S REGEXP_FROM Enter REGEXP_TO Enter

ファイル比較

現在行とマーク位置のファイ ル比較

=

現在行とそのバックアップの ファイル比較

M-=

バッファ更新

バッファ全体更新

g

指定ファイル更新

l

表示行削除

k

アルファベット順/時間順の切り替え

s

SWITHESで表示切り替え

C-u s SWITHES

 

 


w3m_el
 

機能

コマンド

起動

M-x w3m

移動

次ページ

スペース

前ページ

b

右スクロール

> 

左スクロール

< 

次リンク

TAB

前リンク

ESC TAB

ハイパーリンク

リンクを読み込む

Enter

リンクを保存

a

リンクのURLを表示

u

URL風の文字列をリンクにする

:

現在のURL表示

c

現在の文書情報表示

=

○URLとファイル

URL指定

U

ファイル指定

V

コマンドを実行し,結果を全 部読んでから表示

@

コマンドを実行し,結果を読 みこみながら表示

#

バッファ

現在バッファを削除し、戻る

B

htmlソース表示

\

バッファ選択

s

編集(ローカルファイルの み)

E

再描画

C-l

ブックマーク

読み込み

v

登録

a

 

 


Wanderlust
 

機能

コマンド

起動

M-x wl

メール作成

新規メール作成

w

シグネチャ挿入

C-c C-w

メール送信

C-c C-c

メール破棄

C-x C-k

メール返信

a A(引用付き)

メール受信

メール受信

s

メール読む

スペース(下へ) Del(上へ)

戻る

v(サマリモード) q(フォルダモード)

文字化け対策

M

メール整理

削除マーク

d

整理実行(削除、移 動)

x

メール削除(完全削除)

E

メール移動

o

フォルダ

フォルダ作成

m a

フォルダ カット

C-k

フォルダ ペースト

C-y

フォルダ コピー

M-c

フォルダ削除

m d

 

 


irchat-j
 

機能

コマンド

起動

M-x irchat

チャンネル

参加

C-c j

切り替え

C-c 数字

直前のチャンネル

C-c C-a

次のチャンネル

C-c >

前のチャンネル

C-c <

抜け

C-c C-p

終了

C-c q  メッセージ付きC-u C-c q

チャット

プライベート

C-cm 相手 文章  ずっと話す 場合:C-c j 相手

人一覧

C-c C-n C-c w  指定チャンネルC-u C-c C-n

情報表示

C-c f

会話があるとbeep

C-c B

トピック

C-c t

招待

C-c i  チャンネル指定C-u C-c i

蹴る

C-c C-k  メッセージ付きC-u C-c C-k

モード表示

C-c Enter  チャンネル指定C-u C-c Enter

ユーザ数、トピック表示

C-c l  チャンネル指定C-u C-c l

ニックネーム変更

C-c n

再描画

C-c r  チャンネル別C-c C-l

画面

スクロール停止・自動スク ロール

C-c C-f

スクロール

C-c スペース

逆スクロール

C-c Del

分割(トグル)

C-c C-o

メッセージ

貼り付け

C-c C-y

コマンド結果

C-c !

○CTCP

delay

C-c P  個人宛C-c C-c p

時間

C-c T  個人宛C-c C-c t

クライアントバージョ ン

C-c V  個人宛C-c C-c v

ユーザ情報

C-c U  個人宛C-c C-c u

ファイル

送信

C-c C-d s

受信

C-c C-d g

中断、拒否

C-c C-d k

受信リスト

C-c C-d l

その他

IRCコマンド

C-c /

ユーザ無視

C-c TAB

 

 


.emacs設定例
 

;; 入力補完
(global-set-key "\C-j" 'dabbrev-expand)
 
;; BSキーで削除
;(load-library "term/bobcat")
;(define-key function-key-map [delete] [8])
(global-set-key "\C-h" 'backward-delete-char)
 
;; 文字コード
(set-language-environment "Japanese")
(set-terminal-coding-system 'euc-japan-unix)
(set-keyboard-coding-system 'euc-japan-unix)
(modify-coding-system-alist 'process "" 'euc-japan-unix)
 
;; 行番号の表示
(line-number-mode t)
(column-number-mode t)
 
;; 自動改行の実行
;(setq default-fill-colmun 72)
(setq default-tab-width 4)
(auto-fill-mode 1)
 
;; 自動バックアップ、自動セーブ中止
(setq make-backup-files nil)
(setq auto-save-default nil)
 
;; 長い行の折り返し表示を nil:しない。 t:する。
(setq truncate-lines t)
 
;; バッファの最後で next-line を実行しても, 新しい行が挿入されない
(setq next-line-add-newlines nil)
 
;; buffer list表示後カーソルをそこに移動する。
(define-key ctl-x-map  "\C-b" 'buffer-menu)
 
;; 日付・時刻表示
;;(setq display-time-24hr-format t) ; 時刻の書式をAM/PMではなく24時間表示にする
;;(setq display-time-day-and-date t)    ; 時刻の書式に日付を追加する
;;(display-time)                ; 時刻の表示
 
;; 圧縮ファイルを編集
(auto-compression-mode t)
 
;; php-mode
(load-library "php-mode-102")
(add-hook 'php-mode-user-hook 'turn-on-font-lock)
 
;; diredでファイル&ディレクトリ選択できるようにする。
(setq dired-move-to-filename-regexp
      (let* ((l "[A-Za-z\xa0-\xff]")
         (k "[^\x00-\xff]")
         (s " ")
         (yyyy "[0-9][0-9][0-9][0-9]")
         (mm "[ 0-1][0-9]")
         (dd "[ 0-3][0-9]")
         (HH:MM "[ 0-2][0-9]:[0-5][0-9]")
         (western (concat l l l s dd s "\\(" HH:MM "\\|" s yyyy "\\)"))
         (japanese (concat mm k " " dd k s "\\(" s HH:MM "\\|" yyyy k "\\)"))
         (freebsd (concat mm  "/" dd s "\\(" HH:MM "\\|" s yyyy "\\)")))
    (concat s "\\(" western "\\|" japanese "\\|" freebsd "\\)" s)))
 
;; w3m
(autoload 'w3m "w3m" "Interface for w3m on Emacs." t)
(autoload 'w3m-find-file "w3m" "w3m interface function for local file." t)
(autoload 'w3m-browse-url "w3m" "Ask a WWW browser to show a URL." t)
(autoload 'w3m-search "w3m-search" "Search QUERY using SEARCH-ENGINE." t)
(autoload 'w3m-weather "w3m-weather" "Display weather report." t)
(autoload 'w3m-antenna "w3m-antenna" "Report chenge of WEB sites." t)
 
;; Wanderlust
; SEMIを使うため
(load "mime-setup")
; autoload の設定
(autoload 'wl "wl" "Wanderlust" t)
(autoload 'wl-draft "wl" "Write draft with Wanderlust." t)
 
;; irchat-j
(autoload 'irchat "irchat" "Internet Relay Chat." t)
(setq irchat-nickname "seki")     ;IRC上のニックネーム
(setq irchat-server "irc.kyoto.wide.ad.jp");IRCサーバ
(setq irchat-service 6669)
(setq to-ascii-process ?B)
(setq to-kanji-process ?B)
 

VI Commands

15 Nov 2007

$

Go to the end of the line

^

Go to the beginning of the line

:s/^/\/\/

add "//" to the beginning of the line. Can couple this with "v" to comment multiple lines in a file

(number)G

Move to line number (number). Example: "1G" will go to the first line of the file

v [+ arrows]

select regions

u

undo

Emacs Commands

08 Nov 2006, 27 Apr 2007, 29 Oct 2007

Ctrl+s Ctrl+w

Select the current word, useful during search (Ctrl S)

Ctrl+Shift+=> display the right side of a long line if it's truncated

Esc+Ctrl+n or Esc+Ctrl+p

Jump to the matching braces

Ctrl+q+g

Go to certain line

Emacs - Simple comment syntax

If you are editing a type of file that has a simple comment syntax (e.g., lines that start with # are considered comments), you can let emacs know about it and get ride of the “No comment syntax is defined” error message when you try to comment a block of text.

Here is what you have to do (we asume that lines that start with # are considered comments):

M-: (setq comment-start “#”)

Display All Current Sessions

19 Sep 2007

ls -ltr ~/.vnc

the ~/.vnc folder has a log file of all current VNC sessions. Tips from Sambu.

Setup a cronjob

7 Sep 2007

  1. Type "crontab -e"
  2. One simple line of command for cronjob is "15 18 * * * rsync -aruv /proj/ezpathxap2/user/billh/xroads/ ~billh/xroads". This will execute the command everyday at 6:15pm.

Unzip a Tar Ball (gz.tar)

1 Mar 2007

 

I have extract the files, and put them at /home/mattw/billh

 

The steps I used were

 

1.) gunzip afx-ii-dcref.tar.gz

2.) tar –xvf afx-ii-dcref.tar

 

--Matt


From: Bill Hung
Sent: Thursday, March 01, 2007 1:29 PM
To: Matt Weathersby
Subject: [HOW-TO] Open a Tar Ball

 

Matt,

 

 Do you know how to open this tar ball http://web/seg/afx/afx-ii/release/afx-ii-dcref.tar.gz?

 

I tried winzip (windows), unzip (linux), and tar –xvf (linux), and I couldn’t open this tar ball.

 

Thanks,

Bill

 

Emacs Commands

11 Dec 2006

 

Script Check-in Commands

/home/easypath/bin/checkin.sh

DDD – Loading many breakpoints from a File
1 Nov 2006

 

This is the command to load many break points to ddd when ddd crashes.

ddd clock command=debug.sh

where in debug.sh I have couple break points

 

break extractor_clock.c:130

break extractor_clock.c:205

break extractor_clock.c:215

DDD Commands

1 Nov 2006

 

Alt+L

Display local variable window

Alt+U

Display Argument variable window

Alt+Y

Realign display windows

b <filename>:<line number>

Break at certain line. Example: break extractor_clock.c:130 or b extractor_clock.c:130

i br

List all the breakpoints and watchpoints

F2

Run

F9

Continue

 

 

Compile a special makefile, called make.t.clock (XBLD)

13 Oct 2006

xbld –t make.t.clock

Update or Checkout the Latest Files from the Repository (XCS)

11 Oct 2006, 12 Oct 2006

xcs update (more or less update the files without local changes, will not check out new files)

xcs get (update and get new files)

 

~/sandbox/G.38/latest/groups/XASP/xfndry/env> xcs get <folder/file>

How to Run a Program Anywhere

10 Oct 2006

setenv BUILD G.38

$MYXILINX/bin/sol/ > ln -s /<place>

source .cshrc

rehash

 

Script for Starting VNC Remote Connection
20 Sep 2006 from Matt Weathersby

system("vncserver -name whatever -depth 8 -cc 3 -geometry 2560x1024");