常用命令
find . -xdev -size +2048 -ls| sort -r +6|grep log|xargs 
rm 
删除两M已上的日志文件
创建软链接: ln -s 源文件名 目标文件名
文件夹下所有文件的总大小:
du -sh *
du -sh ./
:%!xxd ——将当前文本转换为16进制格式。
:%!od ——将当前文本转换为16进制格式。
:%!xxd -c 12——将当前文本转换为16进制格式,并每行显示12个字节。
:%!xxd -r ——将当前文件转换回文本格式。
获取版本信息:
服务器系统: netstat -apn | grep 9291
Linux:  uname -a     getconf LONG_BIT
Linux: 	uname -a
SunOS:	isainfo -v
AIX:    ls -l /unix    bootinfo -y
AIX :	prtconf
HP-UX:	getconf KERNEL_BITS
AIX64位编译:
export OBJECT_MODE=64 关键字: -maix64
通过进程id找到程序启动目录
Linux:  ls -l /proc/进程id 
Aix:procwdx 进程id
SunOS: pwdx 进程id
localtime_r在多线程环境下可能存在死锁 export TZ=BEIST
在linux和unix上有时不知道该使用LD_LIBRARY_PATH还是LIBPATH,经过搜索和实际使用,实际的情况如下
OS                   Environment Variable Name
Linux                   LD_LIBRARY_PATH
Solaris 32-bit ruby	              LD_LIBRARY_PATH_32 or LD_LIBRARY_PATH
Solaris 64-bit ruby	            LD_LIBRARY_PATH_64 or LD_LIBRARY_PATH
HP-UX PA-RISC 32-bit ruby	       	SHLIB_PATH
HP-UX PA-RISC 64-bit ruby	       	LD_LIBRARY_PATH
HP-UX IA64	               LD_LIBRARY_PATH
Mac OS X	 			DY              LD_LIBRARY_PATH
AIX	                   				LIBPATH
if [ ! -x "$myPath"]; then 
	mkdir "$myPath" 
fi 
-a file exists. 
-b file exists and is a block special file. 
-c file exists and is a character special file. 
-d file exists and is a directory. 
-e file exists (just the same as -a). 
-f file exists and is a regular file. 
-g file exists and has its setgid(2) bit set. 
-G file exists and has the same group ID as this process. 
-k file exists and has its sticky bit set. 
-L file exists and is a symbolic link. 
-n string length is not zero. 
-o Named option is set on. 
-O file exists and is owned by the user ID of this process. 
-p file exists and is a first in, first out (FIFO) special file or 
named pipe. 
-r file exists and is readable by the current process. 
-s file exists and has a size greater than zero. 
-S file exists and is a socket. 
-t file descriptor number fildes is open and associated with a 
terminal device. 
-u file exists and has its setuid(2) bit set. 
-w file exists and is writable by the current process. 
-x file exists and is executable by the current process. 
-z string length is zero. 
前几天尝试了SSH2的Client端调试,反复提示如下错误信息: 
java.io.IOException: Password authentication failed. 
... 
Caused by: java.io.IOException: Authentication method password not supported by the server at this stage. 
几经尝试,了解到原因:SSH登陆认证一般有两种方式: 
一种是直接的password模式,直接采用用户名密码登陆,信道也是加密的,不过容易被虚假主机欺骗 
一种是交互的指纹认证模式,通过一次交互在本地记录远程SSH主机的指纹,不会被虚假主机欺骗 
我采用了password模式,而SSH主机没有开启该模式所以无法连通。
联通前可以通过isAuthMethodAvailable(String userName, String mode)查看SSH主机对应模式是否开启。
password模式开启方式:修改/etc/ssh/sshd_config 文件中PasswordAuthentication no 改为PasswordAuthentication yes,然后重启ssh服务/etc/init.d/sshd restart 即可
静态库查看:
Linux: objdump -a **.a     nm **.a
perl: warning: Setting locale failed.nperl: warning: Please check that your locale settings:ntLC_ALL = (unset),ntLC__FASTMSG = "true",ntLANG = "zh_CN"
export LC_ALL=C
perl设置环境变量: $ENV{'PATH'}="/opt/usr/bin";
 
                    
                     
                    
                 
                    
                
 
                
            
         
         浙公网安备 33010602011771号
浙公网安备 33010602011771号