码迷,mamicode.com
首页 >  
搜索关键字:bash    ( 15235个结果
使用Github进行合作开发
首先需要注册自己的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
CentOS安装scp命令的软件包openssh-clients
问题:今天用scp命令,结果提示:-bash:scp:commandnotfound想当然用yuminstallscp命令安装,结果提示:Nopackagescpavailable.解决:由上可见提供的软件包一定不是叫scp一般情况下服务器都有scp,可以找一台以前有scp的机器查看一下此命令由哪个软件包提供[root@localhost~]#whic..
分类:其他好文   时间:2016-06-26 00:40:56    阅读次数:271
shell的部分习题(持续更新)
写一个脚本/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
说说shell脚本中的export 和 source,bash
小弟刚刚接触linux,对linux上的很多东西都比较陌生,所以写一写博客,当做自己工作的总结和技术的积累吧,也是鞭策自己不断努力的去学习。 今天之所以起这个标题,把export,source ,bash这三个命令放在一起讲,实在是因为自己做了一件蠢事。 什么样的蠢事先不说。先分析下这三个命令。 首 ...
分类:系统相关   时间:2016-06-25 21:41:16    阅读次数:258
/etc/profile、/etc/bashrc、~/.bash_profile、~/.bashrc 的区别(转)
/etc/profile:此文件为系统的每个用户设置环境信息,当用户第一次登录时,该文件被执行并从/etc/profile.d目录的配置文件中搜集shell的设置. /etc/bashrc:为每一个运行bash shell的用户执行此文件.当bash shell被打开时,该文件被读取~/.bash_ ...
分类:其他好文   时间:2016-06-25 20:21:07    阅读次数:151
BASH SHELL not a valid identifier
...
分类:系统相关   时间:2016-06-25 17:55:43    阅读次数:254
LeetCode第195题---Tenth Line
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
ssh登录失败,报错:Pseudo-terminal will not be allocated because stdin
现象: 需要登录线上的一台目标机器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
Hadoop 配置(1)
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
my first bash coding
我觉得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
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!