首先需要注册自己的github账号,然后 在本地生成ssh-key: 安装git,在本地任何文件夹上,右键,选择git bash here: 然后: git config --gloabal user.username "you name" git config --global user.emai ...
分类:
其他好文 时间:
2016-06-26 01:51:27
阅读次数:
276
问题:今天用scp命令,结果提示:-bash:scp:commandnotfound想当然用yuminstallscp命令安装,结果提示:Nopackagescpavailable.解决:由上可见提供的软件包一定不是叫scp一般情况下服务器都有scp,可以找一台以前有scp的机器查看一下此命令由哪个软件包提供[root@localhost~]#whic..
分类:
其他好文 时间:
2016-06-26 00:40:56
阅读次数:
271
写一个脚本/root/bin/yesorno.sh,提示用户输入yes或no,并判断用户输入的是yes还是no,或是其它信息#!/bin/bash
read-p"putyouranswer(yesorno):"Answer
case$Answerin
y|Y|[yY][eE][sS])//判断用户输入yes时的一切可能性
echo"youagree"
;;
n|N|[nN][oO])//判断用户输入no时的..
分类:
系统相关 时间:
2016-06-25 23:17:01
阅读次数:
564
小弟刚刚接触linux,对linux上的很多东西都比较陌生,所以写一写博客,当做自己工作的总结和技术的积累吧,也是鞭策自己不断努力的去学习。 今天之所以起这个标题,把export,source ,bash这三个命令放在一起讲,实在是因为自己做了一件蠢事。 什么样的蠢事先不说。先分析下这三个命令。 首 ...
分类:
系统相关 时间:
2016-06-25 21:41:16
阅读次数:
258
/etc/profile:此文件为系统的每个用户设置环境信息,当用户第一次登录时,该文件被执行并从/etc/profile.d目录的配置文件中搜集shell的设置. /etc/bashrc:为每一个运行bash shell的用户执行此文件.当bash shell被打开时,该文件被读取~/.bash_ ...
分类:
其他好文 时间:
2016-06-25 20:21:07
阅读次数:
151
Howwouldyouprintjustthe10thlineofafile?Forexample,assumethatfile.txthasthefollowingcontent:Line1
Line2
Line3
Line4
Line5
Line6
Line7
Line8
Line9
Line10Yourscriptshouldoutputthetenthline,whichis:Line10[showhint]Hint:1.Ifthefilecontainslessthan10lines,whatsho..
分类:
其他好文 时间:
2016-06-25 15:13:46
阅读次数:
203
现象: 需要登录线上的一台目标机器A,但是不能直接登录(没有登录权限),需要先登录B机器,然后从B机器跳转到A机器。 脚本如下: localhost:~ root# cat IDC-7.sh #!/bin/bash ssh root@101.201.114.106 "ssh -p25791 root ...
分类:
其他好文 时间:
2016-06-25 13:43:03
阅读次数:
210
1/增加hadoop 的用户;sudo useradd -m hadoop -s /bin/bash创建了可以登陆的 hadoop 用户,并使用 /bin/bash 作为 shell。设置密码:sudo passwd hadoop2/可为 hadoop 用户增加管理员权限 sudo adduser ... ...
分类:
其他好文 时间:
2016-06-25 08:28:30
阅读次数:
196
我觉得linux脚本批处理的特性实在太棒了,改文件名就是一例。 #!/bin/bash # change all the names of the sub-folders. for((i=1;i<=5;i=i+1)) do cd /home/sophie/temp aa=$(ls | grep "$ ...
分类:
其他好文 时间:
2016-06-25 06:12:02
阅读次数:
146