Shared Flashcard Set

Details

rhel 5 training guide ch 04
Text Editors and Processors
88
Computer Science
Professional
03/29/2010

Additional Computer Science Flashcards

 


 

Cards

Term
vi editor, what is last line mode
Definition
when you hit : and type a command
Term
vi command mode, what do you hit to insert text
Definition
i
Term
vi command mode, what do you hit to insert text at the beginning of the line
Definition
I
Term
vi command to open a new line below the current line
Definition
o
Term
vi command to open a new line above the current line and go into insert mode
Definition
O - capitol O
Term
vi command to move to the end of the current line
Definition
$
Term
vi command, move to the beginning of the current line
Definition
0 (zero)
Term
vi command, move to the middle of the page
Definition
M
Term
vi command for page down
Definition
ctrl+f (forward) , or page down
Term
vi command, move down half of a page
Definition
ctrl+d (down)
Term
vi command for page up
Definition
ctrl+b (back), or page up
Term
vi command, move one half page up
Definition
ctrl+u (up)
Term
vi command, move to the last line of the file
Definition
G, or ]]
Term
vi command, show the line number
Definition
ctrl+g
Term
vi editor, delete a word
Definition
dw
Term
vi command, delete a line
Definition
dd
Term
vi command, move to the first line of the file
Definition
[[, or 1G, or :1
Term
vi command, delete a character at the cursor position
Definition
x (works like delete)
Term
vi command, delete a character before the cursor position
Definition
X (works like backspace)
Term
vi command, delete lines 6 through 12
Definition
:6,12d
Term
vi command, undo the last command
Definition
u
Term
vi command, undo all the changes on the current line
Definition
U
Term
vi, undo the previous last line command
Definition
:u
Term
vi, repeat the last line command you just did
Definition
.
Term
vi, you have undone, no redo what you have undone
Definition
ctrl+r
Term
vi, search forwards for a string
Definition
/string
Term
vi, search backwards for a string
Definition
?string
Term
vi, you've searched, now find the next occurrence
Definition
n
Term
vi, you've searched, find the previous occurence
Definition
N
Term
vi, find and repleace "old" with "new"
Definition
:%s/old/new
-works with the first occurrence
Term
vi, find and replace all "old"s with "new"s
Definition
:%s/old/new/g
Term
vi, yank the current letter
Definition
yl
Term
vi, yank 3 characters
Definition
3yl (yank 3 letters)
Term
vi, yank a word
Definition
yw
Term
vi, yank a line
Definition
yy
Term
vi, yank 2 lines
Definition
2yy
Term
vi, yank the current sentence
Definition
y)
Term
vi, yank the previous 3 sentences
Definition
3y(
Term
vi, yank the current paragraph
Definition
y}
Term
vi, yank the previous paragraph
Definition
y{
Term
vi, paste the yanked data to the current line
Definition
p
Term
vi, paste the yanked data to the previous line
Definition
P
Term
vi, Copy lines 1 through 3 and paste them after line 5
Definition
:1,3co5
Term
vi, move lines 4 through 6 to after line 8
Definition
:4,6m8
Term
vi, delete to the end of the current word and go into insert mode
Definition
cw (change word)
Term
vi, delete the current character and go into insert mode
Definition
cl (change letter)
Term
vi command, change the case of the letter
Definition
~
Term
vi command, join the current line with the line below it
Definition
J
Term
vi command, delete from the cursor to the end of the paragraph, and go into insert mode
Definition
c} - change to the end of the paragraph
Term
vi command, delete from the cursor to the end of the previous paragraph, then go into insert mode
Definition
c{ change to the beginning of the paragraph
Term
vi command, delete from the cursor to the end of the sentence, go into insert mode
Definition
c) change to the end of the sentence
Term
vi command, delete from the cursor to the beginning of the previous sentence, go into insert mode
Definition
c( change the previous sentence and it also removes any of the sentence you are in
Term
vi command, switch characters with the character on the right
Definition
xp
Term
vi, insert file2 below the current line
Definition
:r file2
Term
vi, turn on the line numbers
Definition
:set nu
Term
vi, turn off showing line numbers
Definition
: set nonu
Term
vi, set ignore case when searching
Definition
:set ic
Term
vi, turn off ignore case for searches
Definition
:set noic
Term
vi, display invisible characters
Definition
:set list
Term
vi, turn off showing invisible characters
Definition
:set nolist
Term
vi, show the current mode of operation
Definition
:set showmode
Term
vi, turn off showing the current mode of operation
Definition
:set noshowmode
Term
vi, display all the vi settings
Definition
:set
Term
vi, display the settings (the variable settings) and the current settings
Definition
:set all
Term
vi, write the changes
Definition
:w
Term
vi, write the changes into file3
Definition
:w file3
Term
vi, force write the changes into a file
Definition
:w!
Term
vi, write and quit
Definition
:wq, or :x, or ZZ
Term
vi, quit vi without saving the changes
Definition
:q!
Term
vi, exit vi temporarily, then go back into vi
Definition
:sh - go to a shell, ctrl+d to return
Term
vi, execute a command without exiting vi
Definition
:!cmd ex: :!ls -l
Term
vi command, change from the current cursor position to the end of the line
Definition
C - capitol C
Term
awk, Use file ll.out, show columns 9, 5, and 3, put spaces between the columns.
Definition
awk '{print $9, $5, $3}' ll.out
Term
What does awk do
Definition
Works on columns. Reads the lines, each field can be referenced as $1, $2, etc.
Term
awk, what does $0 mean
Definition
all the fields, $0 means the whole line
Term
awk, use file ll.out, add text between fields 9 and 5
Definition
awk '{print $9,"is column nine",$5}' ll.out
Term
awk, use ll.out, print fields 3 and 5, and don't leave a space between them
Definition
awk '{print $3$5}' ll.out
Term
awk, use file ll.out, print columns 1 and 3, put a tab between them
Definition
awk '{print $1"\t"$3}' ll.out
Term
what is sed
Definition
stream editor
Term
sed, use sed on yourfile to delete a line containing a specific word
Definition
sed '/yourword/d' yourfile
Term
sed, using yourfile delete only yourword
Definition
sed 's/yourword//g' yourfile
Term
sed, delete two words from yourfile, use the -e option
Definition
sed -e 's/firstword//g' -e 's/secondword//g' yourfile
Term
sed, delete two words from yourfile, don't use the -e option
Definition
sed 's/firstword//g;s/secondword//g' yourfile
Term
sed, pipe ls -l to sed and add RHEL to the end of each line
Definition
ls -l | sed 's/$/RHEL/'
Term
sed, print only the lines from /etc/group that contain "root"
Definition
sed -n '/root/p' /etc/group
Term
sed, print /etc/group, and print lines that contain "root" twice
Definition
sed '/root/p' /etc/group
Term
sed, print /etc/group and replace "root" with "ROOT"
Definition
sed 's/root/ROOT/g' /etc/group
Term
sed, print /etc/group and replace "root" with "ROOT" and "sys" with "SYS"
Definition
sed -e 's/root/ROOT/g' -e 's/sys/SYS/g' /etc/group
Supporting users have an ad free experience!