在bash下中文乱码,因为locale没有正确设置,在bash下执行:/usr/share/locales/install-language-pack zh_CNsudo locale-gen编辑用户主目录下 ~/.bashrc 文件,添加内容export LANG="zh_CN.UTF-8"exp...
分类:
其他好文 时间:
2014-06-18 10:51:44
阅读次数:
211
无意中将home下的所有文件都删除了,一些配置文件都丢了。重新登陆后,发现无法加载bashrc。查找后,发现问题不在于bashrc,而在与.bash_profile丢失login shell mode 只会读取 ~/.bash_profile , ~/.bash_login , ~/.profile...
分类:
其他好文 时间:
2014-06-17 20:29:17
阅读次数:
213
今天配置了一个crontab,但是怎么也不能执行,原因是环境变量的问题,记录一下。解决问题的办法,在shell脚本添加:##################. /etc/profile. ~/.bash_profile##################查看crontab是否执行了,可以查看:tai...
分类:
其他好文 时间:
2014-06-17 14:49:18
阅读次数:
223
大纲1、TheBashShell2、OutputinColor3、Howcandoit?1、TheBashShellBashistheprimaryshelloftheLinuxmachine,includedherearesometips/trickswiththeshell.UsethemanualpageandlearnaboutPS1,PS2andPROMPT_COMMAND.Thetricksinherecanbeusein~/.bash_profileor~/.bashrc.2、Ou..
分类:
系统相关 时间:
2014-06-16 16:53:26
阅读次数:
407
问题如题,上传文件名问号2.定位$localeLANG=en_USLC_CTYPE=zh_CN.UTF-83.修复所有用户生效,/etc/profile.d中加入setlang.sh:exportLC_CTYPE=zh_CN.UTF-8特定用户生效,~/.bash_profile中加入exportLC_CTYPE=zh_CN.UTF-8
分类:
其他好文 时间:
2014-06-16 16:47:18
阅读次数:
518
STEP1: Open Terminal
SETP2: Run setup.py
SETP3: Run source /Users/your_user/.bash_profile( so that environment variables are actually updated)
SETP4: Run cocos new my game -p com.your_company.mygame -l cpp -d /diretory_to_your_game
Open Terminal
R...
分类:
其他好文 时间:
2014-06-16 12:22:35
阅读次数:
178
需求: 在tmux里面链接ssh的时候, 如果存在多个ssh主机, 想要显示对应的主机ip以示甄别
实现效果
编辑你的bashrc, 因为我习惯在root下操作, 所以/root/.bashrc, 你如果习惯用user, 那就编辑/home/你的用户名/.bashrc
增加
ssh() {
if [ "$(ps -p $(ps -p $$ -o...
分类:
其他好文 时间:
2014-06-15 17:58:18
阅读次数:
245
1,设置Xshell编码为utf82,修改~/.bash_profile,添加export
LANG=zh_CN.utf8 执行命令$source ~/.bash_profile 解决~
分类:
系统相关 时间:
2014-06-12 06:46:14
阅读次数:
331
在linux中有时需要获得登录者的IP,这里有两种方法,先使用who am i 获取登录IP,然后截取字符串:
1、awk截取,sed替换
who am i | awk '{print $5}' | sed 's/(//g' | sed 's/)//g'
2、cut 截取
who am i|cut -d\( -f2|cut -d\) -f1
使用方法,若在脚本中如.bashrc中,可...
分类:
系统相关 时间:
2014-06-10 07:49:49
阅读次数:
320