Archive for the ‘Linux’ Category

man 使用技巧两则

Sunday September 9, 2007

记得我初学 Linux 使用时,首先了解的就是如何在 Linux 系统中获得帮助的课程。当然,这其中少不了 man 命令的介绍。今天,在 Linux.com 网站读到一篇介绍 man 使用技巧的文章,个人感觉很受用,现介绍给大家分享。

  1. 使用书签

    man-trick1.png

    man 其实是调用 less 来显示手册页的。因此,在阅读内容比较长的页面时,可以使用书签来标记需要重复阅读的重要内容。标记的方法为:先按 m 键,然后在 mark: 后输入标记字母,如 a。需要说明的是,标记符是区分大小写的,也就是说 a 与 A 是两个不同的标记符。

    当你需要返回先前设置的书签时,可以按 键(单引号)。此时会显示 goto mark:,输入你设置的标记符即可。

  2. 测试命令

    man-trick2.png

    当你在阅读 man 手册页时想要对命令的用法进行尝试的话,那么可以使用 !。这让你不必打开新的终端,也不用离开 man 手册的阅读页面。在按下 ! 之后,你就可以自由输入所要测试的命令了。完成后,按回车键将返回到 man 手册的阅读页面。

摘至[LinuxToy]

Add Comment »

aria2 — Linux 下的高速下载工具

Sunday September 9, 2007

aria2 是 Linux 下一个不错的高速下载工具。由于它具有分段下载引擎,所以支持从多个地址或者从一个地址的多个连接来下载同一个文件。这样自然就大大加快了文件的下载速度。aria2 也具有断点续传功能,这使你随时能够恢复已经中断的文件下载。除了支持一般的 http(s) 和 ftp 协议外,aria2 还支持 BitTorrent 协议。这意味着,你也可以使用 aria2 来下载 torrent 文件。

安装 aria2

aria2 目前已被包含到许多 Linux 发行版中,因此你可以通过所用的系统直接加以安装。例如,在 Debian/Ubuntu 中,你可以在终端执行如下指令来安装 aria2:

sudo apt-get install aria2

如果你使用 Fedora Core,那么可以使用下列命令:

sudo yum install aria2

你也可以获取 aria2 的源代码,自行编译安装。当前 aria2 的最新版本为 0.11.2,可从这里下载。

aria2 的使用方法

aria2 是命令行程序,使用非常简单。

  • 一般使用
  • 使用 aria2 下载文件,只需在命令后附加地址即可。如:

    aria2c http://www.kernel.org/pub/linux/kernel/v2.6/linux-2.6.22.6.tar.bz2

    Continue reading »

Add Comment »

去除ubuntu的多余启动项

Saturday September 8, 2007

ubuntu默认就有多个启动项,当你更新过系统内核后,又会增加新的启动项,可以考虑把一些不用的,旧的内核的启动项去掉,如图

image

去掉这些启动项,需要修改 /boot/grub/menu.lst

gksu gedit /boot/grub/menu.lst

Continue reading »

Add Comment »

install openssh on archlinux

Sunday September 2, 2007

经朋友推荐,决定尝试下 archlinux
系统安装参考 archlinux wiki 中的 Beginners Guide
网络配置参考 Configuring network
主要配置 /etc/rc.conf 和 /etc/resolv.conf 两个文件, 不多言
配置好后

#pacman -Syu #更新系统

鉴于官方wiki并未给出ssh的安装和配置方法,所以我决定自己写了一个备忘
安装ssh

# pacman -Sy openssh

配置/etc/rc.conf
DAEMONS 一行中的 netfs 后添加 sshd

DAEMONS=(syslog-ng network netfs sshd crond) #作用是在archlinux系统启动时自动加载sshd

Continue reading »

Add Comment »

Keyboard Shortcuts for Bash

Sunday September 2, 2007

今天在网上闲逛,看到篇不错的文章, Keyboard Shortcuts for Bash 我摘录过来

Ctrl + A Go to the beginning of the line you are currently typing on
Ctrl + E Go to the end of the line you are currently typing on
Ctrl + L Clears the Screen, similar to the clear command
Ctrl + U Clears the line before the cursor position. If you are at the end of the line, clears the entire line.
Ctrl + H Same as backspace
Ctrl + R Let’s you search through previously used commands
Ctrl + C Kill whatever you are running
Ctrl + D Exit the current shell
Ctrl + Z Puts whatever you are running into a suspended background process. fg restores it.
Ctrl + W Delete the word before the cursor
Ctrl + K Clear the line after the cursor
Ctrl + T Swap the last two characters before the cursor
Esc + T Swap the last two words before the cursor
Alt + F Move cursor forward one word on the current line
Alt + B Move cursor backward one word on the current line
Tab Auto-complete files and folder names

Continue reading »

Add Comment »

using apt-get to install the software of gedeb

Sunday September 2, 2007

玩ubuntu,应该听过 getdeb 这个网站,它将最新的软件、游戏打包成 deb 格式供 Ubuntu 用户直接下载安装使用
想通过apt-get 方式安装 getdeb 上的软件,需要这样做

sudo gedit /etc/apt/sources.list

在sources.list中添加

deb http://ubuntu.org.ua/ getdeb/

然后可以进行相关操作了

sudo apt-get update #更新源
sudo apt-get upgrade #更新当前软件
sudo apt-get install softwarename #安装软件

Add Comment »

vim in Feisty Fawn ubuntu

Saturday September 1, 2007

想配置一下Feisty Fawn ubuntu中的vim

sudo vim /etc/vim/vimrc

发现有多个配置语法不支持
原来Feisty Fawn ubuntu默认安装的vim是最小化版,建议安装full版

sudo apt-get install vim-full

这样就ok了.
配置方法可以参考此帖

Add Comment »

ubuntu apt-get update 无法获得锁

Saturday September 1, 2007

好久没折腾自己的笔记本了,今天没事拿出来折腾下ubuntu,想装一个星际词霸,竟然会找不到,所以想更新一下源试试

sudo apt-get update

显示为

E: 无法获得锁 /var/lib/apt/lists/lock – open (11 Resource temporarily unavailable)
E: 无法对状态列表目录加锁

搜索了一下网上,找到个解决办法
直接把lock 文件删除就是了..

sudo rm /var/lib/apt/lists/lock

1 Comment »