Your ads will be inserted here by
Easy Plugin for AdSense.
Please go to the plugin admin page to
Paste your ad code OR
Suppress this ad slot.
#Bash format option [disable autocommenting]
:set formatoptions-=cro
Your ads will be inserted here by
Easy Plugin for AdSense.
Please go to the plugin admin page to
Paste your ad code OR
Suppress this ad slot.
vi copy from line number to line number
You can use split, or sed
Lets use command sed for example
in below given example we have start line number: 143 end line number 201 and file name: filter.log
output to file called outfile.log
# sed -n '143,201p' filter.log > outfile.log
other way to achieve copy:
Block selection VI
Using marker we can achieve that too.
Your ads will be inserted here by
Easy Plugin for AdSense.
Please go to the plugin admin page to
Paste your ad code OR
Suppress this ad slot.
Type
mk
to mark this spot as
k
.
Go to the end of the section you want.
Type: y’k (y= Yank,
Now p will do your job
Also you could use d’k to cut/delete.
Vi comment out block / VI comment multiple lines
Go to the line and hit
1) m{CHAR} or m{a}
and
2) put e mark in m{CHAR} in the end of the line
When you have marked a with start of line and e with end of line
type
3) :’a,’e s/^/# /
You can also use line numbers,
1 to $ ($ is the last line)
solitary % for everyline
. or blank for the current line.
To illustrate the “blank”, these two commands do the same thing:
:,$ s/^/# /
:.,$ s/^/# /
Finding / Locating
locate
which
whereis
Search and list all files, in given directory and narrow search for given string..
find ./ -name "*" -exec grep -Hi "which string to search" {} ;
Find all user files larger than 5Mb:
find /home -size +5000000c -print
Find all files created or updated in the last five minutes: (Great for finding effects of make install)
find / -cmin -5
Find files modified in the last two days:
find / -mtime 2 -o -ctime 2
Disk Check/ Usages, Space, Filesystem type
df -k :::::::::report filesystem disk space usage. (-k reports in Kbytes)
du -sh :::::::::Calculates file space usage for a given directory. (and everything under it) (-s option summarizes)
Page 1 of 2
Powered by WordPress & Theme by Anders Norén