很多零碎命令集锦:
1. 怎样通过命令下载ftp文件
read -s -p "Your passwd: " Passwd; wget --user=YourUserName --password=$Passwd ftp://IP/dir/file
read -s -p "Your passwd: " Passwd; axel ftp://yourUserName:[email protected]/dir/file
2. 怎样通过命令下载samba文件
smbclient //IP/file --user=domain\\user -c "cd \dir\dir; get file"
下载全部文件:
smbclient //IP/file --user=domain\\user -c "prompt OFF;recurse ON; cd \remotedir\dir; lcd ‘/local/dir‘; mget *"
3. ldapsearch 检索AD数据:
ldapsearch -x -D [email protected] -w passwd -h domain -b "CN=container,...,DC=domain" -s sub "(objectclass=*)"
4. 常见rpm命令
检查.rpm包括哪些文件:
rpm -qlp pkg.rpm
检查某已安装的软件包括哪些文件:
rpm -ql pkg
检查某个文件来自哪个软件包:
rpm -qf /bin/ps
解压获得.rpm内全部文件:
rpm2cpio myrpmfile.rpm | cpio -idmv
检查某软件的相关(安装。卸载)脚本
rpm --scripts -qp pkg
4. 其它系统的软件经常使用命令:
dpkg -c
gunzip ahoo.gz
swinstall -s /path/to/ahoo.depot \*
sh PHCO_ahoo
pkgadd -d ahoo.local
pkginfo
pkgchk
pkgtrans openssl-0.9.8d-sol8-sparc-local .
installp -d ahoo.bff all
hpux arch: file /stand/vmunix
5. unix系统上mount
mount -vcdrfs -oro /dev/cd0 /cdrom/
solaris: mount -o vers=3
mount -o loop disk1.iso /mnt/disk
aix: nfso -po nfs_use_reserved_ports=1
6. 检查程序内置libpath:
hpux - chatr
dump -Hv
sunos elfdump -d
linux readelf -d
7. 其它:
iptables -A OUTPUT -d 202. -j DROP
ps eww pid|cat /proc/pid/env
smitty chtz_date
eeprom boot-device="/[email protected],600000/[email protected]/[email protected],0:a /[email protected],600000/[email protected]/[email protected],0:a"
fsck -y /dev/md/dsk/d7
fuser /file_used_by_process
inetadm -m/-l
svcadm refresh
diff -Nurp old new>patch
set follow-fork-mode child
sudo /usr/sbin/ntpdate 3.asia.pool.ntp.org
tcpdump -nnvvSX dst 192.168.96.83 -w capter.txt
tcpdump -r -X capter.txt
addr2line -e a.out 0xabc