greenZ

  博客园  :: 首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理

文章分类 -  shell

摘要:#查找关键字 Hello /Hello #vim忽略字母大小写匹配 /hello\c #显示行号 :set nu #跳转到 第120行 :120 #保存并退出 wq #退出不保存 q! #拷贝 yy #粘贴 p shift+g #跳转到 末尾 ctrl+b #向上 ctrl+f #向下 阅读全文
posted @ 2017-03-06 22:22 绿Z

摘要:#删除空行,但并不会修改 文件内容 tr -s ["\n"] < test.txt 阅读全文
posted @ 2017-03-06 22:16 绿Z

摘要:#大小写转换 echo 'hello' |tr [a-z] [A-Z] 阅读全文
posted @ 2017-03-06 22:15 绿Z

摘要:#查找某个用户的进程 ps -u <user> -f 或者 su - <user> ps-x #查看 目录的进程 ps -ef|grep `pwd` #查看 cpu 使用 top #查看进程路径 pwdx <PID> #查看进程路径 pwdx <PID> 阅读全文
posted @ 2017-03-06 22:13 绿Z 阅读(354) 评论(0) 推荐(0)

摘要:shell连接oracle数据库执行sql语句: 1.sqlplus + 写tnsnames.ora:支持 oracle rac 【jdbc.properties】 jdbc.properties文件部分信息: jdbc.driver = oracle.jdbc.driver.OracleDrive 阅读全文
posted @ 2017-03-06 22:09 绿Z

摘要:#设置文件,目录默认创建权限 umask umask 0122 mkdir test_dir touch test_file 阅读全文
posted @ 2017-03-06 22:02 绿Z

摘要:1.查看历史操作命令 history cat ~/.bash_history 2.删除历史操作命令 history -c true > cat ~/.bash_history 3.设置为不记录历史操作命令 vim /etc/profile 修改 HISTSIZE=0(默认 HISTSIZE=1000 阅读全文
posted @ 2017-03-04 19:47 绿Z

摘要:#kill 与 pkill kill -9 <pid> kill -9 -1 #杀掉当前用户下所有进程,root用户下慎用 pkill -kill -t pts/0 阅读全文
posted @ 2017-03-04 19:46 绿Z

摘要:sed --help sed -i "0,4"d test.log 1.sed 与 sed -i 的区别 2.模式串 使用 双引号 与 单引号 的区别 阅读全文
posted @ 2017-03-04 19:45 绿Z

摘要:su --help su - oracle -c 'echo $ORACLE_HOME' #该su命令并不会切换用户,但是会得到指定用户下命令的返回结果 阅读全文
posted @ 2017-03-04 19:43 绿Z

摘要:ls |wc -l 阅读全文
posted @ 2017-03-04 19:42 绿Z

摘要:shell交互入参: #### #### function main{ echo "sqlplus username/passwd@ynsname" read -p "please input username:"dbuser read -p "please input passwd:"-s dbp 阅读全文
posted @ 2017-03-04 19:41 绿Z

摘要:shell执行oracle的sql文件:oracle的sql文件可以嵌套执行sql文件。 【create.sql】注意sql文件编码为UTF8与数据库字符集相同 create table tab01( c1 varchar2(6), c2 number(38) ) ; comment on tabl 阅读全文
posted @ 2017-03-04 19:40 绿Z

摘要:bash执行gaussdb的sql文件:sql文件可以嵌套执行sql文件。 【create.sql】注意sql文件编码为UTF8与数据库字符集相同 create table tab01( c1 varchar2(6), c2 number(38) ) ; comment on table tab01 阅读全文
posted @ 2017-03-04 19:39 绿Z

摘要://todo 阅读全文
posted @ 2017-03-04 19:38 绿Z

摘要:bash执行db2的sql文件:sql文件不能嵌套执行sql文件。 【ssMgr/create.sql】注意sql文件编码为ISO-8859与数据库字符集IBM-eucCN相同 create table tab01( c1 varchar(6), c2 decimal(31) ) in tbs_ss 阅读全文
posted @ 2017-03-04 19:37 绿Z