1.Debian's package management
apt-cache
apt-get -s remove package(delete the dependence packages)
dpkg --install
dpkg --remove
dpkg --purge
dpkg --list列出dpkg已知的所有软件包
dpkg --status具体软件包的详细信息
dpkg --search某个文件的原始软件包
dpkg --listfiles
dpkg --info xxx.deb
dpkg --contents xxx.deb
update-alternatives --config (editor)
替换/usr/bin/users而不修改coreutils软件包,可以把它移到/usr/bin/users.distrib:
dpkg-divert --local --rename --add /usr/bin/users
删除该转换返回原始文件名:
dpkg-divert --remove /usr/bin/users
禁止访问wall,使其所有者和组为根,并禁止文件上所有权限:
dpkg-statoverride --update --add root root 0000 /usr/bin/wall
与dpkg-divert不同,不能用此命令本身恢复旧权限。在删除改写后,需手工设置权限或重新安装包含该文件的软件包:
dpkg-statoverride --remove /usr/bin/wall
apt-get --reinstall install bsdutils
dpkg-reconfigure ssh
dpkg-reconfigure debconf
2.ssh's key
ssh-keygen -t dsa
scp id_dsa.pub username@IP:/tmp
ssh username@IP
cat /tmp/id_dsa.pub >> $HOME/.ssh/authorized_keys2
chmod go-w $HOME $HOME/.ssh
chmod 600 $HOME/.ssh/authorized_keys2
rm /tmp/id_dsa.pub
exit
3.commands
fc 10 15 #not only edit in vi,run
killall -s SIGHUP mplayer
talk
type
netstat -tupn
#Foreign address comes from netstat -tupn
find /home -type l | rm -rf {} \;
liu=/usr/share && cd ${liu}/stardict
ls $(pwd) /*$运算将圆括号内命令在子shell中执行,计算命令的值,关闭子shell并在结果返回最初的shell中。(如果设置了特殊的环境条件,这些条件可能不会转移到子shell中,如配置PATH但没有export,那么子shell可能不会继承这些条件。此时命令将失败)
ls `pwd` 还可以用反引号
ls ${pwd} 不产生子shell
ls $(cd)
Ctrl+r /*search the history command*/
find -mount
sort -m 1 2 > 3
script -a /tmp/script_session /*just script will creat a typescript file
ps -ef | tee -a /tmp/troubleshooting_file
4.emerge --info
Portage 2.1.3.16 (default-linux/amd64/2007.0, gcc-4.1.2, glibc-2.6.1-r0, 2.6.22-gentoo-r8 x86_64)
=================================================================
System uname: 2.6.22-gentoo-r8 x86_64 AMD Sempron(tm) Processor 3000+
Timestamp of tree: Tue, 06 Nov 2007 04:00:01 +0000
ccache version 2.4 [enabled]
app-shells/bash: 3.2_p17
dev-java/java-config: 1.3.7, 2.0.33-r1
dev-lang/python: 2.4.4-r6
dev-python/pycrypto: 2.0.1-r6
dev-util/ccache: 2.4-r7
sys-apps/baselayout: 1.12.9-r2
sys-apps/sandbox: 1.2.18.1-r2
sys-devel/autoconf: 2.13, 2.61-r1
sys-devel/automake: 1.5, 1.6.3, 1.7.9-r1, 1.8.5-r3, 1.9.6-r2, 1.10
sys-devel/binutils: 2.18-r1
sys-devel/gcc-config: 1.3.16
sys-devel/libtool: 1.5.24
virtual/os-headers: 2.6.22-r2
ACCEPT_KEYWORDS="amd64"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-march=k8 -O2 -pipe"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT=""
CONFIG_PROTECT_MASK="/etc/env.d /etc/env.d/java/ /etc/fonts/fonts.conf /etc/gconf /etc/revdep-rebuild /etc/terminfo /etc/udev/rules.d"
CXXFLAGS="-march=k8 -O2 -pipe"
DISTDIR="/usr/portage/distfiles"
FEATURES="ccache distlocks metadata-transfer sandbox sfperms strict unmerge-orphans userfetch"
GENTOO_MIRRORS=" http://cudlug.cudenver.edu/gentoo/ "
LANG="en_US.UTF-8"
LDFLAGS="-Wl,-O1"
MAKEOPTS="-j2"
PKGDIR="/usr/portage/packages"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --delete-after --stats --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages --filter=H_**/files/digest-*"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
SYNC="rsync://rsync.gentoo.org/gentoo-portage"
USE="3dnow 3dnowext X a52 aac aalib acl acpi alsa amd64 apm berkdb bindist bitmap-fonts bonobo bzip2 cjk cli cracklib crypt cscope cups dri dvd emacs encode esd firefox fortran ftp gd gdbm gif gnome gpm gtk iconv imlib ipv6 isdnlog java javascript jikes jpeg libg++ libwww mad midi mikmod mmx mng motif mp3 mpeg mplayer mudflap ncurses nls nptl nptlonly odbc ogg opengl openmp oss pam pcre pdf perl png pppd python quicktime readline reflection samba sdl session spell spl sse sse2 ssl tcpd threads truetype truetype-fonts type1-fonts unicode usb xml xorg xv zlib" ALSA_CARDS="ali5451 als4000 atiixp atiixp-modem bt87x ca0106 cmipci emu10k1x ens1370 ens1371 es1938 es1968 fm801 hda-intel intel8x0 intel8x0m maestro3 trident usb-audio via82xx via82xx-modem ymfpci" ALSA_PCM_PLUGINS="adpcm alaw asym copy dmix dshare dsnoop empty extplug file hooks iec958 ioplug ladspa lfloat linear meter mulaw multi null plug rate route share shm softvol" ELIBC="glibc" INPUT_DEVICES="keyboard mouse" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" USERLAND="GNU" VIDEO_CARDS="nv"
Unset: CPPFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LC_ALL, LINGUAS, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS, PORTDIR_OVERLAY
阅读(2536) | 评论(0) | 转发(0) |