screen is a useful command when you do not have other better choice like vnc, specially for background job running. One thing that bothered me is I cannot page up and down simply even specified by
screen -h 2000
So I have to enter copy/paste mode by: ctrl+a, esc, page down/up
Saturday, October 30, 2010
linux: screen
Saturday, November 8, 2008
linux:shell:bash:grep: multi-grep
If I want to search multi words by grep, I could do in the way:
egrep "a|b|c|d" my_input_file.txt
then egrep will help you to search OR of a, b, c and d. If searching for AND of multi-words, you can do by pipe:
grep a my_input_file.txt |grep b |grep c |grep d
. However, sometimes, it is not so easy to use pipe in one line for the above usage. You can always build string of the command first and evaluate it. For example,
cmd="grep $var1 my_input_file.txt|grep $var2"
...
cmd="$cmd |grep $var3"
...
eval $cmd
Tuesday, October 14, 2008
Linux:command: du and quota
My disk quota is full on my account at Fermilab (.../home/zhiyil/desktop/...). So I have to clean to get more rooms to store files to SAM. Use the command:
du -s * .[a-zA-Z]* | sort -n
get an idea of which file is the largest one so that you could deal with them.
Thursday, October 9, 2008
Linux:command:shell: diff
One of layouts of printout of the command 'diff' is called: --side-by-side or -y which is also useful. Change the column width, just use
- -W columns
- --width=columns
diff --side-by-side -W 130 file1.txt file2.txt
Tuesday, October 7, 2008
Tuesday, September 16, 2008
Linux:shell:command: speed up 'grep'
'grep' is very slow when using it in a UTF-8 mode, specially for a large text file. However, it is fast if using 'C' mode. Use the command 'locale' to check the variable of 'LC_ALL'. Then
export LC_ALL="C"
(from http://tdas.wordpress.com/2008/02/03/speed-up-grep)
I tested it. The "C" mode is faster 50 times than the regular mode!
Tuesday, May 6, 2008
Linux:shell: how to change color of your prompt
I find a good paper:
http://www.funtoo.org/en/articles/linux/tips/prompt/
to teach you how to change the color of your prompt. Actually I did this change long time ago, however, there is a problem in my setting. I didn't use "\[" and "\]" to include the string so that my shell cannot precisely calculate word-wrap and once I input long strings in the command line, my line will mass up.
Thursday, April 24, 2008
Linux:command:cut
see 'man cut' for help information. Example here:
$ who am i | cut -f1-2 -d " " #print the first column
$ who am i | cut -f2- -d " " #print non-first columns
Sunday, March 9, 2008
Emacs: how to auto-complete word
Both vim and emacs have a function to auto-complete words. For example, in emacs, type "M-/" then it will help you automatically complete the word currently you are typing in. This specially is useful as programming.
Also, I find a good file to compare commands in vim and emacs. In order to avoid the original page is dead, I post it here for reference. The original address is: http://karl-voit.at/vim-emacs-cheatsheet_of_freezing_hell.txt
,----
| emacs-stamp: Time-stamp: <2006-11-07>
| vim-stamp: Latest change: Wed Nov 07 15:34:18 CET 2007
| .... whichever comes last *ggg*
|
| Title: vim7-emacs21-cheatsheet of freezing hell
| ... tries to combine the two editors of choice
|
| Author: Karl Voit
| Purpose: learn emacs21 _and_ vim (for myself)
| License: Creative Commons http://creativecommons.org/licenses/by/2.5/
| Status: constantly modified and enlarged
`----
================================================================================
Editor shortcuts: Emacs and vim vim emacs21
================================================================================
exit :q C-x C-c
save :w :w! C-x C-s
save as :w
save and exit :wq (or: ZZ)
exit without saving :q! (or: ZQ)
open file :e(dit) file C-x C-f
open file read only C-x C-r
re-read file (discard changes) :e(dit)!
edit file under cursor gf (goto file)
undo last changes u (or: C-_) C-_
undo one change :u(ndo)
undo latest changes on current line U
redo C-r
repeat last change .
append text after cursor a
append text after EOL A
insert text after cursor i
insert text before first non-whitesp. I
insert line below cursor and insert o
insert line above cursor and insert O
mark char begin v (column: C-v|C-q) C-Space
mark line begin V
restore last selection gv
copy marked part y M-w
paste marked part p C-y "yank"
cut marked part c C-w
delete marked part d
delete char x DEL
delete line dd (or: :d)
copy current line yy (or: Y)
delete to end of word cw (change word) M-d
delete current word caw
delete to EOL D C-k
toggle overwrite/insert mode INS (or: R) M-x overwrite-mode
replace current char withr
repeat nextX times X C-u X
complete word M-/
complete word backward C-P M-/
complete word forward C-N M-/
cancel C-c C-g
redraw C-l
file info C-g
file info (verbose) g C-g
set auto indent :set ai M-x auto-fill-mode
:set textwidth=0
execute shell code:r(ead) !
show whitespaces :set list
insert:r(ead) M-x insert-file
--------------------------------------------------------------------------- Help
show help of cmd XY :help XY
show man-page of current word K
grep help :helpg foobar
------------------------------------------------------------------------ Buffers
close buffer C-w c :clo(se) C-c k
close all buffers but current C-w o :on(ly)
open file for writing C-x C-f
open file for reading C-x C-r
change to previous buffer C-^ C-6 C-x b
change to buffernumber <12> <12> C-^ <12> C-6 C-x b
:b <12>
split vertically C-w s :sp(lit)
split horizontally C-w v :vs(split)
duplicate buffer :new
change to (upper) high buffer C-w h
change to lower buffer C-w l
list buffers :ls
--------------------------------------------------------------------- Navigation
goto line <12> <12>G M-x goto-line <12>
up k C-p
Cursor movements left right h l C-f C-f
down j C-n
buffer begin 1G gg M-<>
line begin ... end 0 ... $ C-a ... C-e
line begin (first non-whitespace) ^
word next w M-f
word last b M-b
sentence previous ( M-a
sentence next ) M-e
paragraph begin { M-{
paragraph end } M-}
goto last place C-o
goto next place (if any) C-i
goto begin of last marked part '<>
page up C-b M-v
page down C-f C-v
1/2 page up C-u
1/2 page down C-d
scroll one line down (keep cursor) C-e
scroll one line up (keep cursor) C-y
remember position (as p) m p C-x r m
jump to position (p) ` p C-x r b
jump to last marked position ``
jump to last place edited `.
list all marked positions :marks
place current line in the center z. C-l "locate"
------------------------------------------------------------ Search and replace
current line: goto character X fC
current line: goto character X backw. FC
current line: go before character X tC
current line: go before char. X backw.TC
activate incremental search :set incsearch
search incremental (if activated) / C-s
search incremental backwards (if activated) ? C-r
repeat search n C-s or C-r
repeat search in other direction N
replace s/foo/bar(/gci) M-%
search word under cursor *
search word under cursor backward #
search local variable under cursor gd
search buffer variable under cursor gD
search correspondent brace/bracker/.. %
unhighlight the search patterns :noh
search for regular expressions /REG C-M-s
repeat search for reg. expr. n C-M-s
search in other directory for reg.ex. N C-M-r
--------------------------------------------------------------------- Formatting
lowercase current word :mapl viwuW M-l
capitalize current word :mapc viwu~W M-c
uppercase current word :mapu viwUW M-u
toggle case of current word :mapt viw~W
toggle case of char under cursor ~
quote text C-c C-q
format line
format paragraph gqap M-q
format whole document gggqG
shift marked lines to left <<>>
set shiftwidth :set shiftwidth=4
------------------------------------------------------------------------- Macros
begin recording (name: foo) qfoo C-x (
end recording q C-x )
execute macro foo @foo C-x e
repeat macro execution @@
edit macro "ap
end edit macro
save macro
------------------------------------------------------------------------ Columns
mark column begin C-v (Windows: C-q) C-space
set width mark to longest line $
copy column(s) "*y
paste column(s) p C-x r y "yank"
cut column(s) d C-x r k "kill"
insert column text (foo) (visual:) Ifoo ESC C-x r t foo
-------------------------------------------------------------- Folding / Outline
hide all zC C-c C-t
show all zO C-c C-a
toggle hide/show all zi
hide this zc C-c C-d
show this zo C-c C-s
goto previous zk C-c C-p
goto next zj C-c C-n
------------------------------------------------------------- Special Characters
enter carriage return C-q ENTER C-q ENTER
enter newline C-q C-j C-q C-j
enter spoiler character ^L C-q C-l C-q C-l
------------------------------------------------------ Compare/merge differences
start file A and B in compare mode vimdiff A B emerge A B
emacs: goto fast-mode (C-c C-c doesn't have to be used) C-c C-c f
emacs: goto edit-mode e
next difference ]c (C-c C-c) n
previous difference [c (C-c C-c) p
goto difference X C-u X j
change to left file (higher) C-w h
change to right file (lower) C-w l
take this version :[range]diffpu(t) dp
take other version :[range]diffg(et) do
take A-version (C-c C-c) a
take B-version (C-c C-c) b
quit without saving the merge C-]
recenter buffers l
emacs: http://www.cs.cmu.edu/cgi-bin/info2www?(emacs)Merge%20Commands
---------------------------------------------------------------- Version Systems
vim: install vcsnursery from http://www.vim.org/scripts/script.php?script_id=1898
commit changes :VCSCommit C-x v v
show differences between versions :VCSVimDiff C-x v =
show log of current file :VCSLog C-x v l
revert changes to most recent version :VCSRevert C-x v u
update current file from repos :VCSUpdate
add file to repos :VCSAdd C-x v i
show annotations :VCSAnnotate
delete file (incl. from repos) :VCSDelete
show difference to previous version :VCSDiff
view a certain version :VCSReview 42 C-x v r
show detailed infos :VCSStatus
================================================================================
vim specific shortcuts:
================================================================================
================================================================================
Own vim macros
================================================================================
" move line before boxquote into title field of boxquote
map ,vkbqt kDj6lp0
" remove/delete trailing whitespace:
nmap ;tr :%s/\s\+$//
vmap ;tr :s/\s\+$//
"kill quoted sig
map ,kqs G?^> -- $d}
" change subject (Subjectaenderung) (Source: Michael Prokop)
map ,vkcs :set nohlsearch
\:1,/^Subject: /g//s/^\(Subject: \)\(Re: \)\=\(.*\)$/
\\1 (was: \3)/9 i
" simple quote (insert quote after this line)
map ,vksq 0jikki
" quote between line (insert quote in between the line)
map ,vkqbl i0kxkkxjxi
" update timestamp (make sure that "set paste" is NOT set
iab Tue Jul 31 13:03:52 CEST 2007=strftime("%a %b %d %T %Z %Y")
" map ,L 1G/Latest change:\s*/e+1CYDATE
map ,L 1G/Latest change:\s*/eCYDATE
" voit 20070306:
" ESC-c ... capitalize current word (and goto next word)
mapc viwu~W
" ESC-l ... lowercase current word (and goto next word)
mapl viwuW
" ESC-u ... uppercase current word (and goto next word)
mapu viwUW
FIXXME: Bereichsangaben
" Using (g)vim to colorize sourcecode (from: http://barnson.org/node/295#comment-26758)
" used here: Visual Basic syntax
:cal SetSyn("vb")
:syntax on
:set background=light
:runtime! syntax/2html.vim
ggVG (to select all in this top frame)
"+y (to copy to clipboard)
...................................................................
...................................................................
...................................................................
...................................................................
...................................................................
N O T E S F O L L O W I N G
...................................................................
...................................................................
...................................................................
...................................................................
...................................................................
Svens Vortrag:
------------------------------------------------------------------------- Suchen
------------------------------------------------------ Eingabe von Sonderzeichen
Eingabe über ASCII-Nummer:
ß 223 ä 228 ö 246 ü 252
Zwei-Zeichen-Kombination:
Digraph Input! a + : -> ä
automatische Einrücken (indenting)
Clipboards/Register
Markieren von Text
von Position bis Position
zeilenweise (block)
als Rechteck -> Tabelle
Zeile? DOS/Windows, Unix, oder Mac?
Automatische Erkennung
Beliebige Wahl
%page
Anzeige - Grundlegend
Aktuelle Position des Cursors (Lineal,ruler)
%pause
ASCII-Wert von Zeichen
%pause
Sichtbarmachung von speziellen Zeichen
(TABs, trailing spaces)
:set list -> schon oben drinnen
%pause
geteilte Fenster (horizontal,vertikal)
-> TextKopieren, Vergleiche
%page
Anzeige - Fortgeschritten
Syntax Coloring / Highlighting
%pause
Achtung: ersetzt keinen Parser!
%pause
Struktur der Datei anzeigen - Baumstruktur
Text verstecken
Syntax dependant
Kommandos zum Einklappen und Verstecken
%page
Abkürzungen - Abbreviations
%pause
einfache Wortexpansion:
LS -> Leutheuser-Schnarrenberger
%pause
mehrere Worte:
LT -> Linux-Tag Chemnitz
%pause
mehr als nur Buchstaben:
function_mit_viel_bedeutung(*par1,par2)
* = neue Cursorposition
%pause
mehrzeilige Floskeln:
Sehr geehrter Herr Spammer..
..Aufnahme ins Killfile..
Gründe: [Liste]
Mit freundlichen Grüßen
%page
Goodies
Autosave
Backup files
Compiler
Filtering
Sessionfile
Syntax Input
%page
Grenzen - Limits
Endlicher Speicher -> Grenzen
Dateigröße
Dateinamenlänge
Displaybreite
Zeilenlänge
Zeilenanzahl
Bufferanzahl
Registergröße
,----
| 2do
`----
tabs (vim7)
retab + ersetzen:
:set tabstop=4
:set expandtab
:%retab
^M herauslöschen
align-current
query option value :set OPTION?
folding + examples (emacs-2do-list and vim-2do-list)
mika@grml ~ % grep boxes .vimrc
" 040420 introduced history 8-) and slightly modified 'boxes'-stuff
" 030219 VBlockquote.vim - like the tool "boxes" works ;-)
" 030219 Call boxes - with some funny box-styles ;o)
map ;0:'<,'>!boxes
map ;1:'<,'>!boxes -d boxquote
map ;2:'<,'>!boxes -d peek -a c -s 40x5
map ;3:'<,'>!boxes -d c-cmt
map ;4:'<,'>!boxes -d dog -a c
map ;5:'<,'>!boxes -d simple -a
jr
map ;6:'<,'>!boxes -d headline
--> Test! (FIXXME)
--> boxes = extra-tool!
"boxing" text C-c q
title of box C-c w
Snippets einfügen wie zB :
:he :iabbrev
:he mapmode-i
(Vim7: C-x C-o)
Ranges: . .+3 % ,. .,$
.........................................................
,----
| notes from a former talk:
`----
:set tw=50 ... set texxt width
mapgqip ... macro setzen
:set ft=html
:set paste ... Einfuegen ohne Umformatierung
:set nopaste ...
:set sw... Option vervollstaendigen lassen
:set sw= ... Option plus Wert vervollstaendigen lassen
:set listchars=tab:»·,trail:·,,eol:$ ... wie sollen list-Elemente usw visualisiert werden?
:w datei:.neu ... Kopie mit Anhaengsel ".neu" erstellen, Buffer bleibt bei "datei"
:!ls -l % ... shell-Kommando ls aufrufen (%=aktueller Buffername)
:!... letzter Befehl, der mit "!" begonnen hat
C-w n ... C-w=Fensterbefehl, n=new
C-w C-r ... unterster Buffer oben einfuegen (rotate)
:help C-v C-w ... show help on windows-commands (C-v nur um C-w einzugeben)
vimdiff
:diffget ... Aenderungen in den Buffer uebernehmen
%%% vim: ft=mgp ai noet ts=2
------------------------------------------
Emacs und ispell:
;; User-Dictionary ohne Nachfrage speichern
(setq ispell-silently-savep t)
(autoload 'flyspell-mode "flyspell" "On-the-fly spelling checking" t)
(autoload 'flyspell-mode "flyspell" "On-the-fly ispell." t)
(setq ispell-program-name "aspell")
;; Initialize spell checking
(setq-default ispell-program-name "aspell")
(set-default 'ispell-change-directory "ndeutsch8-15")
(set-default 'ispell-local-dictionary "ndeutsch8-15")
;; ========================
;; ISPELL
;; ========================
(require 'ispell)
(add-to-list 'ispell-dictionary-alist
'("ndeutsch8-15"
"[a-zA-Z\304\326\334\344\366\337\374]"
"[^a-zA-Z\304\326\334\344\366\337\374]"
"[']" t
("-C" "-d" "german")
"~latin1" iso-8859-15))
;; ========================
;; ISPELL End
;; ========================
;; ========================
;; FLYSPELL
;; ========================
(add-hook 'flyspell-mode-hook
(function (lambda ()
(setq ispell-local-dictionary "ndeutsch8-15")
)))
M-X change-ispell-dictionary
-----------------------------------------------------------
emacs und LaTeX
Added in file c:\.emacs
(require 'tex-site)
(setq tex-dvi-view-command "C:\texmf\miktex\bin\yap.exe")
(custom-set-variables
;; custom-set-variables was added by Custom -- don't edit or cut/paste it!
;; Your init file should contain only one such instance.
'(TeX-output-view-style (quote (("^dvi$" "^pstricks$\\|^pst-\\|^psfrag$" "%(o?)dvips %d -o && gv %f") ("^dvi$" "^a4\\(?:dutch\\|paper\\|wide\\)?\\|sem-a4$" "%(o?)xdvi %dS -paper a4 %d") ("^dvi$" ("^a5\\(?:comb\\|paper\\)?$" "^landscape$") "%(o?)xdvi %dS -paper a5r -s 0 %d") ("^dvi$" "^a5\\(?:comb\\|paper\\)?$" "%(o?)xdvi %dS -paper a5 %d") ("^dvi$" "^b5paper$" "%(o?)xdvi %dS -paper b5 %d") ("^dvi$" ("^landscape$" "^pstricks$\\|^psfrag$") "%(o?)dvips -t landscape %d -o && gv %f") ("^dvi$" "^letterpaper$" "%(o?)xdvi %dS -paper us %d") ("^dvi$" "^legalpaper$" "%(o?)xdvi %dS -paper legal %d") ("^dvi$" "^executivepaper$" "%(o?)xdvi %dS -paper 7.25x10.5in %d") ("^dvi$" "^landscape$" "%(o?)xdvi %dS -paper a4r -s 0 %d") ("^dvi$" "." "%(o?)xdvi %dS %d") ("^pdf$" "." "\"c:\\Programme\\Adobe\\Acrobat 6.0\\Reader\\AcroRd32.exe\" %o") ("^html?$" "." "netscape %o")))))
(custom-set-faces
;; custom-set-faces was added by Custom -- don't edit or cut/paste it!
;; Your init file should contain only one such instance.
)
Change target to PDFLaTeX: C-c C-t C-p
Compiled using C-c C-c
=== [ ENDE ] === ------------------------------------------------------------------------------
%%% Local Variables:
%%% mode: outline
%%% outline-regexp: "\\(\\[\\([1-2][0-9][0-9][0-9][0-1][0-9][0-3][0-9]\\)?\\]\\[\\([1-2][0-9][0-9][0-9][0-1][0-9][0-3][0-9]\\)?\\]\\(\\[.+\\]\\)? .*\\)\\|\\(^=== \\[ .* \\] ===.*\\)"
%%% eval: (auto-fill-mode -1)
%%% eval: (flyspell-mode -1)
%%% eval: (end-of-buffer)
%%% eval: (hide-body)
%%% emerge-set-combine-versions-template: "%a\n%b\n"
%%% End:
%%% OLD-outline-regexp: "\\(\\[\\([1-2][0-9][0-9][0-9][0-1][0-9][0-3][0-9]\\)?\\]\\[\\([1-2][0-9][0-9][0-9][0-1][0-9][0-3][0-9]\\)?\\]\\(\\[\\(maggie\\|lisa\\)\\]\\)? .*\\)"
%%% OLD-outline-regexp nur "[][] Text": "\\(\\[\\([1-2][0-9][0-9][0-9][0-1][0-9][0-3][0-9]\\)?\\]\\[\\([1-2][0-9][0-9][0-9][0-1][0-9][0-3][0-9]\\)?\\] .*\\)"
%%% OLD-outline-regexp inkl. Sterne als Items: "\\(\\[\\([1-2][0-9][0-9][0-9][0-1][0-9][0-3][0-9]\\)?\\]\\[\\([1-2][0-9][0-9][0-9][0-1][0-9][0-3][0-9]\\)?\\] .*\\)\\|\\(*+ \\)"
Tuesday, February 26, 2008
Linux: command: how to use getopt
A simple example is here:
http://tldp.org/LDP/abs/html/extmisc.html#EX33A
From http://www.tomshardware.com/ucg/commands/getopt-15186.html
getopt
UNIX Shell: Shells (ash, bash, bsh, csh, ksh, sh, tcsh, zsh)
Function
Cleans up and checks options given to a shell script. It split option given together and place each option in its own variable. Any additional arguments is placed after --
Syntax
set -- `getopt optstring $*`
getopt optstring parameter
Linux: [ options... ] -- optstring parameter
Linux: getopt [ options... ] -o optstring [ options... ] [ -- ] parame
optstring Specifies a string of option letters that is recognized by the script.
NOTE: If a letter is followed by a colon (:) it will take an argument.
parameter Specifies the options to check. (This is often $*, the argument list to the script).
set -- Sets the argument list $* .
Linux:
-a Allows long options to start with a single -.
-h Shows help information.
-l longoptions Specifies a long option that will be recognized.
-n progname Specifies a program to use to report errors
-o optstring Specifies a list of short options.
-q Disables error reporting
-Q Doesn't generate any output. Errors are reported unless -q is also given.
-s shell Uses quoting conversions of the specified shell (sh, bash, csh or tcsh)
-u Doesn't quote the output.
-T Will test if this is the enhanced version.
-V Shows version information.
File Name: getopt Directory: /usr/bin/ Type: External
Note:
This is very useful to make easy option check in a shell script.
set -- `getopt ab:c $*`
Specifies that a and c don't take an argument but c will.
If argument is: -ac -b hello
It will be converted to: -a -c -b hello --
If argument is: -bhello ucg
It will be converted to: -b hello -- ucg
set -- `getopt -l help ab:c $*`
Also recognizes the long option --help
Tuesday, September 25, 2007
Linux:command: some useful text commands
uniq
(=unique-----唯一的)去掉已排序的文件中的重复行。例如:sort myfile | uniq
fold –w 30 –s my_file.txt > new_file.txt
用空格将文本文件 my_file.txt 中的每行截成30个字符,并输出到 new_file.txt.
fmt –w 75 my_file.txt > new_file.txt
格式化文件中的每行为75个字符。把超过75个字符的行截短,把少于75个字符的行补齐,但不会移去空行。
nl myfile > myfile_lines_numbered
给文件 myfile 的每行标上行号。把结果输出给文件 myfiles_lines_numbered。
indent –kr –i8 –ts8 –sob –l80 –ss –bs –psl “$@” *.c
通过插入或删除空格来改变“C”源码的外观。上面例子里格式的选项是和 Linux 内核的源码的风格是一至的(script /usr/src/linux/scripts/Lindent)。 看 man indent 来了解各个选项的意义。存在的文件先被备份然后就被格式化好的文件给替代了。
rev filename > filename1
打印文件 filename,每行字符以相反顺序显示。上面的例子里结果直接输入到文件 filename1。
shred filename
用垃圾字符重复并覆盖文件 filename 的内容,使任何人都无法再去阅读文件的内容。
paste file1 file2 > file3
按行把两个或多个文件合并,用
如果文件 file1 的内容是:
1
2
3
并且文件 file2 的是:
a
b
c
d
那么结果 file3 里的内容就该是:
1 a
2 b
3 c
d
join file1 file2 > file3
把两个文本文件里有相同域的行连成一行。Join 和数据库的“表连接”操作是类似的,但它只是对两个文本文件进行操作。默认的分界符是空格。如果你想用其它的操作符,你可用 man join 去查看里面的选项。
如果 file1 里的内容是:
1 Barbara
2 Peter
3 Stan
4 Marie
并且 file2 的是:
2 Dog
4 Car
7 Cat
那么结果 file3 就该是:
2 Peter Dog
4 Marie Car
des –e plain_file encrypted_file
(=”Data Encryption Standard” 数据加密标准)加密文件 plain_file。你会被要求输入一个键值用于加密算法使用。加密后的结果存放到文件“encrypted_file”。解密就用:
des –d encrypted_file decrypted_file.
gpg
“Gnu Privacy Guard-----GNU 的私人警卫”—一个和 PGP(“Pretty Good Privacy”)功能一样的免费软件。gpg 比 PGP 更安全并且没有使用有专利的算法。gpg 主要用于给你的 email 加签名并且检查其它信息的签名。你也可用它来给你的信息加密解密。http://www.gnupg.org/上有所有的详细信息,包括一个易读和详细的手册。
开始,我需要一对匙值:个人匙和公共匙。个人匙用于给我的信息签字。公共匙用于传给他人来确认我的信息的签名在他们收到我的信息后来确认我的信息的签 字。(某人还可用公共匙来给信息加密这样这个信息就只能通过我的个人匙加密并阅读)。我用下面的命令来生成这一对匙值:
from http://www.networkdictionary.cn/software/Linux75.php
Tuesday, September 18, 2007
Linux:command: use chown to change owner of a file or directory
The command chown is used to change the owner of a file/directory. For example:
chown -hR zhiyil:zhiyil /work
(change owner of /work to zhiyil and group is zhiyil either)
Saturday, August 25, 2007
Linux:commands: how to kill jobs in background
If you have jobs running in background, you could kill them by the easier way than finding their PID and kill them. Just use the command jobs to find which job is running in background, and then pick up the job you want to kill, use kill %1 (here 1 is the job number)
Wednesday, August 8, 2007
Wednesday, July 25, 2007
Linux.shell.command: two usages of 'less'
As you know, 'less' is a very useful tool to view text files. Today I realize the two more functions new for me:
- You could use less to open more than one file in the buffer, just by ":p" or ":n" etc. to switch them
- If you have more than 1 key words to search, just use the way /wordone|wordtwo|wordmore and then enter, thus those 3 key words will be highlighted in the text body.
Monday, May 7, 2007
Linux:ssh: how to use ssh command remotely
Usually, when you want to run a command on a remote computer, you have to log in first. If you have ssh, you can use remote-command way:
ssh your.remote.computer.com yourCommandHere
For example,
ssh smart.phys.sfu.ca date
Tuesday, April 24, 2007
Linux:shell: how to exchange case of letters
If you wanna exchange between the upper case of one string and the lower case, you could use the command
echo "ThisIsAnExample" | tr 'a-z' 'A-Z'
and
echo "ThisIsAnExample" | tr 'A-Z' 'a-z'
