Category Archives: Linux

如何安装显卡的驱动程序 (NVIDIA)?

sudo apt-get install nvidia-glx
sudo apt-get install nvidia-settings
sudo cp /etc/X11/xorg.conf /etc/X11/xorg.conf_backup
sudo nvidia-glx-config enable
sudo gedit /usr/share/applications/NVIDIA-Settings.desktop

在新增的文件内加入下面这几行

[Desktop Entry]
Name=NVIDIA Settings
Comment=NVIDIA Settings
Exec=nvidia-settings
Icon=
Terminal=false
Type=Application
Categories=Application;System;

默认conf

# /etc/X11/xorg.conf (xorg X Window System server configuration file)
#
# This file was generated by dexconf, the Debian X Configuration tool, using
# values from the debconf database.
#
# Edit this file with caution, and see the /etc/X11/xorg.conf manual page.
# (Type "man /etc/X11/xorg.conf" at the shell prompt.)
#
# This file is automatically updated on xserver-xorg package upgrades *only*
# if it has not been modified since the last upgrade of the xserver-xorg
# package.
#
# If you have edited this file but would like it to be automatically updated
# again, run the following commands:
#
#   cp /etc/X11/xorg.conf /etc/X11/xorg.conf.custom
#   sudo sh -c ‘md5sum /etc/X11/xorg.conf >/var/lib/xfree86/xorg.conf.md5sum’
#   sudo dpkg-reconfigure xserver-xorg

Section "Files"
    FontPath    "unix/:7100"            # local font server
    # if the local font server has problems, we can fall back on these
    FontPath    "/usr/lib/X11/fonts/misc"
    FontPath    "/usr/lib/X11/fonts/cyrillic"
    FontPath    "/usr/lib/X11/fonts/100dpi/:unscaled"
    FontPath    "/usr/lib/X11/fonts/75dpi/:unscaled"
    FontPath    "/usr/lib/X11/fonts/Type1"
    FontPath    "/usr/lib/X11/fonts/CID"
    FontPath    "/usr/lib/X11/fonts/100dpi"
    FontPath    "/usr/lib/X11/fonts/75dpi"
        # paths to defoma fonts
    FontPath    "/var/lib/defoma/x-ttcidfont-conf.d/dirs/TrueType"
    FontPath    "/var/lib/defoma/x-ttcidfont-conf.d/dirs/CID"
EndSection

Section "Module"
    Load    "bitmap"
    Load    "dbe"
    Load    "ddc"
    Load    "dri"
    Load    "extmod"
    Load    "freetype"
    Load    "glx"
    Load    "int10"
    Load    "record"
    Load    "type1"
    Load    "vbe"
EndSection

Section "InputDevice"
    Identifier    "Generic Keyboard"
    Driver        "keyboard"
    Option        "CoreKeyboard"
    Option        "XkbRules"    "xorg"
    Option        "XkbModel"    "pc104"
    Option        "XkbLayout"    "us"
EndSection

Section "InputDevice"
    Identifier    "Configured Mouse"
    Driver        "mouse"
    Option        "CorePointer"
    Option        "Device"        "/dev/input/mice"
    Option        "Protocol"        "ImPS/2"
    Option        "Emulate3Buttons"    "true"
    Option        "ZAxisMapping"        "4 5"
EndSection

Section "Device"
    Identifier    "NVIDIA Corporation NV11 [GeForce2 MX/MX 400]"
    Driver        "nv"
    BusID        "PCI:1:0:0"
EndSection

Section "Monitor"
    Identifier    "LXB-L15"
    Option        "DPMS"
    HorizSync    30-61
    VertRefresh    55-75
EndSection

Section "Screen"
    Identifier    "Default Screen"
    Device        "NVIDIA Corporation NV11 [GeForce2 MX/MX 400]"
    Monitor        "LXB-L15"
    DefaultDepth    24
    SubSection "Display"
        Depth        1
        Modes        "1024×768" "832×624" "800×600" "720×400" "640×480"
    EndSubSection
    SubSection "Display"
        Depth        4
        Modes        "1024×768" "832×624" "800×600" "720×400" "640×480"
    EndSubSection
    SubSection "Display"
        Depth        8
        Modes        "1024×768" "832×624" "800×600" "720×400" "640×480"
    EndSubSection
    SubSection "Display"
        Depth        15
        Modes        "1024×768" "832×624" "800×600" "720×400" "640×480"
    EndSubSection
    SubSection "Display"
        Depth        16
        Modes        "1024×768" "832×624" "800×600" "720×400" "640×480"
    EndSubSection
    SubSection "Display"
        Depth        24
        Modes        "1024×768" "832×624" "800×600" "720×400" "640×480"
    EndSubSection
EndSection

Section "ServerLayout"
    Identifier    "Default Layout"
    Screen        "Default Screen"
    InputDevice    "Generic Keyboard"
    InputDevice    "Configured Mouse"
EndSection

Section "DRI"
    Mode    0666
EndSection

Linux常用命令简介

su 
su命令是最基本的命令之一,常用于不同用户间切换。例如,如果登录为 user1,要切换为user2,只要用如下命令: 
$su user2 
然后系统提示输入user2口令,输入正确的口令之后就可以切换到user2。完成之后就可以用exit命令返回到user1。 
su命令的常见用法是变成根用户或超级用户。如果发出不带用户名的su命令 ,则系统提示输入根口令,输入之后则可切换为根用户。 
如果登录为根用户,则可以用su命令成为系统上任何用户而不需要口令。 

pwd 
pwd命令也是最常用最基本的命令之一,用于显示用户当前所在的目录。 

cd 
cd命令不仅显示当前状态,还改变当前状态,它的用发跟dos下的cd命令基本一致。 
cd ..可进入上一层目录 
cd -可进入上一个进入的目录 
cd ~可进入用户的home目录 

ls 
ls命令跟dos下的dir命令一样,用于显示当前目录的内容。 
如果想取得详细的信息,可用ls -l命令, 这样就可以显示目录内容的详细信息。 
如果目录下的文件太多,用一屏显示不了,可以用ls -l |more分屏显示 。 

find 
find命令用于查找文件。这个命令可以按文件名、建立或修改日期、所有者(通常是建立文件的用户)、文件长度或文件类型进行搜索。 
find命令的基本结构如下: 
$find 
其中指定从哪个目录开始搜索。指定搜索条件。表示找到文件怎么处理。一般来说,要用-print动作,显示 整个文件路径和名称。如果没有这个动作,则find命令进行所要搜索而不显示结果,等于白费劲。 
例如,要搜索系统上所有名称为ye的文件,可用如下命令: 
$find / -name ye -print 
这样就可以显示出系统上所有名称为ye的文件。 

tar 
tar最初用于建立磁带备份系统,目前广泛用于建立文件发布档案。可用如下方法建立tar档案: 
$tar cvf 
例如,如果要将当前目录中所有文件存档到ye.tar中,可用如下命令: 
$tar cvf ye.tar *.* 
要浏览档案内容,将c选项变成t。如果要浏览ye.tar档案中的内容,可用如下命令: 
$tar tvf ye.tar 
要取出档案内的内容,将c选项变成x。如果要将ye.tar档案中的内容取到当前目录中,可用如下命令: 
$tar xvf ye.tar 

gzip 
gzip命令用于压缩文件。 例如,如果要将ye.txt文件压缩,可用如下命令: 
$gzip ye.txt 
这样就可以压缩文件并在文件名后面加上gz扩展名,变成文件ye.txt.gz。 
解压缩文件可用gzip -d命令实现: 
$gzip -d ye.txt.gz 
这样就可以解压缩文件并删除gz扩展名。除此之外还可以用gunzip命令来解 压缩文件,效果跟用gzip -d命令一样。 
旧版的tar命令不压缩档案,可用gzip压缩。例如: 
$tar cvf ye.tar *.txt 
$gzip ye.tar 
则可建立压缩档案ye.tar.gz。 
新版的tar可以直接访问和建立gzip压缩的tar档案,只要在tar命令中加上z 选项就可以了。例如: 
$tar czvf ye.tar *.txt 
生成压缩档案ye.tar.gz, 
$tar tzvf ye.tar *.txt 
显示压缩档案ye.tar.gz的内容,而 
$tar xzvf ye.tar *.txt 
取出压缩档案ye.tar.gz的内容。 

mkdir 
这个命令很简单,跟dos的md命令用法几乎一样,用于建立目录。 

cp 
cp命令用于复制文件或目录。 
cp命令可以一次复制多个文件,例如: 
$cp *.txt *.doc *.bak /home 
将当前目录中扩展名为txt、doc和bak的文件全部复制到/home目录中。 
如果要复制整个目录及其所有子目录,可以用cp -R命令。 

rm 
rm命令用于删除文件或目录。 
rm命令会强制删除文件,如果想要在删除时提示确认,可用rm -i命令。 
如果要删除目录,可用rm -r命令。rm -r命令在删除目录时,每删除一个文件或目录都会显示提示,如果目录太大,响应每个提示是不现实的。这时可以用 rm -rf命令来强制删除目录,这样即使用了-i标志也当无效处理。 

mv 
mv命令用于移动文件和更名文件。例如: 
$mv ye.txt /home 
将当前目录下的ye.txt文件移动到/home目录下, 
$mv ye.txt ye1.txt 
将ye.txt文件改名为ye1.txt。 
类似于跟cp命令,mv命令也可以一次移动多个文件,在此不再赘叙。 

reboot 
重启命令,不必多说。 

如何在Windows NT/2000/XP上安装Ubuntu?

下载GRUB    (注意:在下载的过程中,IE有时会自动加上.Dat的扩展名,如果如此,将文件名 grldr.dat 改为 grldr )GRUB

将 grldr 复制到 C:,编辑C:BOOT.INI,加入一行: 
 C:GRLDR="GRUB"下载以下文件放在根目录 vmlinuz initrd.gz 或者到这里下载 vmlinuz initrd.gz
下载ubuntu的安装光盘 hoary-install-i386.iso 到 fat/fat32/ext2/ext3/reiserfs 类型分区的根目录.ubuntu-5.04-install-i386.iso
重新启动计算机,按 c 进入 grub 命令行根据下载的文件存放的位置,输入并回车: 
 grub>kernel (hd0,0)/vmlinuz root=/dev/ram ramdisk_size=20000 

devfs=mount,dall grub>initrd (hd0,0)/initrd.gz grub>boot这样,就可以开始安装了