ubuntu,debian,redhat,fedora,centos

How to hide comments

分类:DebianIntroduction
————

Although comments can be a blessing in the configuration file of an unfamiliar
system, they eventually become annoying if one is already very familiar with
the file. In some extreme cases, they can actually be an obstruction to
clarity.

Here are two methods for viewing files without hash (#) comments, one for the
command line and one for VIM, and a bit of advice for Debian administrators.

继续阅读 »

手工释放linux内存——/proc/sys/vm/drop_caches

分类:Debian    当在Linux下频繁存取文件后,物理内存会很快被用光,当程序结束后,内存不会被正常释放,而是一直作为caching。这个问题,貌似有不少人在问,不过都没有看到有什么很好解决的办法。那么我来谈谈这个问题。

一、通常情况
先来说说free命令:
继续阅读 »

TCP的状态变迁图

分类:RedHatTCP的状态变迁图

继续阅读 »

linux下如何限制su – 权限

分类:Debian因为root用户对系统具有全权的操作权限,为了避免一些失误的操作,建议在一般情况下,以一般用户登录系统,必要的时候需要root操作权限时,再通过“su -”命令来登录为root用户进行操作。
      在 一般情况下,一般用户通过执行“su -”命令、输入正确的root密码,可以登录为root用户来对系统进行管理员级别的配置。但是,为了更进一步加强系统的安全性,有必要建立一个管理员的组,只允许这个组的用户来执行“su -”命令登录为root用户,而让其他组的用户即使执行“su -”、输入了正确的root密码,也无法登录为root用户。在UNIX下,这个组的名称通常为“wheel”。 继续阅读 »

History命令用法

分类:Shell如果你经常使用 Linux 命令行,那么使用 history命令可以有效地提升你的效率。本文将通过实例的方式向你介绍 history 命令的 若干个用法。

使用 HISTTIMEFORMAT 显示时间戳
当你从命令行执行 history 命令后,通常只会显示已执行命令的序号和命令本身。如果你想要查看命令历史的时间戳,那么可以执行:

引用

# export HISTTIMEFORMAT=’%F %T ‘
# history | more
1 2008-08-05 19:02:39 service network restart
2 2008-08-05 19:02:39 exit
3 2008-08-05 19:02:39 id
4 2008-08-05 19:02:39 cat /etc/redhat-release 继续阅读 »

返回顶部