Tag Archives: Linux

Unix常用监控和管理命令

ps:查看系统中的进程,Linux中可以使用ps -aux查看所有进程
参数w表示加宽显示的命令行,参数w可以写多次,通常最多写3次,表示加宽3次,这足以显示很长的命令行了。
例如:ps -auxwww
 
top:显示系统内存、cpu使用情况,并可自动刷新进程列表
 
vmstat:显示当前的内存使用情况
 
netstat:显示网络状况,使用参数p可以查看对应的进程号及程序名,
通常使用参数a(显示所有连接情况)和n(不反查域名和服务名),
例如:netstat -anp
 
查看服务器侦听情况,使用:
netstat -an | grep LISTEN
 
查看服务器已建立的连接,使用:
netstat -an | grep ESTABLISHED
 
ifconfig:查看(或设置)网络设备信息
ifconfig -a:查看所有网络设置信息
 
last:显示登录到服务器的情况以及服务器重启情况
 
df:显示硬盘空间及使用情况,Linux下可以带参数h,显示结果更人性化。例如:
df -h  硬盘空间按人性化显示
df -k  硬盘空间按KB显示
df -m  硬盘空间按MB显示
 
w:显示登录到服务器上的用户列表
 
以下几个命令仅针对Linux
 
lsof:显示当前打开的文件列表,包括建立的socket连接等。本命令可以用于程序员检查编写的程序打开的文件数。
 
sysctl:显示(或设置)系统内核参数
sysctl -a  显示所有内核参数
sysctl -w  参数名=参数值
例如:sysctl -w fs.file-max=10240 设置系统允许同时打开的最大文件数为10240。
 
内核参数fs.file-nr包括三个参数值,第一个参数表示系统中曾经同时打开过的文件数峰值,
第二个参数表示空闲(分配后已释放)的文件数,
第三个参数表示可以打开的最大文件数,其值等于fs.file-max。
 
当前打开的文件数 = 第一个参数值 – 第二个参数值
 
例如:
fs.file-nr = 977        223     10240
当前打开的文件数 = 977 – 233 = 744
 
设置内核参数时务必小心,如果设置不当会导致系统异常,甚至当机。
 
ulimit:显示(或设置)用户可以使用的资源限制
 
ulimit -a  显示用户可以使用的资源限制
 
ulimit unlimited  不限制用户可以使用的资源,但本设置对可打开的最大文件数(max open files)
和可同时运行的最大进程数(max user processes)无效
 
ulimit -n  <可以同时打开的文件数>  设置用户可以同时打开的最大文件数(max open files)
例如:ulimit -n 8192
如果本参数设置过小,对于并发访问量大的网站,可能会出现too many open files的错误
 
ulimit -u  <可以运行的最大并发进程数>  设置用户可以同时运行的最大进程数(max user processes)
例如:ulimit -u 1024

Linux没有Windows安全最新理由:易受外星人入侵

英国权威媒体卫报 (Guardian Newspapers)报道:“科学家研究表明,地球上的电脑很可能遭到外星人的入侵。”目前还没有证据显示Linux能够幸免于这样的入侵。
 
而Windows就没有这样的安全隐患,因为来自Forrester的报道指出“微软是唯一一个100%修正已知漏洞的软件厂商”,“Windows在所有评测的平台当中漏洞及‘高危’漏洞的数目都是最少的”。
 
上述信息显然绝对可靠,因为它是来自微软官方的“Get the FUD”网站。
 
外星高级智慧生命如何侵入Linux
 
既然外星人可以进行星际远航来到地球,他们的科技水平显然远在我们之上。由于开源社区接受来自任何生命体编写的代码,因此不难想象是这些家伙帮助推进了地球上的开源软件运动;它们的科技是如此先进,因此也不难想象其代码中含有隐藏指令会在适当的时候启动并令我们的一切防御体系瘫痪。
 
我们知道Linux之父Linus Torvalds或者Apache等大型开源项目在接受代码前都会进行仔细的检查。但别忘了我们现在谈论的是超前我们很多的外星智慧体,即使是Linus这样的天才也无法发现它们隐藏的恶意代码。想象一下,这样的代码也许就隐藏在一个普通的Linux硬件驱动程序中,然后和OpenOffice、XMMS等程序中其他恶意代码片断结合,最终被一个基于Apache的网站上某条代码信息激活——即使是最为严密的五角大楼电脑网络恐怕也难于抵挡这样渗透方式,随后外星人就可以轻易地制造假目标并将美国的核武器倾泻出去……
 
为什么知识产权软件更安全
 
你有没有试过向微软提交一大堆代码要求加入下一版的Windows中?即使你的编程水平很高恐怕也要吃闭门羹。Windows和其他微软的软件——实际上所有的知识产权软件都由软件厂商员工以及经过挑选的承包商来编写,并不会接受来自陌生人的代码。
 
综上所述,Windows在面对外星黑客入侵威胁的时候要安全的多,最重要的是,外星人无法在Windows中隐藏代码,却可以轻易地成为Linux内核代码贡献者并在Linux中加入邪恶的“复活节彩蛋”。
 
你确定开源软件中的每一条代码都是来自地球人之手吗?我不这么认为。
 
如果你不想受到外星人的攻击,目前最保险的手段就是采用知识产权软件,我已经迫不及待想要删除简单而又稳定的Linux,换上Windows系统。

ps命令

man了一下
-A all processes                      -C by command name
-N negate selection                   -G by real group ID (supports names)
-a all w/ tty except session leaders  -U by real user ID (supports names)
-d all except session leaders         -g by session OR by effective group name
-e all processes                      -p by process ID
T  all processes on this terminal     -s processes in the sessions given
a  all w/ tty, including other users  -t by tty
g  OBSOLETE — DO NOT USE             -u by effective user ID (supports names)
r  only running processes             U  processes for specified users
x  processes w/o controlling ttys     t  by tty
*********** output format **********  *********** long options ***********
-o,o user-defined  -f full            –Group –User –pid –cols –ppid
-j,j job control   s  signal          –group –user –sid –rows –info
-O,O preloaded -o  v  virtual memory  –cumulative –format –deselect
-l,l long          u  user-oriented   –sort –tty –forest –version
-F   extra full    X  registers       –heading –no-heading –context
                    ********* misc options *********
-V,V  show version      L  list format codes  f  ASCII art forest
-m,m,-L,-T,H  threads   S  children in sum    -y change -l format
-M,Z  security data     c  true command name  -c scheduling class
-w,w  wide output       n  numeric WCHAN,UID  -H process hierarchy

Linux常用命令

 Linux之所以受到广大计算机爱好者的喜爱,主要原因有两个,首先它是自由软件,用户不用支付费用就可以使用它,并可根据自己的需要对它进行修改。另外,它具有Unix的全部功能,任何使用Unix系统或想要学习Unix系统的人都可以从中获益。
 
   让我们一起从每一个命令开始,走向Linux高手之路吧。
 
1.Linux进入与退出系统
进入Linux系统:
必须要输入用户的账号,在系统安装过程中可以创建以下两种帐号:
   1.root–超级用户帐号(系统管理员),使用这个帐号可以在系统中做任何事情。
   2.普通用户–这个帐号供普通用户使用,可以进行有限的操作。
   一般的Linux使用者均为普通用户,而系统管理员一般使用超级用户帐号完成一些系统管理的工作。如果只需要完成一些由普通帐号就能完成的任务,建议不要使用超级用户帐号,以免无意中破坏系统。影响系统的正常运行。
   用户登录分两步:第一步,输入用户的登录名,系统根据该登录名识别用户;第二步,输入用户的口令,该口令是用户自己设置的一个字符串,对其他用户是保密的,是在登录时系统用来辨别真假用户的关键字。
   当用户正确地输入用户名和口令后,就能合法地进入系统。屏幕显示:
[root@loclhost /root] #
 
这时就可以对系统做各种操作了。注意超级用户的提示符是“#”,其他用户的提示符是“$”。
 
修改口令
   为了更好的保护用户帐号的安全,Linux允许用户随时修改自己的口令,修改口令的命令是passwd,它将提示用户输入旧口令和新口令,之后还要求用户再次确认新口令,以避免用户无意中按错键。如果用户忘记了口令,可以向系统管理员申请为自己重新设置一个。
 
虚拟控制台
   Linux是一个真正的多用户操作系统,它可以同时接受多个用户登录。Linux还允许一个用户进行多次登录,这是因为Linux和UNIX一样,提供了虚拟控制台的访问方式,允许用户在同一时间从控制台进行多次登录。虚拟控制台的选择可以通过按下Alt键和一个功能键来实现,通常使用F1-F6例如,用户登录后,按一下Alt-F2键,用户又可以看到"login:"提示符,说明用户看到了第二个虚拟控制台。然后只需按Alt-F1键,就可以回到第一个虚拟控制台。 一个新安装的Linux系统默认允许用户使用Alt-F1到Alt-F6键来访问前六个虚拟控制台。虚拟控制台可使用户同时在多个控制台上工作,真正体现Linux系统多用户的特性。用户可以在某一虚拟控制台上进行的工作尚未结束时,切换到另一虚拟控制台开始另一项工作。
 
退出系统
   不论是超级用户,还是普通用户,需要退出系统时,在shell提示符下,键入exit命令即可。
 
Linux文件的复制、删除和移动命令
 
cp命令
该命令的功能是将给出的文件或目录拷贝到另一文件或目录中,同MSDOS下的copy命令一样,功能十分强大。
 
语法: cp [选项] 源文件或目录 目标文件或目录
 
说明:该命令把指定的源文件复制到目标文件或把多个源文件复制到目标目录中。
 
该命令的各选项含义如下:
 
– a 该选项通常在拷贝目录时使用。它保留链接、文件属性,并递归地拷贝目录,其作用等于dpR选项的组合。
 
– d 拷贝时保留链接。
 
– f 删除已经存在的目标文件而不提示。
 
– i 和f选项相反,在覆盖目标文件之前将给出提示要求用户确认。回答y时目标文件将被覆盖,是交互式拷贝。
 
– p 此时cp除复制源文件的内容外,还将把其修改时间和访问权限也复制到新文件中。
 
– r 若给出的源文件是一目录文件,此时cp将递归复制该目录下所有的子目录和文件。此时目标文件必须为一个目录名。
 
– l 不作拷贝,只是链接文件。
 
   需要说明的是,为防止用户在不经意的情况下用cp命令破坏另一个文件,如用户指定的目标文件名已存在,用cp命令拷贝文件后,这个文件就会被新源文件覆盖,因此,建议用户在使用cp命令拷贝文件时,最好使用i选项。
 
mv命令
 
用户可以使用mv命令来为文件或目录改名或将文件由一个目录移入另一个目录中。该命令如同MSDOS下的ren和move的组合。
 
语法:mv [选项] 源文件或目录 目标文件或目录
 
说明:视mv命令中第二个参数类型的不同(是目标文件还是目标目录),mv命令将文件重命名或将其移至一个新的目录中。当第二个参数类型是文件时,mv命令完成文件重命名,此时,源文件只能有一个(也可以是源目录名),它将所给的源文件或目录重命名为给定的目标文件名。当第二个参数是已存在的目录名称时,源文件或目录参数可以有多个,mv命令将各参数指定的源文件均移至目标目录中。在跨文件系统移动文件时,mv先拷贝,再将原有文件删除,而链至该文件的链接也将丢失。
 
命令中各选项的含义为:
 
– I 交互方式操作。如果mv操作将导致对已存在的目标文件的覆盖,此时系统询问是否重写,要求用户回答y或n,这样可以避免误覆盖文件。
 
– f 禁止交互操作。在mv操作要覆盖某已有的目标文件时不给任何指示,指定此选项后,i选项将不再起作用。
 
如果所给目标文件(不是目录)已存在,此时该文件的内容将被新文件覆盖。为防止用户用mv命令破坏另一个文件,使用mv命令移动文件时,最好使用i选项。
 
 
 
rm命令
 
用户可以用rm命令删除不需要的文件。该命令的功能为删除一个目录中的一个或多个文件或目录,它也可以将某个目录及其下的所有文件及子目录均删除。对于链接文件,只是断开了链接,原文件保持不变。
 
rm命令的一般形式为:
 
rm [选项] 文件…
 
如果没有使用- r选项,则rm不会删除目录。
 
该命令的各选项含义如下:
 
– f 忽略不存在的文件,从不给出提示。
 
– r 指示rm将参数中列出的全部目录和子目录均递归地删除。
 
– i 进行交互式删除。
 
使用rm命令要小心。因为一旦文件被删除,它是不能被恢复的。了防止这种情况的发生,可以使用i选项来逐个确认要删除的文件。如果用户输入y,文件将被删除。如果输入任何其他东西,文件则不会删除。
 
Linux目录的创建与删除命令
mkdir命令
 
功能:创建一个目录(类似MSDOS下的md命令)。
 
语法:mkdir [选项] dir-name
 
说明:该命令创建由dir-name命名的目录。要求创建目录的用户在当前目录中(dir-name的父目录中)具有写权限,并且dirname不能是当前目录中已有的目录或 文件名称。
 
命令中各选项的含义为:
 
– m 对新建目录设置存取权限。也可以用chmod命令设置。
 
– p 可以是一个路径名称。此时若路径中的某些目录尚不存在, 加上此选项后, 系统将自动建立好那些尚不存在的目录,即一次可以建立多个目录。
 
 
 
rmdir 命令
 
功能:删除空目录。
 
语法:rmdir [选项] dir-name
 
说明:dir-name表示目录名。该命令从一个目录中删除一个或多个子目录项。需要 特别注意的是,一个目录被删除之前必须是空的。rm – r dir命令可代替 rmdir,但是有危险性。删除某目录时也必须具有对父目录的写权限。
 
命令中各选项的含义为:
 
– p 递归删除目录dirname,当子目录删除后其父目录为空时,也一同被删除。如果整个路径被删除或者由于某种原因保留部分路径,则系统在标准输出上显示相应 的信息。
 
 
 
cd 命令
 
功能:改变工作目录。
 
语法:cd [directory]
 
说明:该命令将当前目录改变至directory所指定的目录。若没有指定directory, 则回到用户的主目录。为了改变到指定目录,用户必须拥有对指定目录的执行和读 权限。
 
该命令可以使用通配符(通配符含义请参见第十章)。
 
pwd 命令
 
在Linux层次目录结构中,用户可以在被授权的任意目录下利用mkdir命令创建新目录,也可以利用cd命令从一个目录转换到另一个目录。然而,没有提示符来告知用 户目前处于哪一个目录中。要想知道当前所处的目录,可以使用pwd命令,该命令显示整个路径名。
 
语法:pwd
 
说明:此命令显示出当前工作目录的绝对路径。
 
 
 
ls 命令
 
ls是英文单词list的简写,其功能为列出目录的内容。这是用户最常用的一个命令之一,因为用户需要不时地查看某个目录的内容。该命令类似于DOS下的dir命令。
 
语法:ls [选项] [目录或是文件]
 
对于每个目录,该命令将列出其中的所有子目录与文件。对于每个文件,ls将输出 其文件名以及所要求的其他信息。默认情况下,输出条目按字母顺序排序。当未给出目录名或是文件名时,就显示当前目录的信息。
 
命令中各选项的含义如下:
 
– a 显示指定目录下所有子目录与文件,包括隐藏文件。
 
– A 显示指定目录下所有子目录与文件,包括隐藏文件。但不列出“.”和 “..”。
 
– b 对文件名中的不可显示字符用八进制逃逸字符显示。
 
– c 按文件的修改时间排序。
 
– C 分成多列显示各项。
 
– d 如果参数是目录,只显示其名称而不显示其下的各文件。往往与l选项一起使 用,以得到目录的详细信息。
 
– f 不排序。该选项将使lts选项失效,并使aU选项有效。
 
– F 在目录名后面标记“/”,可执行文件后面标记“*”,符号链接后面标记 “@”,管道(或FIFO)后面标记“|”,socket文件后面标记“=”。
 
– i 在输出的第一列显示文件的i节点号。
 
– l 以长格式来显示文件的详细信息。这个选项最常用。
 
每行列出的信息依次是: 文件类型与权限 链接数 文件属主 文件属组 文件大小 建立或最近修改的时间 名字
 
对于符号链接文件,显示的文件名之后有“—〉”和引用文件路径名。
 
对于设备文件,其“文件大小”字段显示主、次设备号,而不是文件大小。
 
目录中的总块数显示在长格式列表的开头,其中包含间接块。
 
– L 若指定的名称为一个符号链接文件,则显示链接所指向的文件。
 
– m 输出按字符流格式,文件跨页显示,以逗号分开。
 
– n 输出格式与l选项相同,只不过在输出中文件属主和属组是用相应的UID号和 GID号来表示,而不是实际的名称。
 
– o 与l选项相同,只是不显示拥有者信息。
 
– p 在目录后面加一个“/”。
 
– q 将文件名中的不可显示字符用“?”代替。
 
– r 按字母逆序或最早优先的顺序显示输出结果。
 
– R 递归式地显示指定目录的各个子目录中的文件。
 
– s 给出每个目录项所用的块数,包括间接块。
 
– t 显示时按修改时间(最近优先)而不是按名字排序。若文件修改时间相同,则 按字典顺序。修改时间取决于是否使用了c或u选顶。缺省的时间标记是最后一次修 改时间。
 
– u 显示时按文件上次存取的时间(最近优先)而不是按名字排序。即将-t的时间 标记修改为最后一次访问的时间。
 
– x 按行显示出各排序项的信息。
 
用ls – l命令显示的信息中,开头是由10个字符构成的字符串,其中第一个字符表示文件类型,它可以是下述类型之一:
 
– 普通文件
 
d 目录
 
l 符号链接
 
b 块设备文件
 
c 字符设备文件
 
后面的9个字符表示文件的访问权限,分为3组,每组3位。
 
第一组表示文件属主的权限,第二组表示同组用户的权限,第三组表示其他用户的权限。每一组的三个字 符分别表示对文件的读、写和执行权限。
 
各权限如下所示:
 
r 读
 
w 写
 
x 执行。对于目录,表示进入权限。
 
s 当文件被执行时,把该文件的UID或GID赋予执行进程的UID(用户ID)或GID(组 ID)。
 
t 设置标志位(留在内存,不被换出)。如果该文件是目录,在该目录中的文件只能被超级用户、目录拥有者或文件属主删除。如果它是可执行文件,在该文件执行 后,指向其正文段的指针仍留在内存。这样再次执行它时,系统就能更快地装入该文件。
 
Linux文本处理命令
sort命令
 
sort命令的功能是对文件中的各行进行排序。sort命令有许多非常实用的选项,这些选项最初是用来对数据库格式的文件内容进行各种排序操作的。实际上,sort命令可以被认为是一个非常强大的数据管理工具,用来管理内容类似数据库记录的文件。
 
Sort命令将逐行对文件中的内容进行排序,如果两行的首字符相同,该命令将继续比较这两行的下一字符,如果还相同,将继续进行比较。
 
语法:
 
sort [选项] 文件
 
说明:sort命令对指定文件中所有的行进行排序,并将结果显示在标准输出上。如不指定输入文件或使用“- ”,则表示排序内容来自标准输入。
 
sort排序是根据从输入行抽取的一个或多个关键字进行比较来完成的。排序关键字定义了用来排序的最小的字符序列。缺省情况下以整行为关键字按ASCII字符顺序进行排序。
 
改变缺省设置的选项主要有:
 
– m 若给定文件已排好序,合并文件。
 
– c 检查给定文件是否已排好序,如果它们没有都排好序,则打印一个出错信息,并以状态值1退出。
 
– u 对排序后认为相同的行只留其中一行。
 
– o 输出文件 将排序输出写到输出文件中而不是标准输出,如果输出文件是输入文件之一,sort先将该文件的内容写入一个临时文件,然后再排序和写输出结果。
 
改变缺省排序规则的选项主要有:
 
– d 按字典顺序排序,比较时仅字母、数字、空格和制表符有意义。
 
– f 将小写字母与大写字母同等对待。
 
– I 忽略非打印字符。
 
– M 作为月份比较:“JAN”<“FEB”
 
– r 按逆序输出排序结果。
 
+posl – pos2 指定一个或几个字段作为排序关键字,字段位置从posl开始,到pos2为止(包括posl,不包括pos2)。如不指定pos2,则关键字为从posl到行尾。字段和字符的位置从0开始。
 
– b 在每行中寻找排序关键字时忽略前导的空白(空格和制表符)。
 
– t separator 指定字符separator作为字段分隔符。
 
 
 
uniq命令
 
文件经过处理后在它的输出文件中可能会出现重复的行。例如,使用cat命令将两个文件合并后,再使用sort命令进行排序,就可能出现重复行。这时可以使用uniq命令将这些重复行从输出文件中删除,只留下每条记录的唯一样本。
 
语法:
 
uniq [选项] 文件
 
说明:这个命令读取输入文件,并比较相邻的行。在正常情况下,第二个及以后更多个重复行将被删去,行比较是根据所用字符集的排序序列进行的。该命令加工后的结果写到输出文件中。输入文件和输出文件必须不同。如果输入文件用“- ”表示,则从标准输入读取。
 
该命令各选项含义如下:
 
– c 显示输出中,在每行行首加上本行在文件中出现的次数。它可取代- u和- d选项。
 
– d 只显示重复行。
 
– u 只显示文件中不重复的各行。
 
– n 前n个字段与每个字段前的空白一起被忽略。一个字段是一个非空格、非制表符的字符串,彼此由制表符和空格隔开(字段从0开始编号)。
 
+n 前n个字符被忽略,之前的字符被跳过(字符从0开始编号)。
 
– f n 与- n相同,这里n是字段数。
 
– s n 与+n相同,这里n是字符数。
 
Linux备份与压缩命令
 
tar命令
 
tar可以为文件和目录创建档案。利用tar,用户可以为某一特定文件创建档案(备份文件),也可以在档案中改变文件,或者向档案中加入新的文件。tar最初被用来在磁带上创建档案,现在,用户可以在任何设备上创建档案,如软盘。利用tar命令,可以把一大堆的文件和目录全部打包成一个文件,这对于备份文件或将几个文件组合成为一个文件以便于网络传输是非常有用的。Linux上的tar是GNU版本的。
 
语法:tar [主选项+辅选项] 文件或者目录
 
使用该命令时,主选项是必须要有的,它告诉tar要做什么事情,辅选项是辅助使用的,可以选用。
 
主选项:
 
c 创建新的档案文件。如果用户想备份一个目录或是一些文件,就要选择这个选项。
 
r 把要存档的文件追加到档案文件的未尾。例如用户已经作好备份文件,又发现还有一个目录或是一些文件忘记备份了,这时可以使用该选项,将忘记的目录或文件追加到备份文件中。
 
t 列出档案文件的内容,查看已经备份了哪些文件。
 
u 更新文件。就是说,用新增的文件取代原备份文件,如果在备份文件中找不到要更新的文件,则把它追加到备份文件的最后。
 
x 从档案文件中释放文件。
 
辅助选项:
 
b 该选项是为磁带机设定的。其后跟一数字,用来说明区块的大小,系统预设值为20(20*512 bytes)。
 
f 使用档案文件或设备,这个选项通常是必选的。
 
k 保存已经存在的文件。例如我们把某个文件还原,在还原的过程中,遇到相同的文件,不会进行覆盖。
 
m 在还原文件时,把所有文件的修改时间设定为现在。
 
M 创建多卷的档案文件,以便在几个磁盘中存放。
 
v 详细报告tar处理的文件信息。如无此选项,tar不报告文件信息。
 
w 每一步都要求确认。
 
z 用gzip来压缩/解压缩文件,加上该选项后可以将档案文件进行压缩,但还原时也一定要使用该选项进行解压缩。
 
 
 
gzip命令
 
减少文件大小有两个明显的好处,一是可以减少存储空间,二是通过网络传输文件时,可以减少传输的时间。gzip是在Linux系统中经常使用的一个对文件进行压缩和解压缩的命令,既方便又好用。
 
语法:gzip [选项] 压缩(解压缩)的文件名
 
各选项的含义:
 
-c 将输出写到标准输出上,并保留原有文件。
 
-d 将压缩文件解压。
 
-l 对每个压缩文件,显示下列字段:
 
压缩文件的大小
 
未压缩文件的大小
 
压缩比
 
未压缩文件的名字
 
-r 递归式地查找指定目录并压缩其中的所有文件或者是解压缩。
 
-t 测试,检查压缩文件是否完整。
 
-v 对每一个压缩和解压的文件,显示文件名和压缩比。
 
-num 用指定的数字num调整压缩的速度,-1或–fast表示最快压缩方法(低压缩比),-9或–best表示最慢压缩方法(高压缩比)。系统缺省值为6。
 
 
 
unzip命令
 
用MS Windows下的压缩软件winzip压缩的文件如何在Linux系统下展开呢?可以用unzip命令,该命令用于解扩展名为.zip的压缩文件。
 
语法:unzip [选项] 压缩文件名.zip
 
各选项的含义分别为:
 
-x 文件列表 解压缩文件,但不包括指定的file文件。
 
-v 查看压缩文件目录,但不解压。
 
-t 测试文件有无损坏,但不解压。
 
-d 目录 把压缩文件解到指定目录下。
 
-z 只显示压缩文件的注解。
 
-n 不覆盖已经存在的文件。
 
-o 覆盖已存在的文件且不要求用户确认。
 
-j 不重建文档的目录结构,把所有文件解压到同一目录下。
 
在Linux环境下运行DOS命令   
 
Linux系统提供了一组称为mtools的可移植工具,可以让用户轻松地从标准的DOS软盘上读、写文件和目录。它们对DOS和Linux环境之间交换文件非常有用。它们是不具备共同的文件系统格式的系统之间交换文件的有力手段。对于一个MSDOS的软盘,只要把软盘放在软驱中,就可以利用mtools提供的命令来访问软盘上的文件。
 
mtools的主要命令如下:
 
mcd 目录名 改变MSDOS目录;
 
mcopy 源文件 目标文件 在MSDOS和Unix之间复制文件;
 
mdel 文件名 删除MSDOS文件;
 
mdir 目录名 显示MSDOS目录;
 
mformat 驱动器号 在低级格式化的软盘上创建MSDOS文件系统;
 
rnlabel 驱动器号 产生MSDOS卷标;
 
mmd 目录名 建立MSDOS目录;
 
mrd 目录名 删除MSDOS目录;
 
mren 源文件 目标文件 重新命名已存在的MSDOS文件;
 
mtype 文件名 显示MSDOS文件的内容。
 
提示:这些命令和对应的MSDOS命令非常相似。
 
Linux改变文件或目录的访问权限命令
   Linux系统中的每个文件和目录都有访问许可权限,用它来确定谁可以通过何种方式对文件和目录进行访问和操作。
 
   文件或目录的访问权限分为只读,只写和可执行三种。以文件为例,只读权限表示只允许读其内容,而禁止对其做任何的更改操作。可执行权限表示允许将该文件作为一个程序执行。文件被创建时,文件所有者自动拥有对该文件的读、写和可执行权限,以便于对文件的阅读和修改。用户也可根据需要把访问权限设置为需要的任何组合。
 
   有三种不同类型的用户可对文件或目录进行访问:文件所有者,同组用户、其他用户。所有者一般是文件的创建者。所有者可以允许同组用户有权访问文件,还可以将文件的访问权限赋予系统中的其他用户。在这种情况下,系统中每一位用户都能访问该用户拥有的文件或目录。
 
   每一文件或目录的访问权限都有三组,每组用三位表示,分别为文件属主的读、写和执行权限;与属主同组的用户的读、写和执行权限;系统中其他用户的读、写和执行权限。当用ls -l命令显示文件或目录的详细信息时,最左边的一列为文件的访问权限。例如:
 
   $ ls -l sobsrc. tgz
 
   -rw-r–r– 1 root root 483997 Ju1 l5 17:3l sobsrc. tgz
 
   横线代表空许可。r代表只读,w代表写,x代表可执行。注意这里共有10个位置。第一个字符指定了文件类型。在通常意义上,一个目录也是一个文件。如果第一个字符是横线,表示是一个非目录的文件。如果是d,表示是一个目录。
 
   例如:
 
   – rw- r– r–
 
   普通文件 文件主 组用户 其他用户
 
   是文件sobsrc.tgz 的访问权限,表示sobsrc.tgz是一个普通文件;sobsrc.tgz的属主有读写权限;与sobsrc.tgz属主同组的用户只有读权限;其他用户也只有读权限。
 
   确定了一个文件的访问权限后,用户可以利用Linux系统提供的chmod命令来重新设定不同的访问权限。也可以利用chown命令来更改某个文件或目录的所有者。利用chgrp命令来更改某个文件或目录的用户组。
 
   下面分别对这些命令加以介绍。
 
   chmod 命令
 
   chmod命令是非常重要的,用于改变文件或目录的访问权限。用户用它控制文件或目录的访问权限。
 
   该命令有两种用法。一种是包含字母和操作符表达式的文字设定法;另一种是包含数字的数字设定法。
 
   1. 文字设定法
 
   chmod [who] [+ | – | =] [mode] 文件名?
 
   命令中各选项的含义为:
 
   操作对象who可是下述字母中的任一个或者它们的组合:
 
   u 表示“用户(user)”,即文件或目录的所有者。
 
   g 表示“同组(group)用户”,即与文件属主有相同组ID的所有用户。
 
   o 表示“其他(others)用户”。
 
   a 表示“所有(all)用户”。它是系统默认值。
 
   操作符号可以是:
 
   + 添加某个权限。
 
   – 取消某个权限。
 
   = 赋予给定权限并取消其他所有权限(如果有的话)。
 
   设置mode所表示的权限可用下述字母的任意组合:
 
   r 可读。
 
   w 可写。
 
   x 可执行。
 
   X 只有目标文件对某些用户是可执行的或该目标文件是目录时才追加x 属性。
 
   s 在文件执行时把进程的属主或组ID置为该文件的文件属主。方式“u+s”设置文件的用户ID位,“g+s”设置组ID位。
 
   t 保存程序的文本到交换设备上。
 
  u 与文件属主拥有一样的权限。
 
   g 与和文件属主同组的用户拥有一样的权限。
 
   o 与其他用户拥有一样的权限。
 
   文件名:以空格分开的要改变权限的文件列表,支持通配符。
 
   在一个命令行中可给出多个权限方式,其间用逗号隔开。例如:chmod g+r,o+r example
 
   使同组和其他用户对文件example 有读权限。
 
   2. 数字设定法
 
   我们必须首先了解用数字表示的属性的含义:0表示没有权限,1表示可执行权限,2表示可写权限,4表示可读权限,然后将其相加。所以数字属性的格式应为3个从0到7的八进制数,其顺序是(u)(g)(o)。
 
   例如,如果想让某个文件的属主有“读/写”二种权限,需要把4(可读)+2(可写)=6(读/写)。
 
   数字设定法的一般形式为:
 
   chmod [mode] 文件名?
 
 
 
   chgrp命令
 
  功能:改变文件或目录所属的组。
 
   语法:chgrp [选项] group filename?
 
   该命令改变指定指定文件所属的用户组。其中group可以是用户组ID,也可以是/etc/group文件中用户组的组名。文件名是以空格分开的要改变属组的文件列表,支持通配符。如果用户不是该文件的属主或超级用户,则不能改变该文件的组。
 
   该命令的各选项含义为:
 
   – R 递归式地改变指定目录及其下的所有子目录和文件的属组。
 
   chown 命令
 
   功能:更改某个文件或目录的属主和属组。这个命令也很常用。例如root用户把自己的一个文件拷贝给用户xu,为了让用户xu能够存取这个文件,root用户应该把这个文件的属主设为xu,否则,用户xu无法存取这个文件。
 
   语法:chown [选项] 用户或组 文件
 
   说明:chown将指定文件的拥有者改为指定的用户或组。用户可以是用户名或用户ID。组可以是组名或组ID。文件是以空格分开的要改变权限的文件列表,支持通配符。
 
  该命令的各选项含义如下:
 
   – R 递归式地改变指定目录及其下的所有子目录和文件的拥有者。
 
   – v 显示chown命令所做的工作。
 
Linux与用户有关的命令
 
passwd命令
 
出于系统安全考虑,Linux系统中的每一个用户除了有其用户名外,还有其对应的用户口令。因此使用useradd命令增加时,还需使用passwd命令为每一位新增加的用户设置口令;用户以后还可以随时用passwd命令改变自己的口令。
 
该命令的一般格式为: passwd [用户名] 其中用户名为需要修改口令的用户名。只有超级用户可以使用“passwd 用户名”修改其他用户的口令,普通用户只能用不带参数的passwd命令修改自己的口令。
 
该命令的使用方法如下:
 
输入
 
passwd< Enter>;
 
在(current) UNIX passwd:下输入当前的口令
 
在new password:提示下输入新的口令(在屏幕上看不到这个口令):
 
系统提示再次输入这个新口令。
 
输入正确后,这个新口令被加密并放入/etc/shdow文件。选取一个不易被破译的口令是很重要的。
 
选取口令应遵守如下规则:
 
口令应该至少有六位(最好是八位)字符;
 
口令应该是大小写字母、标点符号和数字混杂的。
 
超级用户修改其他用户(xxq)的口令的过程如下,
 
# passwd root
 
New UNIX password:
 
Retype new UNIX password:
 
passwd: all authentication tokens updated successfully
 
#
 
 
 
su命令
 
这个命令非常重要。它可以让一个普通用户拥有超级用户或其他用户的权限,也可以让超级用户以普通用户的身份做一些事情。普通用户使用这个命令时必须有超级用户或其他用户的口令。如要离开当前用户的身份,可以打exit。
 
该命令的一般形式为: su [选项] [? ] [使用者帐号]
 
说明:若没有指定使用者帐号,则系统预设值为超级用户root。 该命令中各选项的含义分别为:
 
? c 执行一个命令后就结束。
 
? 加了这个减号的目的是使环境变量和欲转换的用户相同。
 
? m 保留环境变量不变。
 
password: 【输入超级用户的密码】  
 
Linux系统管理命令
 
wall命令
 
这个命令的功能是对全部已登录的用户发送信息,用户可以先把要发送的信息写好存入一个文件中,然后输入:
 
# wall < 文件名
 
这样就能对所有的用户发送信息了。
 
在上面的例子中符号“<”表示输入重定向,有关它的含义和用法请参阅第十章的有关内容。 例如:
 
# wall ‘Thank you!’
 
Broadcast message from root (tty1) Fri Nov 26 14:15:07 1999…
 
Thank you!
 
#
 
执行以上命令后,用户的屏幕上显示出“Thank you!”信息后,并不出现系统提示符$(#),再次按回车键后,屏幕出现系统提示符。
 
 
 
write命令
 
write命令的功能是向系统中某一个用户发送信息。 该命令的一般格式为:
 
write 用户帐号 [终端名称]
 
例如: $ write Guest hello
 
此时系统进入发送信息状态,用户可以输入要发送的信息,输入完毕,希望退出发送状态时,按组合键< Ctrl+c>即可。
 
 
 
mesg指令
 
mesg命令设定是否允许其他用户用write命令给自己发送信息。如果允许别人给自己发送信息,输入命令:
 
# mesg y
 
否则,输入:
 
# mesg n
 
对于超级用户,系统的默认值为 n;而对于一般用户系统的默认值为y。 如果mesg后不带任何参数,则显示当前的状态是y还是n.。
 
 
 
sync命令
 
   sync命令是在关闭Linux系统时使用的。 用户需要注意的是,不能用简单的关闭电源的方法关闭系统,因为Linux象其他Unix系统一样,在内存中缓存了许多数据,在关闭系统时需要进行内存数据与硬盘数据的同步校验,保证硬盘数据在关闭系统时是最新的,只有这样才能确保数据不会丢失。一般正常的关闭系统的过程是自动进行这些工作的,在系统运行过程中也会定时做这些工作,不需要用户干预。 sync命令是强制把内存中的数据写回硬盘,以免数据的丢失。用户可以在需要的时候使用此命令。该命令的一般格式为:
 
   sync
 
 
 
shutdown命令
 
shutdown 命令可以安全地关闭或重启Linux系统,它在系统关闭之前给系统上的所有登录用户提示一条警告信息。该命令还允许用户指定一个时间参数,可以是一个精确的时间,也可以是从现在开始的一个时间段。精确时间的格式是hh:mm,表示小时和分钟;时间段由“+”和分钟数表示。系统执行该命令后,会自动进行数据同步的工作。
 
该命令的一般格式为: shutdown [选项] [时间] [警告信息] 命令中各选项的含义为:
 
– k 并不真正关机,而只是发出警告信息给所有用户。
 
– r 关机后立即重新启动。
 
– h 关机后不重新启动。
 
– f 快速关机,重启动时跳过fsck。
 
– n 快速关机,不经过init程序。
 
– c 取消一个已经运行的shutdown。
 
需要特别说明的是,该命令只能由超级用户使用。
 
 
 
free命令
 
free命令的功能是查看当前系统内存的使用情况,它显示系统中剩余及已用的物理内存和交换内存,以及共享内存和被核心使用的缓冲区。
 
该命令的一般格式为: free [-b | -k | -m] 命令中各选项的含义如下:
 
-b 以字节为单位显示。
 
-k 以K字节为单位显示。
 
-m 以兆字节为单位显示。
 
 
 
uptime命令
 
uptime命令显示系统已经运行了多长时间,它依次显示下列信息:现在时间、系统已经运行了多长时间、目前有多少登录用户、系统在过去的1分钟、5分钟和15分钟内的平均负载。
 
该命令的一般格式为: uptime
 
Linux磁盘管理
 
df命令
 
功能:检查文件系统的磁盘空间占用情况。可以利用该命令来获取硬盘被占用了多少空间,目前还剩下多少空间等信息。
 
语法:df [选项]
 
说明:df命令可显示所有文件系统对i节点和磁盘块的使用情况。
 
该命令各个选项的含义如下:
 
-a 显示所有文件系统的磁盘使用情况,包括0块(block)的文件系统,如/proc文件系统。
 
-k 以k字节为单位显示。
 
-i 显示i节点信息,而不是磁盘块。
 
-t 显示各指定类型的文件系统的磁盘空间使用情况。
 
-x 列出不是某一指定类型文件系统的磁盘空间使用情况(与t选项相反)。
 
-T 显示文件系统类型。
 
 
 
du命令
 
du的英文原义为“disk usage”,含义为显示磁盘空间的使用情况。
 
功能:统计目录(或文件)所占磁盘空间的大小。
 
语法:du [选项] [Names…]
 
说明:该命令逐级进入指定目录的每一个子目录并显示该目录占用文件系统数据块(1024字节)的情况。若没有给出Names,则对当前目录进行统计。
 
该命令的各个选项含义如下:
 
-s 对每个Names参数只给出占用的数据块总数。
 
-a 递归地显示指定目录中各文件及子孙目录中各文件占用的数据块数。若既不指定-s,也不指定-a,则只显示Names中的每一个目录及其中的各子目录所占的磁盘块数。
 
-b 以字节为单位列出磁盘空间使用情况(系统缺省以k字节为单位)。
 
-k 以1024字节为单位列出磁盘空间使用情况。
 
-c 最后再加上一个总计(系统缺省设置)。
 
-l 计算所有的文件大小,对硬链接文件,则计算多次。
 
-x 跳过在不同文件系统上的目录不予统计。
 
 
 
dd命令
 
功能:把指定的输入文件拷贝到指定的输出文件中,并且在拷贝过程中可以进行格式转换。可以用该命令实现DOS下的diskcopy命令的作用。先用dd命令把软盘上的数据写成硬盘的一个寄存文件,再把这个寄存文件写入第二张软盘上,完成diskcopy的功能。需要注意的是,应该将硬盘上的寄存文件用rm命令删除掉。系统默认使用标准输入文件和标准输出文件。
 
语法:dd [选项]
 
if =输入文件(或设备名称)。
 
of =输出文件(或设备名称)。
 
ibs = bytes 一次读取bytes字节,即读入缓冲区的字节数。
 
skip = blocks 跳过读入缓冲区开头的ibs*blocks块。
 
obs = bytes 一次写入bytes字节,即写入缓冲区的字节数。
 
bs = bytes 同时设置读/写缓冲区的字节数(等于设置ibs和obs)。
 
cbs = byte 一次转换bytes字节。
 
count=blocks 只拷贝输入的blocks块。
 
conv = ASCII 把EBCDIC码转换为ASCIl码。
 
conv = ebcdic 把ASCIl码转换为EBCDIC码。
 
conv = ibm 把ASCIl码转换为alternate EBCDIC码。
 
conv = block 把变动位转换成固定字符。
 
conv = ublock 把固定位转换成变动位。
 
conv = ucase 把字母由小写转换为大写。
 
conv = lcase 把字母由大写转换为小写。
 
conv = notrunc 不截短输出文件。
 
conv = swab 交换每一对输入字节。
 
conv = noerror 出错时不停止处理。
 
conv = sync 把每个输入记录的大小都调到ibs的大小(用NUL填充)。
 
 
 
fdformat 命令
 
软盘是用户常用的存储介质之一。软盘在使用之前必须先作格式化操作,然后可以用tar、dd、cpio等命令存储数据,也可以在软盘上建立可安装的文件系统。
 
功能:低级格式化软盘
 
语法:format [-n] device
 
说明:该命令的作用是对软盘进行格式化。
 
-n 软盘格式化后不作检验。
 
device 指定要进行格式化的设备,通常是下述设备之一:
 
/dev/fd0d360
 
/dev/fd0h1200
 
/dev/fd0D360
 
/dev/fd0H360
 
/dev/fd0D720
 
/dev/fd0H720
 
/dev/fd0h360
 
/dev/fd0h720
 
/dev/fd0H1440
 
Linux其它命令
 
echo命令
 
echo命令的功能是在显示器上显示一段文字,一般起到一个提示的作用。
 
该命令的一般格式为: echo [ -n ] 字符串
 
其中选项n表示输出文字后不换行;字符串可以加引号,也可以不加引号。用echo命令输出加引号的字符串时,将字符串原样输出;用echo命令输出不加引号的字符串时,将字符串中的各个单词作为字符串输出,各字符串之间用一个空格分割。
 
 
 
cal命令
 
cal命令的功能是显示某年某月的日历。
 
该命令的一般格式为: cal [选项] [月 [年]] 命令中各选项的含义为:
 
– j 显示出给定月中的每一天是一年中的第几天(从1月1日算起)。
 
– y 显示出整年的日历。
 
 
 
date命令
 
date命令的功能是显示和设置系统日期和时间。
 
该命令的一般格式为: date [选项] 显示时间格式(以+开头,后面接格式)
 
date 设置时间格式
 
命令中各选项的含义分别为:
 
-d datestr, –date datestr 显示由datestr描述的日期
 
-s datestr, –set datestr 设置datestr 描述的日期
 
-u, –universal 显示或设置通用时间
 
时间域
 
% H 小时(00..23)
 
% I 小时(01..12)
 
% k 小时(0..23)
 
% l 小时(1..12)
 
% M 分(00..59)
 
% p 显示出AM或PM
 
% r 时间(hh:mm:ss AM或PM),12小时
 
% s 从1970年1月1日00:00:00到目前经历的秒数
 
% S 秒(00..59)
 
% T 时间(24小时制)(hh:mm:ss)
 
% X 显示时间的格式(%H:%M:%S)
 
% Z 时区 日期域
 
% a 星期几的简称( Sun..Sat)
 
% A 星期几的全称( Sunday..Saturday)
 
% b 月的简称(Jan..Dec)
 
% B 月的全称(January..December)
 
% c 日期和时间( Mon Nov 8 14:12:46 CST 1999)
 
% d 一个月的第几天(01..31)
 
% D 日期(mm/dd/yy)
 
% h 和%b选项相同
 
% j 一年的第几天(001..366)
 
% m 月(01..12)
 
% w 一个星期的第几天(0代表星期天)
 
% W 一年的第几个星期(00..53,星期一为第一天)
 
% x 显示日期的格式(mm/dd/yy)
 
% y 年的最后两个数字( 1999则是99)
 
% Y 年(例如:1970,1996等)
 
注意:只有超级用户才有权限使用date命令设置时间,一般用户只能使用date命令显示时间。
 
 
 
clear命令
 
clear命令的功能是清除屏幕上的信息,它类似于DOS中的 cls命令。清屏后,提示符移动到屏幕左上角。

Linux is Not Windows

If, as I do, you spend any amount of time on a Linux forum, you’ll eventually grow exasperated, as I did, by the number of posts that run something like this:

"Hi! I’ve been using Linux for a few days, and it’s mostly great. But, it’s a shame that [something or other] doesn’t work like it does on Windows. Why don’t all the developers completely rewrite all the software so it acts more like Windows? I’m sure Linux would get lots more users if they did!"

You may even have had a go at answering these questions, only to be shot down in flames by a Linux newbie who takes it as read that his idea, based on years of experience with a different OS plus a few hours on Linux, is revolutionarily brilliant, and you only don’t like it because you’re an "old-school Linux user" who thinks that GUIs are the spawn of the Devil and everybody should be forced to stick to the CLI.

This article is aimed at explaining to those newbies exactly why their ideas tend to get flamed rather than embraced.

First and foremost, the most cherished argument: "If Linux did this, it would get lots more people converting from Windows!"

So, allow me to explain something that is fundamental to understanding Linux: The Linux community is not trying to provide the average Windows user with a replacement OS. The goal of Linux is not "Linux on every desktop".

Really. It honestly isn’t.. Yes, they’re both an OS. Yes, they can both be used for the same things. But that makes Linux an alternative, not a replacement. It might seem an insignificant distinction, but it’s actually a vitally important one.

Linux <=> Windows is like Motorbikes <=> Cars: Both are vehicles that get you from A to B via the roads. But they’re different shapes, different sizes, have different controls, and they work in fundamentally different ways. They are not freely interchangeable. They have different uses and different strengths & weaknesses, and you should pick whichever is appropriate, not pick one and expect it to do everything that the other can do.

Somebody who drives a car might be sitting in a long queue of traffic someday and see a motorbike go sailing past him. He might envy the biker’s ability to largely ignore something that is a crippling problem to a car. If that driver then said "I know all about cars, so I must know all about motorbikes!" then he’d be wrong.

  • If that driver bought a bike and then found that he was confused by the accelerator being a hand-controlled twist-grip instead of a foot-controlled pedal, he might complain that motorbikes should be fitted with a gas pedal.
  • If that driver had a wife and two kids, he might find the bike’s single passenger capacity a flaw. He might suggest that bikes be re-built so they could carry four people, two abreast.
  • If that driver were to try and drive away, only to find that he fell over because he wasn’t used to having to keep balance, he might suggest that bikes should be re-designed with four wheels.
  • If the driver were to find himself leaning around the corners, he might suggest bikes should be fitted with stabilisers to keep them upright when cornering.
  • If the driver wanted to keep his bike from being stolen, he might complain that there were no doors to lock potential thieves out, making his bike much more likely to be stolen than a car.
  • If the driver found a crash helmet an encumberance, he might suggest that an airbag in the bike’s handlebars could be fitted as an alternative to the annoying helmet.

And in every case, he would be wrong. Because he thinks that a motorbike replaces a car, he thinks it can and should do everything a car can do. He thinks it can work in the same way that a car does, that ‘missing’ car features can just be grafted on.

In the same way, well-meaning Linux newcomers make suggestions about making Linux more like what they’re used to. And they get nowhere, for all the same reasons. Linux and Windows might both be used for the same purposes, but so are a car & motorbike. That doesn’t mean you can swap directly from one to the other, and it doesn’t mean features can or should be swapped directly from one to the other.

Too many people think that migrating from Windows to Linux is like switching from a BMW to a Mercedes. They think that the controls should be the same, their experience should transfer directly, and all differences should be largely cosmetic. They think that "I need a car to use a road, I need an OS to use a computer. Cars all work the same way, therefore OSes should all work the same way." But this is not accurate. "I need a vehicle to use a road, I need an OS to use a computer. I know how to drive a car, I’m ignorant about motorbikes. I know how to use Windows, I’m ignorant about Linux."this is accurate.

A Windows user must realize that he’s only an experienced Windows user, not an experienced computer user; just like a car driver is only a car driver, not an all-road-vehicles driver. A Windows user on Linux must realize that he has just become a novice again, just like a car driver on a motorbike. A Windows user must be willing to learn that there are different ways of accomplishing the same task, just as a car driver must get used to the handlebars replacing a wheel and the need for a crash helmet he never had to use before. And they have to be prepared to accept that "different" does not mean "inferior".

This simple fact causes great difficulty for the more established Windows users. They come to Linux with many Windows habits ingrained and an attitude of "I know exactly how to use a computer, thank you very much." The problem is, they don’t. They only know how to use Windows. When they come to a different OS, these "power users" can be the ones who have the worst problems: They have far more to unlearn.

Where a newbie will just say "I don’t know" and start exploring or asking on forums, the Windows Power User will say "I know how to do this, I just do this, this, this, and then. . . It doesn’t work! Stupid OS!" And then they’ll say "If knowledgeable me couldn’t get it working, a newbie will stand no chance! Linux is nowhere near ready for desktop use!". They don’t realise that all their knowledge is working against them, causing them to have more problems than the less knowledgeable users. They’ve made the mistake of thinking Linux is different software doing the same thing as Windows, when it’s actually different software doing different things. It’s not doing a bad job of the same tasks, it’s doing a good job of alternative tasks.

Linux is an alternative to Windows, but not a replacement. It will never be a replacement, because it has incompatible goals. Microsoft’s goal is to get their software onto as many PCs as posible, as their priority is profit. Linux has no such goal, because Linux is free. It has a different priority.

To understand this is to understand FOSS . It’s perfectly understandable that Linux newbies don’t understand it yet – they’re new to it. They’re used to thinking in terms of proprietary software. So let me explain it:

Typical FOSS software is created by somebody who looks around, doesn’t find any pre-existing software he likes, and so writes his own. Then, because he’s such a nice guy, he throws open the source and says to the world "Help yourself!". He can do this, because it costs nothing to duplicate software, so it costs him no more to give it to the whole world than it would to keep it to himself. He doesn’t suffer by giving his software away.

However, the important thing to remember is: He doesn’t benefit from giving his software away, either. Whether it gets used by one person, or by one billion, makes no difference to the developer. Oh, sure, he gets the satisfaction of knowing he’s made a popular product: The number of people using it can be a nice ego boost; a way, if you will, of keeping score. But it doesn’t make him any money: It’s FOSS.

If the software is a success, other people get interested in it, and they help improve it. That’s the biggest advantage of FOSS: Every user is a potential developer. Everybody can chip in and do their part in making software work better, do more, be less buggy. It’s great when a piece of software attracts a community of developers. But it’s great for the software. It makes the software better. It doesn’t make the developer richer. It just creates more demands on his time.

FOSS is the exact opposite of proprietary software like Windows: FOSS is all about the software. It’s not about the number of end users. Software that works well but has only a few users is considers a failure by commercial software standards, but a success by FOSS ones.

FOSS is about making good quality software, software that can DO things. If you want to use it, you’re expected to invest time in learning how to use it. It was created and given to you, free of charge, by people who invested a lot of their own time in it for no personal gain. The least you could do to repay their contribution is invest a little time of your own before you complain that it doesn’t work like the parallel Windows software.

"Aha, now I’ve got you,"says a newbie smugly. "There are Linux projects with the goal of replacing Windows, not just being an alternative."

It’s easy to see where that idea comes from. KDE and Gnome, for instance, provide a desktop environment that’s far more Windows-like than typical Linux window managers and the CLI. Linspire is a distro based almost entirely around the idea of making Linux Windows-like.

However, paradoxically, these prove my point better than they prove the newbie’s.

Why? Because these projects are normal FOSS projects, revolving entirely around making the software better. The only difference is, one of the definitions of quality in these projects is "How easily can a Windows user use it?"

As soon as you factor this in, you can’t help but agree that these are 100% typical Linux, with the sole aim of improving software. These are projects made by even-more-selfless-than-usual Linux developers: They aren’t making software for their own use, as they know Linux very well. Instead, they’re making software entirely for other people’s benefit: Software that makes the transition from Windows to Linux easier.

These developers have recognised that there are Windows users who want to move to Linux, and they’ve put a lot of effort into creating a Linux environment which Windows users find comfortably familiar. But they haven’t done so to try and replace Windows, though the end result might give that impression. The end goal is what makes the difference: The goal is not to make a Windows replacement; the goal is to ease the Windows-user’s transition to Linux.

It’s not uncommon to see community hostility towards these projects. Some of it for rational, understandable reasons ("KDE is a resource hog, so use Fluxbox") but some seems to be an irrational, hostile, "Windows-like software is bad" attitude. This isn’t, actually, an anti-MS or anti-Windows attitude. Instead, it’s the far more compehensible dislike of what isn’t understood.

The ‘typical’ Linux user is a hobbyist: He uses computers because computers are fun, programming is fun, hacking is fun. And Linux is a far better OS for a hacking hobbyist: He can take it apart to its most fundamental level, and reassemble it exactly as he sees fit.

However, the current influx of Linux users has a large percentage of non-hobbyist non-hackers. They want a computer that Just Works, a computer that works like Windows. They aren’t interested in spending time setting up Linux to make it work the way they want it, they want it to work like that out-of-the-box.

And that’s perfectly okay, but from the typical Linux user’s perspective, this is like somebody who wants a Lego car that comes pre-assembled and glued together so it can’t come apart. It is alien to their understanding. The only way they can react is with a baffled "Why would anybody want that?"

It’s baffling. If you want a ready-made model car, buy a toy car. If you want a car you can build and take apart, buy Lego. Why would anybody want a Lego car that can only be used as a toy car? The whole point of Lego is that you have fun assembling it yourself!

This is how a typical Linux user reacts to the "Why can’t it Just Work?" brigade: "If you want it to Just Work, use Windows. If you want to hack it, use Linux. Why do you want to switch to Linux if you have no interest in taking advantage of its open source nature?"

The answer, usually, is that they don’t actually want to move to Linux. They just want to get away from Windows: They’re running away from viruses; they’re fleeing malware; they’re striving to be free of restrictions on how they use their paid-for software; they’re trying to escape from the clutches of the E.U.L.A. They aren’t trying to get into Linux, they’re trying to get out of Windows. Linux is simply the best-known alternative. 

More on that later. . .

You might think "Okay, that explains why developers don’t make a deliberate effort to make their software work like Windows. But surely Linux software could be given a GUI that’s WIndows-user-friendly without it interfering with FOSS principles?"

There are a few reasons why this isn’t the case.

Firstly: Do you really think that somebody who creates a piece of software deliberately gives it a lousy user interface?

When somebody devotes a large chunk of his own time to create a piece of software, he will make the user interface (UI) as good as possible. The UI is a hugely important part of the software: there’s no point having functionality if you can’t access it via the UI. You might not know what it is, but there is always a reason why the UI works the way it does. That reason? Because it is the best UI the creator could create.

Before you insist that a more Windows-like UI would make the software better, bear this fact in mind: The creator of this software, a coder who, by definition, knows far more than you do about this piece of software, doesn’t agree with you. He might be wrong, but the odds are against it.

Secondly: There already ARE nice, Windows-user-friendly GUI frontends available. I can’t think of any function off the top of my head that you can’t control via a GUI, no matter how high-level. You can compile a kernel (make xconfig), set up your firewall (fwbuilder), partition your hard drive (qtparted). . . it’s all there, pretty, interactive, intuitive, and user-friendly.

But the ‘release cycle’ of Linux isn’t like Windows. You don’t get the finished, highly-polished GUI package released right from the start. GUIs add complexity and no functionality to software. A developer doesn’t sit down and design a pretty GUI that does nothing, he sits down and creates a piece of software that does what he needs it to do.

The first thing a piece of software does is be usable from the command line interface (CLI). It will probably have all sorts of invocation options and maybe a lengthy configuration file. This is how it starts out, because it’s functionality that’s required. Everything else comes later. And even when software has a nice GUI, it’s important to remember it can still usually be controlled fully from the CLI and the config files.

  • This is because the CLI has many advantages: The CLI is universal. Every Linux system has a CLI. Every executable can be run from the CLI. It’s easy to operate software via the CLI remotely.
    None of these are true of the GUI: Some Linux machines don’t have the X11 windowing system installed; Some software has no GUI; Some software is not available from GUI menus; It’s often not easy or practical to use a GUI tool remotely.

Lastly, multiple GUI frontends can exist to do the same job, and there’s no telling which you may have installed.

So do remember, if you ask "How do I. . ?", you’ll mostly be told how to do it via the CLI. That doesn’t mean that it can only be done from the CLI. It just reflects the relative importance that the GUI has compared to the CLI in the development of a software project.

  • Windows is totally GUI-centric. It’s a GUI-based OS with a lousy (but soon to improve) CLI. There’s pretty much no such thing as non-GUI Windows software. That tends to make people think of the GUI as a vital and integral part of software. But in Linux, software gets released as soon as it’s functional. Only after it’s become stable, reasonably bug-free, and feature-rich, does it become worth adding a GUI.
    Try thinking about software without a helpful GUI as a "sneak preview" rather than a finished product. FOSS is very rarely ‘finished’, it’s always being improved. In time, it will be made user-friendly. But most of the time, it’s more important to make it work better than make it ‘feel’ better. Be glad you’ve got the functionality long before all the wimps who need a good GUI, instead of demanding tomorrow’s software today. FOSS is more of a journey than a destination.

The last thing you have to bear in mind is, GUIs for software will often be a separate piece of software. It may even have been developed completely independantly of the original piece of software, by completely separate developers. If you want a GUI, it’s not unlikely that it will be a separate installation, rather than all one piece.

This does, admittedly, mean an extra step to get that elusive, ‘Windowsy’ GUI behaviour, but that shouldn’t detract from the fact that you can, right now, do just about anything you really want to via a pretty, "just like Windows" GUI. You just have to remember: a GUI is usually the LAST step, and not the first. Linux doesn’t do form over function.

Thirdly: Linux is deliberately designed for the well-informed, knowledgeable user, rather than the ignorant beginner. This is for two reasons:

  • Ignorance may be bliss, but it’s also short-lived. Knowledge is eternal. It might take days, weeks, or months to get your knowledge level up from "Linux newbie" to "average Linux user", but once it’s there, you’ve got years of Linux use ahead of you.
    Putting in lots of code to make software easier for newcomers would be like permanently bolting stabiliser wheels to all bicycles. They might make it easier right at the start, but after that. . ?
    You wouldn’t buy a bicycle with stabilisers on it now, I’m sure. And not because you’re some anti-user-friendly freak. No, it would be because they’re useless to you, and useless to anybody other than a beginner, and all they’d do is get in the way.
  • No matter how good software is, it’s only as good as its user. The most secure door in the world is no barrier to thieves if you leave the window open, the door unlocked, or the keys in the lock. The most perfectly-tuned engine in the world won’t get very far if you fill it with diesel fuel instead of petrol.
    Linux puts all power in the hands of the user. That includes the power to break it. Nobody wins in that situation. The only way to keep Linux working well is to learn enough to know what you’re doing. Making it easier for a user to meddle with functionality he doesn’t understand would just make it more likely he’ll break something by accident.

Fourthly: Where, in any of the above text, did you see a way that FOSS would actually benefit from attracting lots of typical Windows users?

Take your time. Re-read it, if you like. I’ll wait.

The guiding principle of Linux and FOSS is "make good software". It is not "Make Windows-replacing software". The only thing a horde of typical Windows users will contribute to Linux is complaints. What will they complain? "It doesn’t work like this on Windows."

No, it doesn’t. If it worked like Windows, Linux would suck. It would be an inferior copy that nobody would use. The reason people are so passionately fond of Linux is that it doesn’t work like Windows. It doesn’t do everything for you, it doesn’t assume you’re a perpetual ignorant newbie, it doesn’t hide all the inner workings from you.

Windows chauffeurs you around; Linux hands you the keys and puts you in the driver’s seat. If you can’t drive, that’s your problem. And your fault. Plenty of people will help you learn if you ask. And if you make a suggestion that’s the equivalent of fitting cruise control, you might get somewhere: This leaves the driver in control, but takes some of the effort out. But you’ll get very short shrift if you try and convince anybody that what Linux really, really needs is a chauffeur.

"But it would get Linux so much more mainstream!", the newbie cries.

It might well do. But how many Linux developers would benefit from Linux going mainstream? Linux is free, as in beer. None of the people creating Linux profit from it gaining a bigger userbase. None of the people on the Linux forums profit from it gaining a bigger userbase. Linux’s aim is not "gain a bigger userbase" – that’s the goal of proprietary software.

Linux’s goal is to make a really good operating system. Developers are busy adding features, removing bugs, and improving existing implementations. They’re not busy putting up billboards advertising how good their stuff is. That should tell you something about where their priorities are.

And look at what this approach has done to Linux’s userbase: It’s made it grow. Linux started out tiny, and has become huge. The reason it has attracted such widespread acclaim? Because its focus has always been on quality. The users attracted to Linux are users who want the freedom and quality that only FOSS can give them. Linux became big because it didn’t care how big it got. Developers focussed solely on making it work, and work well, and so they attracted users who wanted an OS that worked, and worked well.

To suddenly throw that all away and focus instead of making Linux all about replacing Windows would be to kill the very thing that has made Linux what it is. There are corporations out there that have seen Linux’s growth, and want to cash in on it. They’re frustrated by the GPL, which makes it very hard for them to sell Linux at Microsoft prices. "Linux will die if it stays open," they say, "as nobody can make money off it like that."

They don’t realize that making Linux proprietary would be killing the goose that lays the golden eggs. Linux became big because it was FOSS, and nobody was trying to make it a Windows substitute. Linux is thriving because it’s fighting Windows on a front that Microsoft can never defeat it on: Open-ness and quality.

To most Windows users, Linux is an inferior Windows copy. It has less apparent functionality, less integration, and lots more complexity. To that type of user, Linux is seen as a bad OS. And correctly so: It doesn’t meet their needs. Their needs are an OS that’s very simple to use and does everything without them needing to learn anything.

Windows is created for non-tech users. The widespread perception amongst those users is that Linux is hard to use. This is not the case, but it’s an understandable misconception.

Linux is actually blissfully easy to use. Genuinely. It is really easy to use. The reason it isn’t perceived this way? Because the term "ease of use" has been so badly distorted. In common usage, "easy to use" now means "easy to do something without knowing beforehand how to do it". But that’s not really "easy to use", is it? That’s "easy to figure out". It’s like the difference between:

  • a safe with a notice above it saying "You unlock this safe by turning the dial to 32 then 64 then 18 then 9, then turn the key and lift the handle up"

and

  • a car that can be unlocked by pressing the remote control "unlock" button.

It’s far easier to unlock the car, right? One button from anywhere near the car, opposed to numerous highly-specific dial-turns. However, it’s easier for somebody who doesn’t know how to unlock either to get the safe open than the car: the safe has clear instructions in place, while the car just has buttons that aren’t even attached to the car.

Linux is the same. It’s easy to use if you know how to use it. It’s easy to use, but it’s not always easy to learn. Only if you are willing to invest the time in learning Linux will you find it easy. Inescapably, the more you break a task down into simple steps, the more steps you have to take to accomplish that task.

As a really simple example, take this arbitrary exercise: You want to move five lines (paragraphs) from the middle of a text document to the end.

In MS Word; MS WordPad; or MS Notepad; all "user-friendly" Windows text editors, the quickest way to do this is:
– Ctrl-Shift-Down
Ctrl-Shift-Down
Ctrl-Shift-Down
Ctrl-Shift-Down
Ctrl-Shift-Down
Ctrl-X
Ctrl-End
Ctrl-V

(That’s assuming you use the keyboard. Otherwise, you need some Click-and-Drag mouse operations and a reliable autoscroll.)

In vi, however, it is:
– d5d
– Shift-g
– p

Vi, which is about as "user-unfriendly" as it gets, beats Microsoft’s offerings hands down. Why? Because vi was designed for functionality, while Microsoft design to be "user-friendly". Microsoft break everything down into easy steps, and so it takes far more steps to accomplish the same task.

This makes vi far quicker and easier to use for virtually all text-editing tasks. Just so long as you know how to use it. If you don’t know "d5d" means "Place five lines of text in the buffer, and delete them from the document" then you’re going to struggle to make vi work. But if you DO know, then you’re going to fly along.

So when some newbie sees how fast and easily an experienced vi user can do stuff, he readily agrees that vi is superior to Word for text editing. Then he tries to use it himself. He starts it up, gets a screen full of ~s, and when he types, nothing appears on the screen.

He finds out about the text-entry and command modes, and starts trying to use vi with a limited knowledge of it’s functions. He struggles, as there are so many things he has to learn before he can make vi work. Then he complains "vi would be much better if it was as easy to use as Word!"

But the real problem is "I don’t know how to use vi and can’t be bothered to learn." But that would mean the problem was with him, so he blames his problems on the software instead. Never mind all the thousands of people who are happily using vi without any problems: It’s too hard to use, and must be changed!

And believe me, if he can make a text editor that is as "user-friendly" as Word and as functional as vi, he’ll be met with nothing but applause. In fact, he’ll probably be awarded the Nobel Prize For Extreme Cleverness, as nobody else has been able to do it yet. But just whining about vi being hard to use will be met with derision, because there’s no problem with vi, the problem is with him.

It’s like buying da Vinci’s painbrush and then complaining that you still can’t paint. The brush wasn’t what made the Mona Lisa, it was the skill of the artist. The brush is a tool that relies on the user’s skill. There’s no way to get that skill other than practice.

Same with vi. Same with many pieces of Linux software that new users complain is "too hard" or "not intuitive enough", whether they’re talking about a text editor, a package manager, or the command line itself.

Before you start insisting that something about Linux needs fixing, there’s one important question to ask: "Do experienced users have a problem with this?"

If the answer is "No", then the problem is on your end. If other people can use it successfully, why can’t you? Have you taken the time to learn how to use it? Or did you just expect it to work for you right from the word ‘Go’?

"User-friendly" and "raw functionality" are exclusive. All the little buttons and drop-down menus that are vital to make a piece of software simple to use are just obstacles that get in the way of the experienced user. It’s the difference between navigating from A to B with a map & compass, and going from A to B by following the road signs: Anybody can get there by following the signs, but they’ll take twice as long as somebody who knows how to go straight there.

 

If I want to paste the value of a formula in Excel, I have to do it via the Edit->Paste Special->Paste Values menus. I don’t want to navigate through all these pain-in-the-rear ‘friendly’ menus, sub-menus and dialogue boxes. I just want to do it. And, to be fair, if I reprogram the shortcut keys and record some macros, I can make Excel and Word do most things at the push of a button.

But that’s not really user-friendly, is it? That’s still requiring the user to invest a lot of time in the software. Linux requires you to put the time in to learn how to use the existing functionality. "User-friendly" software makes you put the time in to creating the functionality.

If that’s the way you prefer it, that’s fine, go ahead and do it that way. But don’t ever lose sight of the fact that the fault lies with your ignorance and not with the software itself. All Linux software is supremely easy to use, once you know how to use it. If you don’t know, it won’t be easy, and it won’t be because the software is at fault.

Now, you might be starting to feel that Linux has an attitude problem. It doesn’t want users, it doesn’t want to make life easy for its users. . . it’s just for snobbish l33t h4xx0r5!

Nothing could be farther from the truth. Of course Linux wants users! And of course it doesn’t want to make things hard. Quite the opposite: Hard to use software is, by definition, bad software.

But you have to realize, its definitions may be different to yours, and different to the ‘traditional’ proprietary software culture.

Linux wants users who want Linux. And that doesn’t mean just the name. It means everything: The free, open-source software; the ability to tinker with your software; the position of being in the driver’s seat, in total control.

That’s what Linux is. That’s what it’s all about. People migrate to Linux because they’re sick of viruses, sick of BSODs, sick of spyware. That’s understandable. But those people don’t want Linux. They really just want Windows without the flaws. They don’t really want Linux. So why should Linux want them?

But if they give Linux a try because of viruses and spyware, and then decide that they love the idea of an OS that they control. . . That’s when they want Linux for its own sake. And that’s when Linux wants them.

Before you decide you want to switch to Linux, ask yourself "Why do I want to switch?"

If the answer is "I want an OS that puts all the power in the hands of the user and expects him to know how to use it": Get Linux. You’ll have to invest a substantial amount of time and effort before you get it to where you want it, but you’ll eventually be rewarded with a computer that works exactly the way you want it to.

BUT. . .

If the answer is "I want Windows without the problems": Do a clean install of Windows XP SP2; set up a good firewall; install a good anti-virus; never use IE for browsing the web; update regularly; reboot after each software install; and read about good security practices. I myself have used Windows from 3.1 through 95, 98, NT, and XP, and I have never once had a virus, suffered from spyware, or been cracked. Windows can be a safe and stable OS, but it relies on you keeping it that way.

If the answer is "I want a replacement for Windows without the problems": Buy an Apple Mac. I’ve heard wonderful things about the Tiger release of OS X, and they’ve got some lovely-looking hardware. It’ll cost you a new computer, but it’ll get you what you want.

In either case, don’t switch to Linux. You’ll be dissapointed with both the software and the community. Linux is not Windows.

 

 

Linux以及各大发行版介绍

什么是Linux?
 
也许很多人会不屑的说,Linux不就是个操作系统么。错!Linux不是一个操作系统,严格来讲,Linux只是一个操作系统中的内核。内核是什么?内核建立了计算机软件与硬件之间通讯的平台,内核提供系统服务,比如文件管理、虚拟内存、设备I/O等。
 
既然Linux只是一个内核。那么我们通常所说的Linux操作系统又是什么?我们通常所说的Linux,指GNU/Linux,即采用Linux内核的 GNU操作系统。是的,操作系统的实际名称是GNU。什么是GNU?GNU代表GNU’s Not Unix。可以说是一个操作系统又可以说是一种规范。比如,众所周知的PHP,原名为Personal HomePage(个人主页),根据GNU的软件命名规则,PHP现已更名为PHP: Hypertext Preprocessor(超文本预处理程序)。
 
谁编写/创造了Linux?
 
Linux最早由Linus Torvalds在1991年开始编写。在这期间,Richard Stallman创建了GNU组织,并不断的编写创建GNU程序(程序的许可方式均为GPL: General Public License)。在不断的有程序员和开发者加入到GNU组织中后,变造就了今天我们所看到的Linux,或称GNU/Linux。
 
什么是Linux发行版?
 
正如之前所说的,Linux只是一个内核。然而,一个完整的操作系统不仅仅是内核而已。所以,许多个人、组织和企业,开发了基于 GNU/Linux的Linux发行版。这其中最著名的便是Red Hat公司的Red Hat系列以及社区(community)组织的Debian系列。
 
下面我就简单得介绍一下目前比较著名、流行的Linux发行版本。部分资料来源:DistroWatch.com
 
Mandriva
 
Mandriva原名Mandrake,最早由Ga&euml;l Duval创建并在1998年7月发布。记得前两年国内刚开始普及Linux时,Mandrake非常流行。说起Mandrake的历史,其实最早 Mandrake的开发者是基于Redhat进行开发的。Redhat默认采用GNOME桌面系统,而Mandrake将之改为KDE。而由于当时的 Linux普遍比较难安装,不适合第一次接触Linux的新手,所以Mandrake还简化了安装系统。我想这也是当时Mandrake在国内如此红火的原因之一。Mandrake在易用性方面的确是下了不少功夫,包括默认情况下的硬件检测等。
 
Mandrake的开发完全透明化,包括“cooker”。当系统有了新的测试版本后,便可以在cooker上找到。之前Mandrake的新版本的发布速度很快,但从9.0之后便开始减缓。估计是希望能够延长版本的生命力以确保稳定和安全性。
 
优点:友好的操作界面,图形配置工具,庞大的社区技术支持,NTFS分区大小变更
缺点:部分版本bug较多,最新版本只先发布给Mandrake俱乐部的成员
软件包管理系统:urpmi (RPM)
免费下载:FTP即时发布下载,ISO在版本发布后数星期内提供
官方主页:http://www.mandrivalinux.com/
 
Red Hat
 
国内,乃至是全世界的Linux用户所最熟悉、最耳闻能详的发行版想必就是Red Hat了。Red Hat最早由Bob Young和Marc Ewing在1995年创建。而公司在最近才开始真正步入盈利时代,归功于收费的Red Hat Enterprise Linux(RHEL,Red Hat的企业版)。而正统的Red Hat版本早已停止技术支持,最后一版是Red Hat 9.0。于是,目前Red Hat分为两个系列:由Red Hat公司提供收费技术支持和更新的Red Hat Enterprise Linux,以及由社区开发的免费的Fedora Core。Fedora Core 1发布于2003年年末,而FC的定位便是桌面用户。FC提供了最新的软件包,同时,它的版本更新周期也非常短,仅六个月。目前最新版本为FC 3,而FC4也预定将于今年6月发布。这也是为什么服务器上一般不推荐采用Fedora Core。
 
适用于服务器的版本是Red Hat Enterprise Linux,而由于这是个收费的操作系统。于是,国内外许多企业或空间商选择CentOS。CentOS可以算是RHEL的克隆版,但它最大的好处是免费!菜鸟油目前的服务器便采用的CentOS 3.4。
 
优点:拥有数量庞大的用户,优秀的社区技术支持,许多创新
缺点:免费版(Fedora Core)版本生命周期太短,多媒体支持不佳
软件包管理系统:up2date (RPM), YUM (RPM)
免费下载:是
官方主页:http://www.redhat.com/
 
SUSE
 
SUSE是德国最著名的Linux发行版,在全世界范围中也享有较高的声誉。SUSE自主开发的软件包管理系统YaST也大受好评。SUSE于2003年年末被Novell收购。
 
SUSE之后的发布显得比较混乱,比如9.0版本是收费的,而10.0版本(也许由于各种压力)又免费发布。这使得一部分用户感到困惑,也转而使用其它发行版本。但是,瑕不掩瑜,SUSE仍然是一个非常专业、优秀的发行版。
 
优点:专业,易用的YaST软件包管理系统
缺点:FTP发布通常要比零售版晚1~3个月
软件包管理系统:YaST (RPM), 第三方APT (RPM) 软件库(repository)
免费下载:取决于版本
官方主页:http://www.suse.com/
 
Debian GNU/Linux
 
Debian是菜鸟油服务器之前所采用的操作系统。Debian最早由Ian Murdock于1993年创建。可以算是迄今为止,最遵循GNU规范的Linux系统。Debian系统分为三个版本分支(branch): stable, testing 和 unstable。截至2005年5月,这三个版本分支分别对应的具体版本为:Woody, Sarge 和 Sid。其中,unstable为最新的测试版本,其中包括最新的软件包,但是也有相对较多的bug,适合桌面用户。testing的版本都经过 unstable中的测试,相对较为稳定,也支持了不少新技术(比如SMP等)。而Woody一般只用于服务器,上面的软件包大部分都比较过时,但是稳定和安全性都非常的高。菜鸟油之前所采用的是Debian Sarge。
 
为何有如此多的用户痴迷于Debian呢(包括笔者在内)?apt-get / dpkg是原因之一。dpkg是Debian系列特有的软件包管理工具,它被誉为所有Linux软件包管理工具(比如RPM)最强大的!配合apt- get,在Debian上安装、升级、删除和管理软件变得异常容易。许多Debian的用户都开玩笑的说,Debian将他们养懒了,因为只要简单得敲一下”apt-get upgrade && apt-get update”,机器上所有的软件就会自动更新了……
 
优点:遵循GNU规范,100%免费,优秀的网络和社区资源,强大的apt-get
缺点:安装相对不易,stable分支的软件极度过时
软件包管理系统:APT (DEB)
免费下载:是
官方主页:http://www.debian.org/
 
Ubuntu
 
笔者的桌面电脑便使用的Ubuntu。依照笔者的理解,简单而言,Ubuntu就是一个拥有Debian所有的优点,以及自己所加强的优点的近乎完美的Linux操作系统。Smile Ubuntu是一个相对较新的发行版,但是,它的出现可能改变了许多潜在用户对Linux的看法。也许,从前人们会认为Linux难以安装、难以使用,但是,Ubuntu出现后,这些都成为了历史。Ubuntu基于Debian Sid,所以这也就是笔者所说的,Ubuntu拥有Debian的所有优点,包括apt-get。然而,不仅如此而已,Ubuntu默认采用的GNOME 桌面系统也将Ubuntu的界面装饰的简易而不失华丽。当然,如果你是一个KDE的拥护者的话,Kubuntu同样适合你!
 
Ubuntu的安装非常的人性化,只要按照提示一步一步进行,安装和Windows同样简便!并且,Ubuntu被誉为对硬件支持最好最全面的 Linux发行版之一,许多在其他发行版上无法使用,或者默认配置时无法使用的硬件,在Ubuntu上轻松搞定。并且,Ubuntu采用自行加强的内核(kernel),安全性方面更上一层楼。并且,Ubuntu默认不能直接root登陆,必须从第一个创建的用户通过su或sudo来获取root权限(这也许不太方便,但无疑增加了安全性,避免用户由于粗心而损坏系统)。Ubuntu的版本周期为六个月,弥补了Debian更新缓慢的不足。
 
优点:人气颇高的论坛提供优秀的资源和技术支持,固定的版本更新周期和技术支持,可从Debian Woody直接升级
缺点:还未建立成熟的商业模式
软件包管理系统:APT (DEB)
免费下载:是
官方主页:http://www.ubuntulinux.org/
 
Gentoo
 
Gentoo最初由Daniel Robbins(前Stampede Linux和FreeBSD的开发者之一)创建。由于开发者对FreeBSD的熟识,所以Gentoo拥有媲美FreeBSD的广受美誉的ports系统 ——portage。(Ports和Portage都是用于在线更新软件的系统,类似apt-get,但还是有很大不同)Gentoo的首个稳定版本发布于2002年。
 
Gentoo的出名是因为其高度的自定制性:因为它是一个基于源代码的(source-based)发行版。尽管安装时可以选择预先编译好的软件包,但是大部分使用Gentoo的用户都选择自己手动编译。这也是为什么Gentoo适合比较有Linux使用经验的老手使用的原因。但是要注意的是,由于编译软件需要消耗大量的时间,所以如果你所有的软件都自己编译,并安装KDE桌面系统等比较大的软件包,可能需要几天时间才能编译完……
 
优点:高度的可定制性,完整的使用手册,媲美Ports的Portage系统,适合“臭美”的高手使用^^
缺点:编译耗时多,安装缓慢
软件包管理系统:Portage (SRC)
免费下载:是
官方主页:http://www.gentoo.org/
 
Slackware
 
Slackware由Patrick Volkerding创建于1992年。算起来应当是历史最悠久的Linux发行版。曾经Slackware非常的流行,但是当Linux越来越普及,用户的技术层面越来越广(更多的新手)后,Slackware渐渐的被新来的人们所遗忘。在其他主流发行版强调易用性的时候,Slackware依然固执的追求最原始的效率——所有的配置均还是要通过配置文件来进行。
 
尽管如此,Slackware仍然深入人心(大部分都是比较有经验的Linux老手)。Slackware稳定、安全,所以仍然有大批的忠实用户。由于Slackware尽量采用原版的软件包而不进行任何修改,所以制造新bug的几率便低了很多。Slackware的版本更新周期较长(大约1 年),但是新版本的软件仍然不间断的提供给用户下载。
 
优点:非常稳定、安全,高度坚持UNIX的规范
缺点:所有的配置均通过编辑文件来进行,自动硬件检测能力较差
软件包管理系统:Slackware Package Management (TGZ)
免费下载:是
官方主页:http://www.slackware.com/
 
Knoppix
 
由德国的Klaus Knopper开发的Knoppix,是一个基于Debian的发行版。Knoppix严格算起来是一款LiveCD Linux,所谓的LiveCD就是整个操作系统都在一张光盘上,只要开机从光盘启动,就能拥有一个完整的Linux系统!无需安装!当然, Knoppix也能够非常轻松的安装到硬盘上。其强大的硬件检测能力、系统修复能力、即时压缩传输技术,都令人大加称赞。可以说,在LiveCD界, Knoppix是无人能及的!
 
优点:无需安装可直接运行于CD上,优秀的硬件检测能力,可作为系统急救盘使用
缺点:LiveCD由于光盘的数据读取速度限制导致性能大幅下降
软件包管理系统:APT (DEB)
免费下载:是
官方主页:http://www.knoppix.com/
 
MEPIS
 
MEPIS由Warren Woodford在2003年建立。MEPIS虽然刚建立不久,但是迅速的传播在Linux用户间。简单来说,MEPIS是一个集合了Debian Sid和Knoppix的产物。用户即能将之当作LiveCD使用,也能使用常规的图形界面进行安装。
 
MEPIS默认集成安装了Java Runtime Environment、Flash插件、nVidia加速驱动等许多常用的程序。用户可以非常轻松的安装完系统后就直接开始使用,而不用到处寻找资料如何下载、如何安装、如何配置这些软件。这不仅给Linux新手带来了便捷,也给老手们节约了相当多的时间。
 
优点:LiveCD与常规安装两用,优秀的硬件检测能力,预装了许多实用的软件
缺点:建立时间不长,默认的界面有些寒酸
软件包管理系统:APT (DEB)
免费下载:是
官方主页:http://www.mepis.org/
 
Xandros
 
Xandros建立在已经成为历史的Corel Linux之上。当初Corel Linux的公司由于财政上的困难,被迫终止了Corel Linux的开发,而Xandros适时的将Corel Linux部门买下,于2002年10月推出全新的Xandros Desktop。
 
Xandros的卖点在于极其简单的安装和使用,所以它的市场定位是那些没有任何Linux使用经验的新手,或是习惯使用Windows的用户。Xandros的标准版和增强版都是商业软件,分别售价$40和$99美元。不过你仍然可以在这里下载到免费的公开发行版。
 
优点:适合完全没有经验的新手,安装完以后就能立即投入使用,自带非常不错的工具
缺点:商业软件
软件包管理系统:Xandros Networks (DEB) 或 APT (DEB) (可选,但不提供技术支持)
免费下载:公开发行版
官方主页:http://www.xandros.com/
 
FreeBSD
 
首先要强调的是:FreeBSD不是一个Linux系统!可是,为什么笔者要介绍FreeBSD呢?因为FreeBSD的用户也相当多,其许多特性都与Linux相类似。事实上,Linux和BSD (Berkeley Software Distribution)均是UNIX的演化分支。并且,Linux中相当多的特性和功能(比如用于配置DNS的Bind软件)都是取自于BSD的。而 FreeBSD便是BSD家族中最出名,用户数量最多的一个发行版。MEZOC之前所采用的便是FreeBSD系统。
 
FreeBSD建立于1993年,拥有相当长的历史。FreeBSD拥有两个分支:stable和current。顾名思义,stable是稳定版,而current则是添加了新技术的测试版。另外,FreeBSD会不定期的发布新的版本,称为RELEASE,stable和current均有自己的RELEASE版本。比如4.11-RELEASE和5.3-RELEASE,请注意,这并不代表后者比前者的版本新。这仅仅代表前者(数字小的版本)是stable版本,后者(数字大的版本)是current版本。
 
FreeBSD除了作为服务器系统外,也适合桌面用户。不过,考虑到软件方面的兼容性,一般用户选择FreeBSD作为桌面系统不是很明智。作为服务器而言,FreeBSD是相当优秀的。曾经有人说过,同样的服务器硬件配置,运行同样的一个vBulletin论坛,FreeBSD所用的资源要比 Linux少。这也是为什么许多空间商极力推崇FreeBSD的原因。Smile
 
优点:速度快,非常稳定,优秀的使用手册,Ports系统
缺点:比起Linux而言对硬件的支持较差,对于桌面系统而言软件的兼容性是个问题
软件包管理系统:Ports (TBZ)
免费下载:是
官方主页:http://www.freebsd.org/
 
以上介绍了目前较为流行的各Linux发行版本,希望对大家有所帮助。同时,笔者也希望越来越多的朋友投入到Linux的大家庭中!^O^/