
linux
zxx2403
这个作者很懒,什么都没留下…
展开
-
Linux下查看版本号的命令
1. 查看内核版本命令: cat /proc/version uname -r cat /etc/issue2,查看linux版本2.1 lsb_release -a 这个命令适用于所有的linux,包括Redhat、SuSE、Debian等发行版。2.1 cat /etc/redhat-release2.2 rpm -q redhat-release注释: 2.1 2.2 只对 redhat linux 有效.转载 2011-04-18 14:31:00 · 442 阅读 · 0 评论 -
find
要列出所有的0字节的文件:# find /path -size 0c -exec ls {} \;要直接删除所有的0字节的文件:# find /path -size 0c -exec rm {} \;原创 2013-02-10 17:27:56 · 308 阅读 · 0 评论 -
linux下vim命令详解
高级一些的编辑器,都会包含宏功能,vim当然不能缺少了,在vim中使用宏是非常方便的::qx 开始记录宏,并将结果存入寄存器xq 退出记录模式@x 播放记录在x寄存器中的宏命令稍微解释一下,当在normal模式下输入:qx后,你对文本的所有编辑动作将会被记录下来,再次输入q即退出了记录模式,然后输入@x对刚才记录下来的命令进行重复,此命令后可跟数字,转载 2013-09-08 13:22:29 · 565 阅读 · 0 评论 -
LAMP兄弟连 李强强 GVIM配置文件完整版
"自己看着李强强老师视频代码手写打的。之前最后的一个gvim默认函数方法没放上,现在补上,现在已经是李老师的配置完整版。喜欢的朋友可以拿去,gvim确实是一个好东西,值得推广。"关闭兼容模式set nocompatible"模仿windows快捷键 Ctrl+A全选、Ctrl+C复制、Ctrl+V粘贴source $VIMRUNTIME/vimrc_example.vim转载 2013-09-08 13:24:23 · 2494 阅读 · 0 评论 -
TextMate-style snippets for Vim
http://www.vim.org/scripts/download_script.php?src_id=11006原创 2013-09-08 13:26:27 · 637 阅读 · 0 评论 -
Red Hat AS4-Update5 ISO [i386和x86_64]下载
I386[size=-1]RHEL4-U5-i386-AS-disc1.iso [size=-2]187.601M字节 2007年5月3日ftp://openware.byr.edu.cn/pub/os-images/Redhat/RHEL4u5/i386/RHEL4-U5-i386-AS-disc1.iso[size=-1]RHEL4-U5-i386-AS-disc2.iso [转载 2013-09-23 00:18:00 · 1920 阅读 · 0 评论 -
crontab 的使用及注意事项
1.crontab的基本用法Usage: crontab [-u user] [-e|-l|-r]Crontab 的格式说明如下:* 逗号(‘,’) 指定列表值。如: “1,3,4,7,8″* 中横线(‘-’) 指定范围值 如 “1-6″, 代表 “1,2,3,4,5,6″* 星号 (‘*’) 代表所有可能的值*/15 表示每 15 分钟执行一次# Use the ha转载 2014-03-23 21:24:34 · 642 阅读 · 0 评论 -
OpenSSH chrooted SFTP using public keys in Red Hat Enterprise Linux
Last modified: Sep. 11, 2009Contents1 - Summary2 - Service configuration5 - Create new group and user6 - Service check1 - SummaryThis guide will show how to configure OpenSSH with chrooted转载 2014-04-24 11:20:25 · 811 阅读 · 0 评论 -
How to Setup and Secure Linux SSH Logins to use Private PEM Keys
SSH logins are susceptible to brute force attacks. A thousand things can go wrong which could give someone unauthorized access to your server. The best way to secure your SSH login is to use Public/Pr翻译 2014-05-16 16:57:53 · 782 阅读 · 0 评论 -
remove bom
awk '{ if (NR==1) sub(/^\xef\xbb\xbf/,""); print }' INFILE > OUTFILEsed -i '1 s/^\xef\xbb\xbf//' *.txt转载 2014-10-25 17:46:01 · 4688 阅读 · 0 评论 -
Handle UTF8 file with BOM
From Wikipedia, the byte order mark (BOM) is a Unicode character used to signal the endianness (byte order) of a text file or stream. Its code point is U+FEFF. BOM use is optional, and, if used, sho转载 2014-11-03 10:30:36 · 666 阅读 · 0 评论 -
PK 自解压软件 overwrite
PK 自解压软件, 制定overwrite参数可以不弹出交互式提问 -bash-4.1$ ./10042015.001 -passphrase=Y9hiAciI7UoT1Cl -overwritePKSFX(R) Version 12 Self Extract Utility for Linux X86 Portions copyright (C) 1989-2007 PKWAR原创 2015-04-12 15:21:51 · 790 阅读 · 0 评论 -
What does '>/dev/null 2>&1' mean in this article of crontab basics
> is for redirect/dev/null is a black hole where any data sent, will be discarded2 is the file descriptor for Standard Error> is for redirect& is the symbol for file descript转载 2015-05-31 17:17:15 · 449 阅读 · 0 评论 -
bash regrex operator =~
If you're using a recent bash (v3+) suggest bash regex comparison operator =~, i.e.if [[ "$HOST" =~ ^user.* ]]; then echo "yes" fiTo match this or that in a regex use |, i.e.if [[转载 2015-05-31 17:23:48 · 714 阅读 · 0 评论 -
show bash version
bash-4.1$ bash --versionbash --versionGNU bash, version 4.1.2(1)-release (x86_64-redhat-linux-gnu)Copyright (C) 2009 Free Software Foundation, Inc.License GPLv3+: GNU GPL version 3 or later转载 2015-05-31 17:20:39 · 973 阅读 · 0 评论 -
putty最佳的的颜色配置
默认的putty的配色下,太毁眼睛了。根据列出来的RGB参数,稍微手动配置一下,然后保存: Window下的colours设置代码 * Default Foreground: 255/255/255 * Default Background: 51/51/51 * ANSI Black: 77/77/77 * ANSI Green: 152/转载 2015-06-15 18:34:02 · 13119 阅读 · 2 评论 -
CTRL-Z和CTRL-C
CTRL-Z和CTRL-C都是中断命令,但是他们的作用却不一样.CTRL-C是强制中断程序的执行,而CTRL-Z的是将任务中断,但是此任务并没有结束,他仍然在进程中他只是维持挂起的状态,用户可以使用fg/bg操作继续前台或后台的任务,fg命令重新启动前台被中断的任务,bg命令把被中断的任务放在后台执行.例如:当你vi一个文件是,如果需要用shell执行别的操作,但是你又不打算关闭v转载 2012-10-23 17:18:36 · 527 阅读 · 0 评论 -
linux 服务
1. 启动和关闭ftp service vsftpd start service vsftpd stop2.Telnet service xinetd start service xinetd end chkconfig --list | grep telnet chkconfig krb5-telnet on3. 关闭防火原创 2012-09-13 20:58:31 · 420 阅读 · 0 评论 -
linux EOF
/apps/oracle/product/10.2.0/db_1/bin/sqlplus -s scott/tigger@$orcl > $StatusLogFile whenever oserror exit FAILURE whenever sqlerror exit sql.sqlcode set head off set pagesize原创 2011-06-15 17:14:00 · 3784 阅读 · 0 评论 -
wget
wget 是一款支持http下载的软件. download url http://www.gnu.org/software/wget/wiki url http://en.wikipedia.org/wiki/WgetBasic usageTypical usage of GNU Wget consists of invoking it from the原创 2011-06-15 16:50:00 · 549 阅读 · 0 评论 -
vi 拷贝
以前,总遇到这样一个问题,在vi中拷贝写内容发现,少了一个内容. 也没怎么在意. 是什么原因 今天,在一个同事的指导下,终于清楚了原因. 原来是拷贝前,vi 不是处于编辑模式. 而拷贝的内容有恰好有 a i o 等内容, vi 就认为 和你 先敲入 a i o一样, 在把其他的内容拷贝进去. 所以少了些东西原创 2011-06-15 17:07:00 · 787 阅读 · 0 评论 -
Linux下如何查看文件秒级修改及访问时间
Linux下如何查看文件秒级修改及访问时间,今天遇到这个问题,搜索一下并记录之。通过 stat 命令即可。如Oracle告警日志文件的具体时间信息: [oracle@smsdbrac2 monitor]$ stat /opt/oracle/admin/smsdb/bdump/alert_smsdb2.log File: `/opt/oracle/admin/s转载 2011-06-20 06:06:00 · 2167 阅读 · 0 评论 -
Unix/Linux中Cron的用法
cron是unix或者linux下用来定时任务的命令,大致的用法如下:1、服务的启动和关闭/sbin/service crond start //启动服务/sbin/service crond stop //关闭服务/sbin/service crond restart转载 2011-07-12 17:29:20 · 2706 阅读 · 0 评论 -
linux 上传 下载 文件
FTP自动登录批量下载文件 从ftp服务器192.168.1.171上的/home/data 到本地的/home/databackup !/bin/bash ftp -v -n 192.168.1.171user guest 12转载 2011-09-07 17:11:31 · 287 阅读 · 0 评论 -
合并csv
实现如下需求,把许多txt文件load到数据库中实现方法:sed -i '1d' *.txt 去掉txt文件的表头cat *.txt > full.csv原创 2011-08-10 21:10:32 · 455 阅读 · 0 评论 -
grep
如果要搜索整个linux系统里,那个文本里写了 jdk1.4.0则以root登录,然后 执行 grep jdk1.4.0 / -r -------------------------------------------------------------------------------Linux grep命令用‘grep’搜索文本文件如果您要在几个文本文件中查找转载 2011-10-24 09:07:21 · 308 阅读 · 0 评论 -
linux 下取得当前目录的文件名字
ls -l | tr -s " " | cut -f9 -d " "tr -s " " 多个重复的空格用一个空格代替cut -f9 -d" " 取第9列,用空格做分割符原创 2011-11-09 14:08:38 · 543 阅读 · 0 评论 -
linux kshell if
如果是字符比较字符串if [ "${type}" = "M"] --注意 变量和=间需要有空格 ${type} 最好加上双引号。防止${type}不存在时报错thenelse fi 数字 用eqif [ $RET eq 0]原创 2012-02-09 17:24:54 · 722 阅读 · 0 评论 -
linux sed 替换 变量
job_id = 10我想替换JOB_ID_DEFAULT为10开始写法sed 's/JOB_ID_DEFAULT/${job_id}/' test > test.ctl不行, 后来发现外层改成双引号就可以了sed "s/JOB_ID_DEFAULT/${job_id}/" test > test.ctl原创 2012-02-09 14:01:11 · 6280 阅读 · 0 评论 -
Converting text files between Unix and Windows
Submitted by: Phillip LewisThe format of Windows and Unix text files differs slightly. In Windows, lines end with both the line feed and carriage return ASCII characters, but Unix uses only a line转载 2012-02-21 16:54:44 · 383 阅读 · 0 评论 -
linux 查看文件格式
1. 最近在使用sqlldr 导入数据时,总是报非法数字这个错误。 结果发现原来是文件格式的错误,需要将文件dos2unix.2. 如何判断linux文件是否是dos格式方法如下: 1。 grep "^M" 文件名称。 ^M 是ctrol + V + M 打出来的。 2。file 文件名原创 2012-02-29 18:06:33 · 3006 阅读 · 0 评论 -
linux find
按照文件名查找 find /tmp -name testfile 按照文件修改时间查找并删除,删除15天前的文件的命令: find . -type f -mtime +15 | xargs rm -f 按照文件大小查找并删除,删除当前目录下所有大小为0的普通文件的命令: find . -type f -size 0c | xargs rm -f原创 2012-03-07 17:05:08 · 471 阅读 · 0 评论 -
set up ip address in redhat el 5
Method # 1: GUI tool system-config-networkYou will see Window as above. Now select your Ethernet card(eth0 or eth1) and click on Edit button. You can now setup IP address, netmask, default gatew转载 2012-08-26 12:49:14 · 381 阅读 · 0 评论 -
解决SecureCRT无法用非root账号登录ssh
链接失败,提示这个:---------------------------SecureCRT---------------------------连接到会话 192.168.1.100 失败 :The server has disconnected with an error. Server message reads:A protocol error occurred. Ch转载 2015-07-19 22:15:41 · 44848 阅读 · 6 评论