Академический Документы
Профессиональный Документы
Культура Документы
2.1 Syslog
2.2 Script HOWTOs.
2.3 ;;;
2.4 log .
2.5 Script Core .
2.6 s.
2.7 .
2.8 Linux Gazette
2.9 patch GNU Make 3.70 VPATH.
2.10 fsck ;
2.11 fscks "device busy"
2.12 .
2.13 .
2.14
2.15 script autosave backup
2.16 .
2.17 vi C ,
2.18 sendmail 5 RedHat;
2.19 RedHat color-ls;
2.20 /usr/lib ;
3.
3.1
3.2
3.3
3.4
3.5
3.6
3.7
3.8
______________________________________________________________________
1.
Linux Tips HOWTO,
Linux .
' ,
Tips-HOWTO (, , ,
;). , ,
Tips-HOWTO.
2.
2.1. Syslog Paul Anderson, Tips-HOWTO
/etc/syslog.conf, :
# Dump everything on tty8
*.*
/dev/tty8
: TABS! syslog
...
2.2. Script HOWTOs. Didier Juges,
dj@destin.nfds.net
' , script
howto. howto
/usr/doc/faq/howto/ .
XXX-HOWTO.gz, XXX
howto. script "howto" the
/usr/local/sbin :
______________________________________________________________________
#!/bin/sh
if [ "$1" = "" ]; then
ls /usr/doc/faq/howto | less
else
gunzip -c /usr/doc/faq/howto/$1-HOWTO.gz | less
fi
______________________________________________________________________
,
howto.
( ), (
) .
, Serial-HOWTO.gz , :
$ howto Serial
script
mount
(, cdrom, ...)
, X
1 mail .
______________________________________________________________________
#!/bin/sh
#
# $Id: check_hdspace,v 1.18 1996/12/11 22:33:29 root Exp root $
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
:)
______________________________________________________________________
#!/bin/sh
USAGE="$0 <directory> <message-file>"
if [ $# != 2 ] ; then
echo $USAGE
exit
fi
echo Deleting...
find $1 -name core -atime 7 -print -exec rm {} \;
echo e-mailing
for name in `find $1 -name core -exec ls -l {} \; | cut -c16-24`
do
echo $name
cat $2 | mail $name
done
______________________________________________________________________
cron .
[ A /source/directory. tar.....
directory
. Jim Dennis, jadestar@rahul.net,
. -. ]
2.7. mghazey@miso.lowdown.com
. Mick Ghazey,
; .
du -S | sort -n
http://www.ssc.com/lg
, (1) LG ,
(2) John Fisk , SSC.
(mounted) /,
umount -a. , , shutdown
.
.
2.12. .
Simon Amor, simon@foobar.co.uk
ls -l | sort +4n
, ' scrunched ,
:
cd /
ls -lR | sort +4n
2.13.
. Mike Dickey, mdickey@thorplus.lib.purdue.edu
______________________________________________________________________
#!/bin/sh
# /usr/local/bin/print
# a simple formatted printout, to enable someone to
# 3-hole punch the output and put it in a binder
cat $1 | pr -t -o 5 -w 85 | lpr
______________________________________________________________________
script forall:
______________________________________________________________________
#!/bin/sh
if [ 1 = `expr 2 \> $#` ]
then
echo Usage: $0 dir cmd [optargs]
exit 1
fi
dir=$1
shift
find $dir -type f -print | xargs "$@"
______________________________________________________________________
2.16. simon@foobar.co.uk
. Simon Amor,
______________________________________________________________________
; autoindent vi indent
indent, shiftwidth
^T (tab) 4 , backspace
backspace mode, ruler . ,
, 20,
:
______________________________________________________________________
vi +20 myfile.c
______________________________________________________________________
localhost
yourbox
sendmail, hostname (
, yourbox). IP yourbox
127.0.0.1, sendmail, .
.
,
/etc/hosts :
127.0.0.1
10.56.142.1
localhost
yourbox
2.20. vps@unicorn.niimm.spb.su
/usr/lib ; Pawel Veselow,
compile link
; gcc reports ...
:
for i in *; do echo $i:;nm $i|grep tgetnum 2>/dev/null;done
tgetnum .
3.
3.1. swap partitions Linux Windows. Tony
Acero, ace3@midway.uchicago.edu
1. partition dos partition,
swap Windows , windows.
( swap ,
).
2. linux partition .
partition /dev/hda8:
dd if=/dev/hda8 of=/etc/dosswap
3. swap dos. 0
gzip -9 /etc/dosswap
4. /etc/rc
swap Linux:
XXXXX swap partition
swap partition
/etc/fstab
5. init/reboot /etc/brc /sbin/brc
/etc/brc,
dos|os/2 swap
partition dos/windows:
swapoff -av
zcat /etc/dosswap.gz | dd of=/dev/hda8 bs=1k count=100
# Note that this only writes the first 100 blocks back to the partition. I've found empirically that this is sufficient
>> ;
: .
: 5 ,
,
nanosecond :-)
3.2. Undelete. Michael Hamilton, michael@actrix.gen.nz
.
undelete .
text , , email,
,
. , .
30 ,
.
grep raw disk
partition .
, , email.
,
partition:
(compile) . ,
single user mode,
(unmount) .
egrep partition :
email /usr/local/home/michael/,
output df, /dev/hdb5
sputnik3:~ % df
Filesystem
/dev/hda3
/dev/hdb3
/dev/hdb5
sputnik3:~ % su
Password:
[michael@sputnik3 michael]# egrep -50 'ftp.+COL' /dev/hdb5 > /tmp/x
,
return.
email 'ftp' text
'COL'. 20 ,
-50 .
-3000
.
egrep partition -
.
strings
strings /tmp/x | less
To email .
, , ,
.
. ,
.
,
.
,
-
. ,
, floppy,
.
/usr/local/.from directory
(log)
-- --
monitore
.
- (
)
. ""
" ".
** .
, (
)
--
MIS,
.
** .
3.5.
. Justin Dossey, dossey@ou.edu
2c tips 12.
, :
______________________________________________________________________
#!/bin/sh
# lowerit
# convert all file names in the current directory to lower case
# only operates on plain files--does not change the name of dire
ctories
# will ask for verification before overwriting an existing file
for x in `ls`
do
if [ ! -f $x ]; then
continue
fi
lc=`echo $x | tr '[A-Z]' '[a-z]'`
if [ $lc != $x ]; then
mv -i $x $lc
fi
done
______________________________________________________________________
, script. script
. , :
for i in * ; do [ -f $i ] && mv -i $i `echo $i | tr '[A-Z]' '[a-z]'`;
done;
.
, script
( ).
,
, Geoff .
; ,
. ,
. ,
; irc bot;
kill -9 `ps -aux |grep ^<username> |tr -s " " |cut -d " " -f2`
, username foo
kill -9 `ps -aux |grep ^foo |tr -s " " |cut -d " " -f2`
,
root.
Gazette ,
. LILO loadlin,
boot (single)
shell login password prompt. ,
passwords "init
3" (multiuser mode).
: 1 : 2
Justin Dossey
( typescript session
log
log).
-- .
, (
(prototype) scripts shell
). 'script'
.
( / script
)
).
(' ):
path Root 'PATH= /bin'
path root. , root
symlink /bin alias shell ,
script /bin, path.
root (
) . admin host
/bin
/.*history patterns .
admin
, /
, "root"
( ,
MTA's (interactive)
scripting **
-- vi ./.exrc emacs
./.emacs $EXINIT
(header/footer macros)).
:
cp $data $some_users_home/tmp
su -c $origcommand $whatever_switches
cp $some_users_home/tmp $data
(... ).
"single" --
--
( netcom).
/usr/bin/X11/xdm
exec /usr/bin/X11/X -indirect hostname
2. /usr/lib/X11/xdm/Xservers
server (.. 0:)
3. you're home and away.
subnet
.
: SLS (1.1.1)
-nodaemon xdm --
.
3.8.
, , ,
HOWTO, email :
voulariba@hellug.gr : evris@hellug.gr
: ep@rocketmail.com