Академический Документы
Профессиональный Документы
Культура Документы
!char
command
- to clear history
TAIL
Ex:
SED
- stream editor
- performing search and replace
Ex:
sed 's/one/two/g' <filename>
Esc + p
Esc + 10yy
search
/<text>
Move by word: w, b
Move by sentence: ), (
Move by paragraph: }, {
Jump to line x: xG
Jump to end: G
INSERT MODE:
EX MODE:
search, replace, save, exit
:w writes (saves) the file to disk
:wq writes and quits
:q! quits, even if changes are lost
VISUAL MODE:
Allows selection of blocks of text
v starts character-oriented highlighting
V starts line-oriented highlighting
Visual keys can be used in conjunction with movement keys:
w, ),
}, arrows, etc
Note: Highlighted text can be deleted, yanked, changed, filtered, search/replaced, etc.
Multiple documents can be viewed in a single vim screen.
Ctrl-w, s splits the screen horizontally
Ctrl-w, v splits the screen vertically
Ctrl-w, Arrow moves between windows
CONFIGURING VI AND VIM
Configuring on the fly
:set or :set all
Configuring permanently
~/.vimrc or ~/.exrc
A few common configuration items
:set number (:se nu) line numbers to be displayed in the left margin
:set nonumber (:se nonu)turns number off
:set autoindent (:se ai) new lines to inherit the indentation level of the
previous line
:set textwidth=65 (vim only) text to wrap when the text exceeds 65
characters
:set textwidth=0 turns textwidth off
:set wrapmargin=15 (:se wm=15) text to wrap when it reaches 15
characters from the right margin
ifup eth0
ifdown eth0
system-config-network
netconfig
-ONBOOT
-BOOTPROTO
(LARGE)
==> 0
- 10.255.255.255
172.16.0.0 - 172.31.255.255
192.168.0.0 - 192.168.255.255
-NETMASK
(or)
CLASS B 255.255.0.0
(or)
16
24
PDF VIEWER
evince <filename.pdf>
SETTING DATE AND TIME
GUI:
system-config-date
- Adjust the date and time manually
- On Time zone tab the system clock can be set for localtime or enable
UTC (Greenwich Mean Time)
TEXT:
date [MMDDhhmm[[CC]YY][.ss]]
Ex :date 12312359
31 of Dec, at 11:59pm. No change to the year
date 1231231592007
As above, but also sets the year to 2007
date 0101010107.01
1st of jan 07, at 01:01:01am