iT邦幫忙

2019 iT 邦幫忙鐵人賽

DAY 9
1
自我挑戰組

Linux學習系列 第 9

比較Windows和 Linux

比較Windows和Linux

Linux和Microsoft Windows的一個主要區別就是Linux是自由軟體,
而Windows是封閉軟體。

什麼是自由軟體?
符合以下四項:

自由之零:不論目的為何,有使用該軟體的自由。
自由之一:有研究該軟體如何運作的自由,並且得以修改該軟體來符合使用者自身的需求。取得該軟體之源碼為達成此目的之前提。
自由之二:有重新散布該軟體的自由,所以每個人都可以藉由散布自由軟體來敦親睦鄰。
自由之三:有改善再利用該軟體的自由,並且可以發表修訂後的版本供公眾使用,如此一來,整個社群都可以受惠。如前項,取得該軟體之源碼為達成此目的之前提。

這邊先解釋開源軟體和自由軟體的不同:
(維基看完自己的認知)
自由軟體:自由軟體就是最自由的,所以自由軟體包括開源軟體
開源軟體:開源軟體就是只有:開放原始碼,使用者的自由會受限

例子: Tivo公司生產的機上盒。雖然它基於GNU/Linux,TiVo公司也按照授權條款釋出了原始碼,但是卻禁止用戶在機上盒上執行自己的程式,或重新安裝系統。
所以它就是開源軟體,但不是自由軟體
因為它違反了
自由之二: 有重新散布該軟體的自由(因為它不准你重新安裝系統)
自由之三: 改善再利用該軟體的自由(因為不能執行程式,所以就不能改善再利用)
https://zh.wikipedia.org/wiki/%E8%87%AA%E7%94%B1%E8%BD%AF%E4%BB%B6

接下來的內容來自以下網址(部分截圖也是)
網址:https://www.guru99.com/linux-differences.html

Windows Vs. Linux File System

在windows,資料夾裡的檔案,存到不同的硬碟,像是C: D: E:
在Linux,檔案是一個樹狀結構,開始於root directory.
https://www.guru99.com/images/FolderStructure.png

Windows Vs. Linux Types of Files:

在linux裡所有東西都是file:
1 General Files

They can contain image, video, program or simply text. They can be in ASCII or a Binary format. These are the most commonly used files by Linux Users.

一般的檔案。可以是ASCII或是二進位。

2 Directory Files
資料夾

3 Device Files

In MS Windows, devices like Printers, CD-ROM, and hard drives are represented as drive letters like G: H:. In Linux, there are represented as files.For example, if the first SATA hard drive had three primary partitions, they would be named and numbered as /dev/sda1, /dev/sda2 and /dev/sda3.

CD、印表機、磁碟在Windows的檔名都是G: H:…,但是在linux,CD的檔名是cdrom,
如果一個硬碟分成三個儲存空間的話,會是/dev/sda1, /dev/sda2 and /dev/sda3.,意思就是在dev這個資料夾裡有sda1、sda2、sda3三個資料夾

Note: All device files reside in the directory /dev/
所有的裝置檔案在Linux都是在/dev/

如圖,在Windows的CD是H:;Linux是cdrom
https://ithelp.ithome.com.tw/upload/images/20200813/20111994kTS9CDl4Kj.png
https://ithelp.ithome.com.tw/upload/images/20200813/20111994btaLkr3KjD.png

相似功能的資料夾,但在不同作業系統,取名就不同。
像是:
Windows的program files
Linux的bin

Windows Vs. Linux:Users

Linux 3種使用者
1 Regular

當安裝 Ubuntu時,就有一個 regular user account 被創建,所有的檔案和資料夾都會存在/home/,As a regular user, you do not have access to directories of other users(一般使用者沒有權限管其他使用者的檔案)

2 Administrative(root)

當安裝 Ubuntu時,就有一個root account被創建,The root account is a superuser who can access restricted files, install software and has administrative privileges. Whenever you want to install software, make changes to system files or perform any administrative task on Linux; you need to log in as a root user.
root user可以access restricted files(有權限管理受限制的檔案,像系統檔案),install software(安裝軟體),administrative privileges(擁有帳號權力)

3 Service

Linux is widely used as a Server Operating System. Services such as Apache, Squid, email, etc. have their own individual service accounts. Having service accounts increases the security of your computer. Linux can allow or deny access to various resources depending on the service.

Linux常被用來當Server Operating System,像是: Apache, Squid, email,擁有service accounts可以增加電腦的安全性

Note:
1 在Ubuntu Desktop version沒有service accounts
2 Ubuntu Desktop 的 Regular accounts又稱standard accounts

Windows 使用者:
1 Administrator
2 Standard
3 Child
4 Guest

Windows Vs. Linux: File Name Convention

Windows在同一個資料夾不能有兩個同樣名字的檔案(同名就不行)
Linux可以在同一個資料夾有兩個同樣名字的檔案(大小寫不同)
https://ithelp.ithome.com.tw/upload/images/20181022/20111994N4U2oNCf6r.png
https://ithelp.ithome.com.tw/upload/images/20181022/20111994LpReVvT2Zm.png
https://ithelp.ithome.com.tw/upload/images/20181022/20111994ORbH9ZxmsG.png

Windows Vs. Linux: HOME Directory

Consider, a regular user account "Tom". He can store his personal files and directories in the directory "/home/tom". He can't save files outside his user directory and does not have access to directories of other users. For instance, he cannot access directory "/home/jerry" of another user account"Jerry".

有個正常帳號的使用者叫Tom,Tom的檔案都要放在"/home/tom"目錄下,不能在"/home/tom"以外的地方存檔案,也沒有權限使用 其他使用者的檔案。"/home/tom"目錄相似於Windows的C:\Users\user\文件

維基:
https://zh.wikipedia.org/wiki/%E5%AE%B6%E7%9B%AE%E5%BD%95

如下圖,沒辦法創建資料夾
https://ithelp.ithome.com.tw/upload/images/20181022/20111994SI9B09cNza.png

When you boot the Linux operating system, your user directory (from the above example /home/tom) is the default working directory. Hence the directory "/home/tom is also called the Home directory which is a misnomer.

當開啟Linux,/home/tom is the default working directory,is also called the Home directory which is a misnomer。(Home directory其實是個誤稱,default working directory才是原本的意思)

這張圖顯示了Linux資料夾的內容
https://www.guru99.com/images/LinuxDirectories.png


上一篇
Linux Shell Scripting
下一篇
Linux Ifconfig指令和了解IPv4位址、netmask
系列文
Linux學習30
圖片
  直播研討會
圖片
{{ item.channelVendor }} {{ item.webinarstarted }} |
{{ formatDate(item.duration) }}
直播中

尚未有邦友留言

立即登入留言