網頁

2005年12月11日 星期日

Linux技術文件

-------------------------------------------------------------------------------
*用日期做檔案名稱
>touch file`date +%y%m%d`
-------------------------------------------------------------------------------
*監測封包
tcpdumptcpdump -i eth1 -ns 1500 -w /tmp/dhcp.dump
-------------------------------------------------------------------------------
*解讀封包
tcpdump -r /tmp/dhcp.dump
-------------------------------------------------------------------------------
* 做一個批次處理的檔,目地在重建
/home/下的usercat /etc/passwd
awk -F ’:’ ’{printf("mkdir /home/%s \n", $1);}’ > 檔名1
-------------------------------------------------------------------------------
*增快DNS正查速度(利用DNS forwarder)
修改 /etc/named.conf, 其中有個options
{..........的敘述, 在此敘述的大括號中加入以下三行,
forwarders {168.95.192.1;};
-------------------------------------------------------------------------------
*初始化 Squid 快取squid -f /etc/squid/squid.conf –z
-------------------------------------------------------------------------------
*mysql 指令登入->mysql -u root -p 新開資料庫
->mysqladmin -u root -p create data_name新開資料庫
->mysqladmin -u root -p drop data_name  
-------------------------------------------------------------------------------
*系統校時
ntpdate ntp.nasa.gov //校時
clock -w //寫入硬體
-------------------------------------------------------------------------------
CLE 1.0 寫程式,由於bashbug,會使得output
若不跳到下一行就會消失,請加讓\n
#include
int main()
{ printf("hello world");
改成 printf("hello world\n");
-------------------------------------------------------------------------------
*反向輸出--tac反向列出系統登入者lasttac
-------------------------------------------------------------------------------
*/var/log有些記錄檔無法自動更換,使檔案變得太大
=>使用logrotate=>編輯/etc/logrotate.d/syslog,加入此檔名,
例如procmail.log
-------------------------------------------------------------------------------
Map of the Linux kernel/boot/vmlinuz-*內核Linux kernel
-------------------------------------------------------------------------------
/etc/aliases郵件別名Mail aliases
-------------------------------------------------------------------------------
/etc/at.deny被禁止的用戶
User IDs of users forbidden to use the at command
-------------------------------------------------------------------------------
/etc/auto.master自動
mountConfiguration file for the autofs daemon,
which automatically mounts filesystems
-------------------------------------------------------------------------------
/etc/auto.miscAutomounter map file
------------------------------------------------------------------------------- /etc/crontab系統日誌System cron file
-------------------------------------------------------------------------------
/etc/cron.daily/*安全日誌Daily cron jobs
-------------------------------------------------------------------------------
/etc/cron.hourly/*時誌Hourly cron jobs
-------------------------------------------------------------------------------
/etc/cron.monthly/*月誌Monthly cron jobs
-------------------------------------------------------------------------------
/etc/cron.weekly/*周誌Weekly cron jobs
------------------------------------------------------------------------------- /etc/filesystems支持的文件系統格式Supported filesystem types
-------------------------------------------------------------------------------
/etc/fstab文件系統mountFilesystems mounted or available for mounting
-------------------------------------------------------------------------------
/etc/group系統組定義System group definitions
-------------------------------------------------------------------------------
/etc/host.confResolver configuration file
-------------------------------------------------------------------------------
/etc/hosts域名IPMap of IP numbers to hostnames
------------------------------------------------------------------------------- /etc/hosts.allow允許的IPALL : 1.1.1.1 ALL : 2.2.2.* :
denysendmail : 3.3.3.3 : denyipop3d: *sendmail : ALL : allowin.ftpd :
*Hosts allowed to access Internet services
-------------------------------------------------------------------------------
/etc/hosts.deny禁止的IPALL:*Hosts forbidden to access Internet services
------------------------------------------------------------------------------- /etc/httpd/conf/*Apache配置文件Apache configuration files
-------------------------------------------------------------------------------
/etc/httpd/httpd.confWeb伺服器配置文件Web server configuration file
-------------------------------------------------------------------------------
/etc/initlog.conf登陸配置文件Logging configuration file
-------------------------------------------------------------------------------
/etc/inittabConfiguration for the init daemon, which controls executing processes
------------------------------------------------------------------------------- /etc/issueLinux kernel and distribution version
-------------------------------------------------------------------------------
查詢設定檔有無用#
Mark起來sed 's/#.*$//' xxx.conf grep -v '^$'
-------------------------------------------------------------------------------
查看snmpd的運作snmpwalk localhost -c public -v 1
------------------------------------------------------------------------------
打開RHEL 3.0MRTG,從外部可以瀏覽
/etc/httpd/conf.d/mrtg.conf Order deny,allow Deny from all
# Allow from localhost Allow from all -------------------------------------------------------------------------------
RHEL 3.0postfix使用sasl=>
需將/usr/lib/sasl2/smtpd.conf copy/usr/lib/sasl
-------------------------------------------------------------------------------
man的結果輸出成文字檔=>
man foo col -b >text
-------------------------------------------------------------------------------
解壓多個zip壓縮檔
==>ls -al *.zipxargs -n 1 unzip

沒有留言:

張貼留言