Posts Tagged bash

Bash command line shortcuts

I have ever fond it somewhere, this is EMACS style, If you like emacs, it it very useful.

ctrl-l — clear screen.

ctrl-r — does a search in the previously given commands so that you don’t have to repeat long command.

ctrl-u — clears the typing before the hotkey.

Read the rest of this entry »

Tags: ,

2 Comments

使用 UNIX 的 10 个良好习惯(转载)

The Linux Cookbook 一书的作者 Michael Stutz 凭借自己多年使用 UNIX 的经验,总结了 10 个良好习惯,个人认为真的很受用,现摘要如下与大家分享。

Read the rest of this entry »

Tags: ,

2 Comments

歪招解决fedora11 Vi 设置问题

用过Linux的人没有几个不知道vi/vim的。这个类UNIX系统中都默认安装的一个功能强大的编辑器。vi和vim多少还是有些区别的。vim (vi improved)。由此可以看出,vim要比vi稍稍强大那么一些。不过fedora 11 下面默认安装的却是vi。这点让我不解。
用了一段时间vi后发现按照网上的方法设置诸如语法高亮,自动缩进等功能的时候好像并没有什么作用。经过多次的配置和 Read the rest of this entry »

Tags: ,

2 Comments

linux下检查开发工具版本的脚本

原文:http://www.chengyongxu.com/blog/linux下检查开发工具版本的脚本/

脚本如下:

 
#!/bin/bash
 
export LC_ALL=C
 
# Simple script to list version numbers of critical development tools
 
# 引在LFS官方文档,在此表示感谢
 
bash --version | head -n1 | cut -d" " -f2-4
 
echo "/bin/sh -> `readlink -f /bin/sh`"
 
echo -n "Binutils: "; ld --version | head -n1 | cut -d" " -f3-
 
bison --version | head -n1
 
if [ -e /usr/bin/yacc ];
 
then
 
echo "/usr/bin/yacc -> `readlink -f /usr/bin/yacc`";
 
else
 
echo "yacc not found"; fi
 
bzip2 --version 2>&1 < /dev/null | head -n1 | cut -d" " -f1,6-
 
echo -n "Coreutils: "; chown --version | head -n1 | cut -d")" -f2
 
diff --version | head -n1
 
find --version | head -n1
 
gawk --version | head -n1
 
if [ -e /usr/bin/awk ];
 
then
 
echo "/usr/bin/awk -> `readlink -f /usr/bin/awk`";
 
else
 
echo "awk not found"; fi
 
gcc --version | head -n1
 
/lib/libc.so.6 | head -n1 | cut -d" " -f1-7
 
grep --version | head -n1
 
gzip --version | head -n1
 
cat /proc/version
 
m4 --version | head -n1
 
make --version | head -n1
 
patch --version | head -n1
 
echo Perl `perl -V:version`
 
sed --version | head -n1
 
tar --version | head -n1
 
makeinfo --version | head -n1
 
echo 'main(){}' > dummy.c && gcc -o dummy dummy.c
 
if [ -x dummy ]; then
 
echo "Compilation OK";
 
else
 
echo "Compilation failed"; fi
 
rm -f dummy.c dummy

Tags: , ,

2 Comments

彩色man page的配置

使用终端免不了要查看man page, 默认的显示就只有一种颜色, 再加上一些加粗效果, 看久了着实费力. 配置一个赏心悦目的man page, 既可以增加效率, 还可以愉悦身心, 何乐不为.
Read the rest of this entry »

Tags: , ,

2 Comments