TraceLife

真正的幸福,在于对平淡生活的热爱……

导航

2012年4月27日

摘要: 下面列举一下各种 shell 对应的配置文件:Bourne Shell (sh) ----- .profileKorn Shell (ksh) -----.profile (兼容 sh)C Shell (csh)----- .loginBourne Again Shell (bash) -----bash被设计成兼容sh,ksh,并有csh的特征, 所以会在用户的主目录下依次查找.bash_profile,.bash_login,.profile文件,并用找到的第一个作为自己的配置文件; When you start a login shell, bash consults the follo 阅读全文

posted @ 2012-04-27 16:56 hallo 阅读(563) 评论(0) 推荐(0) 编辑

摘要: source command命令的格式有两种source .bashrc. .bashrc下面的方式更简洁,但后续的脚本如果要解析可能就稍微要复杂些。对应的文档:. filename [arguments] source filename [arguments] Read and execute commands from filename in the current shell environment and return the exit status of the last command exe- cuted f... 阅读全文

posted @ 2012-04-27 16:02 hallo 阅读(505) 评论(0) 推荐(0) 编辑

摘要: 在 Unix* Like 环境下工作时,不免会遇到 bash 环境变量的配置。而每次面对 $HOME 目录下的一些 .bash* 文件时,总会暂时性的忘记该修改那个好。实际中在那个文件中添加配置信息都没有问题,都可以正常工作。那为什么要设置两个配置文件呢?它们的区别是什么?查找 bash 的帮助文档。可以找到下面的描述。 ~/.bash_profile The personal initialization file, executed for login shells ~/.bashrc The individual per-i... 阅读全文

posted @ 2012-04-27 15:51 hallo 阅读(696) 评论(0) 推荐(0) 编辑

2012年4月1日

摘要: Linux shell 连续执行命令在 Linux shell 中,可以使用下面的格式,顺序的批量执行一组命令。1. 格式一&&command 1 && command 2 && command 32. 格式二 ;command 1 ; command 2; command 3 阅读全文

posted @ 2012-04-01 14:40 hallo 阅读(7279) 评论(0) 推荐(0) 编辑

2012年3月31日

摘要: 在 SSH 默认端口 22 被屏蔽时,hallo@hallo /usr/bin$ ssh -T git@github.comssh: connect to host github.com port 22: Connection timed out可以使用 443 端口访问 github 。这里在 cygwin 环境中做演示:1. 在 /home/hallo/.ssh 目录中添加配置文件 config 。Host github.comUser xxxx@gmail.comPort 443Hostname ssh.github.comidentityfile ~/.ssh/id_rsa2. clo 阅读全文

posted @ 2012-03-31 17:22 hallo 阅读(4576) 评论(0) 推荐(0) 编辑

2012年3月26日

摘要: 编写模块经过一个工作周的摸索,已经能够搭建起内核测试环境了。今天又把模块测试环境搭建好了。搭建模块开发过程中也遇到了很多问题,这里做一个概览性的描述。1. 内核源码准备不同于运行在用户态的一般程序,编写 Linux 下的内核程序时,需要引入内核文件。故编写的第一步就是准备内核源码。这几年发行的 Distribution 往往都不在光盘提供,都需要单独下载。同样两大发行版安装源码的方式也有所不同。RedHat 系列需要下载相应的 src*.rpm 源码包进行安装后即可在 /usr/src 中看到源码压缩包。而 Debian 系列可以使用apt-get install linux-source获取 阅读全文

posted @ 2012-03-26 08:26 hallo 阅读(575) 评论(0) 推荐(0) 编辑

2012年3月25日

摘要: linux 查看文件系统类型Linux 查看文件系统的方式有多种,列举如下:1. mount:~$ mount/dev/sda1 on / type ext4 (rw,errors=remount-ro,user_xattr)proc on /proc type proc (rw,noexec,nosuid,nodev)none on /sys type sysfs (rw,noexec,nosuid,nodev)none on /sys/fs/fuse/connections type fusectl (rw)none on /sys/kernel/debug type debugfs (r 阅读全文

posted @ 2012-03-25 23:22 hallo 阅读(108076) 评论(3) 推荐(6) 编辑

2012年3月20日

摘要: 在 Cygwin 中安装完 git 后,如果直接连接到 github 直接进行仓库操作,会报如下的错误。Administrator@99638e047c1e4a0 /cygdrive/f/Project/AutoIt$ git pullerror: cannot run ssh: No such file or directoryfatal: unable to fork查看用户主目录,确实没有对应的 .ssh 目录。解决方法:开启 setup.exe 程序,找到 openssh 进行安装。安装后的配置操作,可以参考这个链接。 阅读全文

posted @ 2012-03-20 03:02 hallo 阅读(8183) 评论(0) 推荐(0) 编辑

2012年3月17日

摘要: Cygwin 安装 gitCygwin 安装比较容易,标准的 Windows 系统安装过程。下面主要记录配置过程:1. 查看 Cygwin 版本2. 访问 Windows 盘符使用 mount 命令可以看到 Windows 系统的各个盘符被挂在到了 /cygdrive 目录下。如果对于目录有迷惑,可以使用 cygpath 进行格式的转换。Administrator@99638e047c1e4a0 ~$ cygpath -w ~/C:\cygwin\home\Administrator\Administrator@99638e047c1e4a0 ~$ cygpath -u C:\\Windows 阅读全文

posted @ 2012-03-17 17:52 hallo 阅读(12265) 评论(3) 推荐(1) 编辑

2012年3月16日

摘要: .gitignore对于项目中产生的中间文件、测试文件、可执行文件等,这类不需要被 git 所监控的文件,都可以使用 .gitignore 进行忽略设定。下面以 VS2008 项目为例,设置 .gitignore 文件。项目目录结构| README|\---MergingData | .gitignore | MergingData.sln | \---MergingData | CodeFile1.cs | favicon.ico | Form1.cs | Form1.Designer... 阅读全文

posted @ 2012-03-16 12:52 hallo 阅读(12762) 评论(0) 推荐(0) 编辑