一:基础回顾1:文件清空[craft@vp143test]$>log.txt2:正常和错误重定向输出//正常和错误都追加输出到同样地方[craft@vp143test]$ifconfig&>>log.1//正常输出重定向[craft@vp143test]$ifconfig>log//错误输出重定向[craft@vp143test]$ifconfig2>log.23:命..
分类:
系统相关 时间:
2016-04-03 07:44:03
阅读次数:
253
使用Git也好长时间了,但一直没系统的学习过,现在总结以下工作中用到的,记录以下,以后忘记了可以来看看。 因为操作系统是Windows,所以将简单介绍一下通过git bash命令行的使用; 本文将不介绍git的安装和配置,主要说一下git几个常用命令的使用; (1)git help 查看常用命令 ( ...
分类:
其他好文 时间:
2016-04-02 22:48:52
阅读次数:
267
/home/oracle隐藏文件.bash_profile#.bash_profile#Getthealiasesandfunctionsif[-f~/.bashrc];then.~/.bashrcfi#UserspecificenvironmentandstartupprogramsPATH=$PATH:$HOME/binexportPATHexportORACLE_BASE=/u01/app/oracleexportORACLE_HOME=$ORACLE_BASE/prod..
分类:
其他好文 时间:
2016-04-02 07:21:41
阅读次数:
221
1.首先类似于windows中的设定系统环境变量的方式为,在/etc/profile中 注意间隔符为: 然后复用原来路径是$PATH的方式 2.用户级别的是修改~/.bash_profile之类的,注意桌面用户的话是不读取此环境变量的 3.shell级别的,只是在本次运行中有效 注意,复用时使用${ ...
分类:
系统相关 时间:
2016-04-02 02:01:48
阅读次数:
281
在React Native 中,我们使用brew 安装nvm 的时候之后,并且创建完项目之后,下次再次使用xcode7 打开项目之后,发现运行失败。原因是nvm不能使用了,原因如下: 原因:brew 安装后一定要在你的 bash 或者 zsh 配置文件中设置一下,否则 当你重新启动终端,你会发现 n ...
分类:
系统相关 时间:
2016-04-01 17:40:17
阅读次数:
366
#!/bin/bash#DATE=`date"+%Y.%m.%d-%H:%M:%S"`ACCESS_DIR=/root/curl/accessERRO_DIR=/root/curl/erroSUCCESS_DIR=/root/curl/successFILE=`date"+%Y.%m.%d-%H"`WRONG(){cat$ERRO_DIR/$FILE|awk-F‘‘‘{print$2$3"\n"}‘#有错误状态码的域名}CURL(){foriin`cat/root/sites.txt`;do..
分类:
Web程序 时间:
2016-04-01 16:22:40
阅读次数:
407
1、局域网网段内主机是否存活脚本ping.sh#!/bin/bash#pingandtesthostsoflansisalive!foriin{1..254}dohost=10.57.36.$iping-c3$host>&/dev/nullif[$?=0];thenecho"$hostisalive!">>/tmp/hosts.logelseecho"$hostisdown!">>/tmp/hosts.logfidonechmod+xping..
分类:
系统相关 时间:
2016-04-01 16:20:36
阅读次数:
242
问题1:同时读取两个文件的相同行,并将两个文件的行插入到同一文本#cataa
a1
a2
a3
a4
#catbb
b1
b2
b3/
#vimaa.sh
#!/bin/bash
whileread-u3i&&read-u4j;
do
echo$i$j
done>cc3<aa4<bb
#./aa.sh
#catcc
a1b1
a2b2
a3b3/注意
read-u3i代表从文件描述符3中读..
分类:
系统相关 时间:
2016-04-01 06:45:03
阅读次数:
235
0root1-499虚拟用户500-65535普通用户root:x:0:0:root:/root:/bin/bash/etc/passwd/etc/shadowuseradduserdelpasswdchageusermodidsusudovisudopwckfingerrm-f.*#ll/etc/skel/-al拷到用户的家目录cp-a.bash*/home/xx/#chownxx:xx-R/home/xx#cat/etc/login.defs密码属性相关的内..
分类:
系统相关 时间:
2016-04-01 06:39:59
阅读次数:
266
原文:https://www.technovelty.org//linux/bash-arithmetic-evaluation-and-errexit-trap.html 在 "traps for new players" 一章: count=0 things="0 1 0 0 1" for i ...
分类:
其他好文 时间:
2016-03-31 21:35:29
阅读次数:
135