电脑技术学习

在Solaris上安装带颜色分辨的 ls

dn001

  Solaris下默认的ls后显示的目录或者文件等等是不带颜色的,如果要使其像Linux下,那么需要如下步骤

  一、去www.sunfreeware.com下载coreutils-4.5.4-sol9-sparc-local.gz

  二、以下分十步完成

  1. 彩色输出是GUN版本ls命令的一个特征,所以你必须先得到这个版本,你可以在这里下载sunfreeware.com.

  2. 使用下面的命令安装该包:

  root@host /var/tmp> pkgadd -d coreutils-4.5.4-sol9-sparc-local

  会提示你以下的包将会被用到:

  1 SMCcoreu coreutils (sparc) 4.5.4

  Select package(s) you wish to process (or @#all@# to process

  all packages). (default: all) [?,??,q]: 回车即可

  --output ommitted--

  3. 这个过程将安装和GUN ls以及其它有用的程序到 /usr/local/bin. 检查这个目录.

  4. 这些命令的文档信息可以在 /usr/local/doc 和 /usr/local/man目录中找到,阅读这些文档来了解新的命令,例如,彩色显示:

  user@host ~> man -M /usr/local/man dircolors

  稍后, 确认 MANPATH variable 包含 /usr/local/man.

  5. 可以给整个系统添加彩色显示设置, 如果那样的话,你需要在 /etc目录下建立一个DIR_COLORS文件。 大约是这样的:

  user@host ~> cat /etc/DIR_COLORS

  # Configuration file for the color ls utility

  # This file goes in the /etc Directory, and must be world readable.

  # You can copy this file to .dir_colors in your $HOME directory to override

  # the system defaults.

  # COLOR needs one of these arguments: @#tty@# colorizes output to ttys, but not

标签: