Nov 072012
 

整理两个文档,一个是ubuntu,一个是centos,日后这种技巧的东西都放这两个文档里,也方便自己。

 

VI设置

默认的vi,比较难用,我希望可以语法高亮,自动停留在上次修改的位置。

apt-get install vim

还需要配置一下.

cat <<EOF >>/etc/vim/vimrc
if has("autocmd")
  autocmd BufRead *.txt set tw=78
  autocmd BufReadPost *
  \ if line("'\"") > 0 && line ("'\"") <= line("$") |
  \   exe "normal! g'\"" |
  \ endif
endif
EOF

这样直接使用vi编辑文件,就很方便.

apt-get默认安装suggeted packages

这篇文章是看到朋友网站上写的,我也有类似的经历,记录一下,改天自己验证一遍

http://www.cnblogs.com/yuxc/archive/2012/08/24/2653915.html

# apt-get install ipython
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following extra packages will be installed:
  python-configobj python-simplegeneric
Suggested packages:
  ipython-doc ipython-notebook ipython-qtconsole python-matplotlib python-zmq
The following NEW packages will be installed:
  ipython python-configobj python-simplegeneric
 upgraded, 3 newly installed, 0 to remove and 388 not upgraded.
Need to get 872 kB of archives.
After this operation, 4,355 kB of additional disk space will be used.
Do you want to continue [Y/n]?

需要让apt-get默认下载推荐和建议的包,需要建立一个配置文件:/etc/apt/apt.conf:

APT::Install-Recommends "true";
APT::Install-Suggests "true";

如果不希望apt-get下载suggested的包:

apt-get --no-install-recommends install package

查看内存硬件信息

通过top命令,是可以知道你机器有多少内存,不过具体这些内存是4G,还是8G的内存条,还有机器里有多少根内存条,这是看不到的。

通过dmidecode的命令是可以看到,不过你需要过滤一下。不过主板里的内存槽,不见得有那么多。

# dmidecode|grep -P -A5 "Memory\s+Device"|grep Size|grep -v Range
        Size: 4096 MB
        Size: No Module Installed
        Size: No Module Installed
        Size: No Module Installed
        Size: No Module Installed
        Size: No Module Installed
        Size: No Module Installed
        Size: No Module Installed
        Size: No Module Installed

查看系统支持的最大内存

# dmidecode -t 16
# dmidecode 2.11
SMBIOS 2.6 present.

Handle 0x0027, DMI type 16, 15 bytes
Physical Memory Array
        Location: System Board Or Motherboard
        Use: System Memory
        Error Correction Type: Multi-bit ECC
        Maximum Capacity: 144 GB
        Error Information Handle: Not Provided
        Number Of Devices: 9

  4 Responses to “Ubuntu基础”

  1. 陈老大,vi和wim太难了,如果是windows管理员学习ubuntu,那nano和windwos的记事本一样的好工具。可以向新手推荐一下。呵呵

    • 搞linux的,还是必须会vi的。这个是逃不掉的。我以前也老希望可以取巧。

      • vi只有真正去用了才会体会到它的强大。强迫自己用一周就会有感觉了。nano确实不是一个级别的东西。

 Leave a Reply

(required)

(required)