linux环境显示所有文件(包括隐藏文件)ll -a有两个文件可以提供这种“进入系统时自动设置”的功能,一个是 /etc/bashrc,另一个是 ~/.bashrc。其中/etc/bashrc是被每个用户执行的,而~/.bashrc只被当前用户执行。所以/etc/bashrc只有root用 户能更改...
分类:
数据库 时间:
2014-06-29 00:20:23
阅读次数:
305
在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
大纲1、TheBashShell2、OutputinColor3、Howcandoit?1、TheBashShellBashistheprimaryshelloftheLinuxmachine,includedherearesometips/trickswiththeshell.UsethemanualpageandlearnaboutPS1,PS2andPROMPT_COMMAND.Thetricksinherecanbeusein~/.bash_profileor~/.bashrc.2、Ou..
分类:
系统相关 时间:
2014-06-16 16:53:26
阅读次数:
407
需求: 在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
java 安装与设置1. 安装 jdk2. 设置执行路径 unix: set
path=(/usr/local/jdk/bin $path) ( 在~/.cshrc文件里增加) linux: export
PATH=/usr/local/jdk/bin:$PATH (在 ~/.bashrc 或 ~/...
分类:
编程语言 时间:
2014-06-11 08:21:47
阅读次数:
319
在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
大致有两种方式: 1,在bashrc中添加如下脚本1 svndiff()2 {3 svn diff
"${@}" | colordiff4 } 2,修改svn的配置文件1 $ vim ~/.subversion/config2 [helpers]3
diff-cmd = colordif...
分类:
其他好文 时间:
2014-06-07 08:33:20
阅读次数:
235
在工作中的经常使用repo命令,但是有时会忘记一些命令和遇到的一些问题,记录下来方便已经查询。
问题1:找不到命令:repo
方法:
在下载android源码的时候用repo时提示找不到命令,可以用如下方法解决,在命令行中输入如下两行:
echo 'export PATH=$PATH:$Home/bin' >>~/.bashrc
export PATH=$PATH...
分类:
移动开发 时间:
2014-06-05 02:39:47
阅读次数:
265
系统环境变量的查看:[root@localhost ~]#
envHOSTNAME=localhost.localdomainSELINUX_ROLE_REQUESTED=TERM=xtermSHELL=/bin/bashHISTSIZE=1000SSH_CLIENT=192.168.7.105
5...
分类:
系统相关 时间:
2014-05-28 00:48:18
阅读次数:
415