Sie sind auf Seite 1von 4

alias

alias c='clear'
unalias
history
histroy - clear
!<< number>>
!! last executerd
ctrl-c interupt
ctrl -r reverse search
ctrl -s stop
ctrl -q resume
ctrl -u kil the line
stty -a
stty sane (reset)
Interpretation
User...
----------
Shell - program / interface bash/ksh/
------------
kernel - execution
-----------
Hardware
bash - Bourne Again Shell derivate of boure shell(sh) - developed by Steven Bour
ne
shell metacharacters
* - Matches the file names; Zero or more than any character
? - Matches any one character
[] - matches any one char insude the bracket
^ not
- range
-------------------------
ls
total <<No of data blocks>>
1 block - 1024 bytes
types of file
regular files (-) text/ binary file
directory file (d)
special file - softlink /character device/block device/ pipes
ls -l
2nd columns - Number of links
3rd -Owner
4th - Group
5th size
ls -lu show access time instead of modification time
ls -lc last i-node access change time
-----------------------------
links
hard links - cannot be created on directories/ cannot span file systems
ln <file >> new file
soft links
ln -s <<file >> newfile
---------------

* standard input - keyboard ( < )
* standard output - monitor ( > )
* standard error - monitor
---------------
File descriptors
* standard input -0
* standard output - 1
* standard error - 2
-------------------
vi
visual editor
command mode
insert mode
last line mode (ex/colon/escape mode)
cursor movement
- L - right
hjkl
w - word forward
e word end
b backward
^ - begin of line
$ - end of line
H - Top of screen
M - middle of screen
L - end of screen
G - go to last line of a file
( begining of sentence
) end of sentence
J join the lines
u - undo
ctrl - r - redo
editing instructions
-----------------
x - delete a char
dw - delete work
dd- delete a line
p -paste a line below
TRY : paster a line above
yy - copy
differnt ways of gettinf indo insert mode
i?i/o/O/a/A/c/C
env settings
set ts=10 (tab space)
set showmatch ( matching brackets)
set ic (ignore case)
forward search - /
backward searc ?
set aw - auto save
set all -list all set options
set - shows current options
substitutions
s/<<string>>/<<replaicement >> / global if all
<<address eg 1,3 $(last line ) >>s/<<string>>/<<replaicement >> / global if all
----
abbreviations
abbr
una
-----
Map CTRL-X dd
-----
Naming of buffers
"ayy
"ap
split window and undo : sp ; on
multiple files <file1> <file2>
:n
:P
:rewind
-----------------------
find commmand
find command - -name - size, -atime,amin, mtime, itime, -ser, -links, -type
logical operator (-a, -o ,!)
default option -print / ls
other oprions - remove files
-exec rm -ir{} \;
-exec rm -f{} \;
------------------------
above commands causes many times exec of rm. so avoid. Use xargs**
------------------------
PIPES and Filters
concept : writing multiple unix commands in command line
command1|command2|..|commandN
here output of 1 is input to 2 .. subsequently
wc - counts lines, words, charatcers in filw
wc -l lins
wc -w words
wc -c character
--------------
FILTER vcommands
any command or program which takes the input from from SI and send output to SO;
does not modify the source file
ex - wc, tail, head, tee... grep.. sed, awk

Das könnte Ihnen auch gefallen