Linux -Blue forest free software | Return to home page | Site Map | Search WWW | Contact Us |
Your current position : Homepage > Free Software > Technological exchanges >System Management


    

Blue Forest http://www.lslnet.com at 20:18 on April 6, 2006


FreeBSD (UNIX) TIP From "BSD Hacks" v1.0

FreeBSD (UNIX) TIP From "BSD Hacks" v1.0

Time : 2004.09.08
Writer : LeLe
Email : tonnyomAThotmail.com

 Privacy Policy  Copyright ©an be arbitrary : reproduced, reprinted in writing when you must indicate the source and author of the original article and the information statement.

[Foreword]

System of BSD Hacks This is a small book, listing in May 2004. Some of the major details of the maintenance and use of BSD systems skills, the carrying system
Scripting and presentation tools. I got this book from the beginning, I think it is necessary to look at the experience to write it down, to be regarded as a working notebook, to share with everyone. :)

It is only Chapter1-2 part, the remaining are still learning, huh, huh. This document will be updated in the future to have my reading, "BSD Hacks" so far.

[Grep And Sed TIP]
Removal of the paper ballots :
Grep-V '^$' test.txt "; Tmp; mv tmp test1.txt
Sed '/^$/d' test.txt "; Tmp; mv tmp test1.txt

Keyword search :
Grep 'alias'. /.cshrc.orig
Sed-n '/alias/p'. /.cshrc.orig

Replacement keys :
Sed 's/bsd/ilikebsd/g' test.txt 4003rd overall increase for the replacement keyword g
Sed-n 's/bsd/ilikebsd/gp' date for the 4003rd increase output by replacing the word Bank n

(1) "bsd" for the replacement of the keyword "ilikebsd" to replace the keyword

Sed the implementation of two orders :
Sed 's/bsd/ilikebsd/g;/^$/d' test.txt "; Test2.txt 4003rd first was replaced keyword, then the ballots removed to a semicolon respectively

Notes source code before adding "#" :
Sed '/bc-start/, /bc-end/s/^/\#\#/' source.c

(1) is \#\# Lane, "\", is aimed at protecting the back of the Notes at the "#"
(2) /bc-start/, /bc-end/ code for the initial visit and to the end of Bank Notes

Notes prior to the removal of the source code "#" :
Sed '/bc-start/, /bc-end/s/^\#\#//;/bc-start/d;/bc-end/d' source.new 4003rd not retaining Notes
Sed '/bc-start/, /bc-end/s/^\#\#//' reservations source.new 4003rd Notes


[Mount TIP]
Mount Floopy :
Mount-t msdos /dev/fd0 /mnt
Mount_msdosfs /dev/fd0 /mnt

Format : Floopy
Fdformat-f 1440 /dev/fd0 4003rd formatted diskette
Bsdlabel versus /dev/fd0 fd1440 4003rd distribution diskette Juanbiao
Newfs_msdos /dev/fd0 4003rd definition disk format floppy disk


[Periodic Shell TIP]

Script : BSD systems using built-in safeguard
[/etc 13] # 1s l /etc/periodic/ 4003rd Maintenance System carrying catalog script
Total 8
Drwxr-xr-x two root 车 1024 Aug 20 16:55 daily
Drwxr-xr-x two root 车 512 Aug 20 16:55 monthly
Drwxr-xr-x two root 车 512 Aug 20 16:55 security
Drwxr-xr-x two root 车 512 Aug 20 16:55 weekly

Cp /etc/defaults/periodic.conf /etc/periodic.conf 4003rd configuration parameters
Vi /etc/periodic.conf

Sample :
(1) daily_clean_disks 4003rd automatically remove expired File System, Log. . . . Etc.

[/etc 13] # grep 'daily_clean_disks' /etc/periodic.conf
Daily_clean_disks_enable= "yes" # Delete files daily
Daily_clean_disks_files= "maillog.*.gz sendmail.st.* *.core"
If older than this daily_clean_disks_days=1 #
Daily_clean_disks_verbose= "yes" # Mention files deleted

[/etc 13] # /etc/periodic/daily/100.clean-disks 4003rd implementation of the script and see the result and after confirmation, which can be placed in crontab.

(2) air system daily_clean_tmps 4003rd asked to list the /tmp

[/etc 14] # grep 'daily_clean_tmps' periodic.conf
Daily_clean_tmps_enable= "yes" # Delete stuff daily
Daily_clean_tmps_dirs= "/tmp" # Delete under here
Daily_clean_tmps_days= "1" # If not accessed for
Daily_clean_tmps_ignore=. " X*-lock. X11-unix mysql.sock "# Don 't delete these
Daily_clean_tmps_verbose= "yes" # Mention files deleted


[Mtree TIP]

Batch mtree use to create catalogs, and the original book :. Authority to set up the preparation of a mistake, and the output is amended as follows
[/root/test More MY.test.dist # 13]
#home Grown test directory structure

Set2 type=dir uname=mysql gname=mysql mode=0755 //uname, gname is a group of documents is the proprietors, the document mode power
.
Test1
    ..
Test2
Subdir2a
          ..
Subdir2b
Subsubdir2c mode=01777
              ..
          ..
    ..

[/root/test Mtree -deU-f # 13] output MY.test.dist 4003rd see whether it meets the requirements
. /test1 Missing (created)
. /test2 Missing (created)
. /test2/subdir2a Missing (created)
. /test2/subdir2b Missing (created)
. /test2/subdir2b/subsubdir2c Missing (created)


Add :
(1) the amendment to the original list of complex systems installed 4003rd authority after the relocation of the repair complex systems for BSD
Mtree -eU-p /-f /etc/mtree/BSD.root.dist 4003rd fix permission base in all directories

(2) the relevant parameters mtree
D -
Ignores everything except directory files.

- E
Or together 't complain if there are extra files.

U-series dating method
Recreates the original ownerships and permissions.

- F /etc/mtree/BSD.root.dist
Specifies how to create the directory structure; this is an ASCII text file if you want to read up ahead of time on America, you will hear what is going to happen.

- P /
Specifies where to create the directory structure; if you not specified 't specify, it will be placed in the current directory.


[Information]
Http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/ FreeBSD Handbook

Http://www.oreilly.com/catalog/bsdhks/index.html?CMP=ILL-4GV796923290 BSD Hacks

FreeBSD (UNIX) TIP From "BSD Hacks" v1.0

Really boring way : if the Chinese version, I suggest you do not buy.

In fact, these so-called tips in the use of the process, the problems encountered, their resolve will remember, understand, and use them well.

Who would like to see such a lot of tips and mind? !

FreeBSD (UNIX) TIP From "BSD Hacks" v1.0

The so-called tips of experience in the management and use, relatively speaking, it was not good for such an experience?

Of course, you may tip those who do not need those who feel dull. It is not your tips better? It seems only encounter problems, you have a chance to ask your advice of the tips.

FreeBSD (UNIX) TIP From "BSD Hacks" v1.0

Worth worth at least two spaces are not fighting.

This document, with the rejuvenation of my personal writing, we did not dispute the need for personal preferences and what

FreeBSD (UNIX) TIP From "BSD Hacks" v1.0

Can. Then finishing point and complete rules, can increase precision.
Welcome added.

FreeBSD (UNIX) TIP From "BSD Hacks" v1.0

E version of this book I have read
It seems like an old hand notebook

Upstairs who
Not as worthless, but the landlord to move the cases is the entry level TIPS.

In fact, the book has many years of experience in the development or experienced users of the optimization of view, is an old hand saw but benefit from the event.

Please do not boring to read sentence to criticize, and to share with you how good they are!
Support sharing! !

FreeBSD (UNIX) TIP From "BSD Hacks" v1.0

Look! ! !
Evaluation only slightly disappointed that they did not expect such strong terms of the evaluation.

OK! ! !
UNIX seems to think that merely on the basis of these experiences. On personal experience, you forget these things seen only in practice, to continue to use the plots will really become our own things.

"BSD Hacks> author of this book, I greatly admire the many articles he had read. But personally think that this is basically the only fraud in 1986. Little help to really understand UNIX and FreeBSD.

Maybe it is just my personal opinion.If it is hurt, I apology.

FreeBSD (UNIX) TIP From "BSD Hacks" v1.0

OK. Fang collection. . .



 Privacy Policy  Copyright © 1999-2000 LSLNET.COM. All rights reserved. Blue Forest website owners. E-mail : Webmaster@lslnet.com