Sunday, March 06, 2005

Making the console work for you

vi:
l move cursor one character to the right
h move cursor one character to the left
j move cursor down one line
k move cursor up one line
x delete current character
i insert in front of the current chacter
a insert after the current character
A: insert at the end fo the line
dd: delete current line
d# : delete # charaters immediately under and the right of the cursors
q: quit
w: save
w filename: save as
wq: save then quit


emacs:
use f10 to pop up the menu, then use different setting.

to group files: * matchs all characters in any quantity
? match any single character
[a-b] range, maches a single character in the range of characters.
[AaBbCc] Matches a single character from the list of characters provides

search files:

find: find tree1 -name a.txt : find / -name a.txt

locate: locate a.txt

Redirect the standard output: locate a.txt > myajja.txt replace everything in the file
locate a.txt >> aaa.txt append to the in the file

Search test files for word patterns: grep ball myjpegs.txt
grep -l unix.*

Using Pipes to link commands, |

Using one commands answers as another's arguments: ln -s $(locate '*.jpg') jpegfiles
ln -s `locate *.jpg` jpegfiles

Keep shell programs under control: using Ctl+Z to suspend
jobs to show all running jobs
fg %1 to resume a job
bg %1 to let one job run in background
kill %2 to kill a particular job.

linux using console

Swith between different consoles: Ctl+Alt+F1....Ctl+Alt+F6 , six different consoles
Ctl+Alt+F7

command: ls /
ls ~
ls -l
Home directory: ~, cd ~

create file: touch empty.txt

current directory: pwd

change directory: cd cd .. cd
copy files: cp a.txt b.txt

make directory: mkdir abc

delete files: rm a.txt rm -r somedirectory; rmdir somedirectory

symbolic links: ln -s green blue;

change permissions: ls -l * ;
d: directory
l: symbolic link
-: normal files
chmod permcode file...
permcode: u (for owning user)
g (for owning group)
o (for "other")
Either a plus, minus, or equal sign, r w,x
chmod ugo+rw a.txt

Linux installration

Linux install - Need to notice that 3: /, /boot - 100M, swap - 2* memory < 2000M

Login: Language - can choose what languate use in the session
Sesssion - choose which Desktop to use

Create printers: /dev/lp0
/dev/lp1
/dev/usb/lp0
/dev/usb/lp1

Configure your internet service