導航:首頁 > 編程系統 > linuxjournalsize

linuxjournalsize

發布時間:2024-03-24 05:57:06

A. 如何選擇 linux 桌面環境

5款Linux桌面環境,個個都值得擁有:

第一個:KDE

提到Linux桌面環境不得不提到KDE,有人說他是傳統桌面之王這一點都不為過;而相比之下,KDE在Linux桌面環境選擇上十分佔優勢。在近幾年的LinuxJournal評比中,KDE一直蟬聯Linux最佳桌面。KDE的開發始於1996年,第一版發布於1998年。應該說KDE的可定製十分高,你幾乎可以定製任何東西。

相比於其他桌面環境需要使用額外的工具才能進行自定義,KDE顯得十分靈活,因為它已經將這一切都集成進了系統設置中,所以用戶無需其他輔助工具就可以對桌面進行個性化設置。可以說KDE將你所需要的基本應用、工具全都打包了,所以十分方便。

很多流行的Linux發行版都提供KDE,目前採用KDE作為默認桌面環境的Linux發行版主要有openSUSE和Kubuntu。

第二個:GNOME

GNOME第一版發布於1999年,是目前十分流行的一種桌面環境,其分支比較多,如:Cinnamon、Unity等。其定製化沒有KDE那麼靈活、完善,但是可以通過第三方應用,如gnome-tweak-tool等來實現定製化。

GNOME是Fedora的默認桌面環境,目前使用GNOME作為默認桌面環境的Linux發行版主要有Debian、Fedora、openSUSE和UbuntuGNOME。

第三個:MATE

MATE的出現是基於GNOME2已不再維護的代碼創建的一個分支,最初也是為那些對GNOME3失望的用戶而開發。如今也贏得很多開發者的喜愛。

MATE的優勢在於其本身對資源的消耗非常小,所以如果你有一台配置不是那麼高端,運行有較慢的電腦,相信選擇MATE是不會錯的。在個性化定製方面,MATE自帶的基本應用都從GNOME2復制過來進行集成,支持面板系統、菜單、小程序、指示器等可按用戶需求配置。

第四個:Cinnamon

Cinnamon作為LinuxMint的默認桌面環境,雖然長的很像Windows用戶界面,但是它擁有高度可定製化,且不需要任何額外的插件、小工具和配置工具來定製桌面。

Cinnamon的開發源自GNOME 3,但是比MATE花哨一些。與Windows相似的用戶界面讓Cinnamon成為部分初學者的選擇。

Cinnamon作為Linux Mint的默認桌面環境,但是,很多其他Linux發行版也提供自己的Cinnamon風格。

第五個:Unity

Unity是Ubuntu的預設桌面,也是很多初學者最開始接觸Linux作用的桌面,是一個對觸控優化的桌面,其最初的開發目的也是為了充分使用上網本的小屏幕。但眾所周知,上網本最終並沒有得到大多數用戶的認可。

Unity也基於GNOME桌面環境,第一次發行是在2010年,而它作為Canonical公司開發的圖形用戶界面,在經歷了幾次重大改進之後,終於可以像其他桌面一樣安裝在發行版上了。

B. Linux磁碟管理

是一個創建和維護分區表的程序,它兼容DOS類型的分區表、BSD或者SUN類型的磁碟列表。

語法

fdisk [必要參數][選擇參數]

必要參數:

-l 列出素所有分區表

-u 與"-l"搭配使用,顯示分區數目

選擇參數:

-s<分區編號> 指定分區

-v 版本信息

菜單操作說明

m :顯示菜單和幫助信息

a :活動分區標記/引導分區

d :刪除分區

l :顯示分區類型

n :新建分區

p :顯示分區信息

q :退出不保存

t :設置分區號

v :進行分區檢查

w :保存修改

x :擴展應用,高級功能

(英文全拼:make file system)命令用於在特定的分區上建立 linux 文件系統。

使用方式  :

mkfs [-V] [-t fstype] [fs-options] filesys [blocks]

參數  :

device : 預備檢查的硬碟分區,例如:/dev/sda1

-V : 詳細顯示模式

-t : 給定檔案系統的型式,Linux 的預設值為 ext2

-c : 在製做檔案系統前,檢查該partition 是否有壞軌

-l bad_blocks_file : 將有壞軌的block資料加到 bad_blocks_file 裡面

block : 給定 block 的大小

命令是經常會使用到的命令,它用於掛載Linux系統外的文件。

語法

mount [-hV]mount -a [-fFnrsvw] [-t vfstype]mount [-fnrsvw] [-o options [,...]] device | dir

mount [-fnrsvw] [-t vfstype] [-o options] device dir

參數說明:

-V:顯示程序版本

-h:顯示輔助訊息

-v:顯示較訊息,通常和 -f 用來除錯。

-a:將 /etc/fstab 中定義的所有檔案系統掛上。

-F:這個命令通常和 -a 一起使用,它會為每一個 mount 的動作產生一個行程負責執行。在系統需要掛上大量 NFS 檔案系統時可以加快掛上的動作。

-f:通常用在除錯的用途。它會使 mount 並不執行實際掛上的動作,而是模擬整個掛上的過程。通常會和 -v 一起使用。

-n:一般而言,mount 在掛上後會在 /etc/mtab 中寫入一筆資料。但在系統中沒有可寫入檔案系統存在的情況下可以用這個選項取消這個動作。

-s-r:等於 -o ro

-w:等於 -o rw

-L:將含有特定標簽的硬碟分割掛上。

-U:將檔案分割序號為 的檔案系統掛下。-L 和 -U 必須在/proc/partition 這種檔案存在時才有意義。

-t:指定檔案系統的型態,通常不必指定。mount 會自動選擇正確的型態。

-o async:打開非同步模式,所有的檔案讀寫動作都會用非同步模式執行。

-o sync:在同步模式下執行。

-o atime、-o noatime:當 atime 打開時,系統會在每次讀取檔案時更新檔案的『上一次調用時間』。當我們使用 flash 檔案系統時可能會選項把這個選項關閉以減少寫入的次數。

-o auto、-o noauto:打開/關閉自動掛上模式。

-o defaults:使用預設的選項 rw, suid, dev, exec, auto, nouser, and async.

-o dev、-o nodev-o exec、-o noexec允許執行檔被執行。

-o suid、-o nosuid:

允許執行檔在 root 許可權下執行。

-o user、-o nouser:使用者可以執行 mount/umount 的動作。

-o remount:將一個已經掛下的檔案系統重新用不同的方式掛上。例如原先是唯讀的系統,現在用可讀寫的模式重新掛上。

-o ro:用唯讀模式掛上。

-o rw:用可讀寫模式掛上。

-o loop=:使用 loop 模式用來將一個檔案當成硬碟分割掛上系統。

(base) zfy@zfy-PC:~$ sudo fdisk -l

Disk /dev/sda: 80 GiB, 85899345920 bytes, 167772160 sectors

#塊設備名稱為/dev/sda,此設備的大小為80 GB,85899345920 bytes是轉換成位元組後的大小,共167772160 個扇區

Disk model: VMware Virtual S

Units: sectors of 1 * 512 = 512 bytes

Sector size (logical/physical): 512 bytes / 512 bytes

I/O size (minimum/optimal): 512 bytes / 512 bytes

Disklabel type: dos

Disk identifier: 0x3b1ffeba

Device    Boot    Start      End  Sectors  Size Id Type

#分區序列 | 引導 | 開始 | 終止 | Sectors | 容量 | 分區類型ID | 分區類型

/dev/sda1  *        2048  3147775  3145728  1.5G 83 Linux

/dev/sda2        3147776 138412031 135264256 64.5G  5 Extended

/dev/sda3      138412032 161480703  23068672  11G 83 Linux

/dev/sda4      161480704 167770111  6289408    3G 82 Linux swap / Solaris

/dev/sda5        3149824  34605055  31455232  15G 83 Linux

/dev/sda6        34607104  66062335  31455232  15G 83 Linux

/dev/sda7        66064384 138412031  72347648 34.5G 83 Linux

Partition table entries are not in disk order.

a. 在虛擬機中添加硬碟,添加後使用fdisk -l命令查看,磁碟變成兩個,在sda中還沒有分區

root@zfy-PC:/home/zfy# fdisk -l

Disk /dev/sda: 2 GiB, 2147483648 bytes, 4194304 sectors

Disk model: VMware Virtual S

Units: sectors of 1 * 512 = 512 bytes

Sector size (logical/physical): 512 bytes / 512 bytes

I/O size (minimum/optimal): 512 bytes / 512 bytes

Disk /dev/sdb: 80 GiB, 85899345920 bytes, 167772160 sectors

Disk model: VMware Virtual S

Units: sectors of 1 * 512 = 512 bytes

Sector size (logical/physical): 512 bytes / 512 bytes

I/O size (minimum/optimal): 512 bytes / 512 bytes

Disklabel type: dos

Disk identifier: 0x3b1ffeba

Device    Boot    Start      End  Sectors  Size Id Type

/dev/sdb1  *        2048  3147775  3145728  1.5G 83 Linux

/dev/sdb2        3147776 138412031 135264256 64.5G  5 Extended

/dev/sdb3      138412032 161480703  23068672  11G 83 Linux

/dev/sdb4      161480704 167770111  6289408    3G 82 Linux swap / Solaris

/dev/sdb5        3149824  34605055  31455232  15G 83 Linux

/dev/sdb6        34607104  66062335  31455232  15G 83 Linux

/dev/sdb7        66064384 138412031  72347648 34.5G 83 Linux

Partition table entries are not in disk order.

b.下面對sda進行分區

root@zfy-PC:/home/zfy# fdisk /dev/sda

Welcome to fdisk (util-linux 2.33.1).                                                                       

Changes will remain in memory only, until you decide to write them.                                         

Be careful before using the write command.

Device does not contain a recognized partition table.

Created a new DOS disklabel with disk identifier 0xb985e226.

Command (m for help): m

#輸入m查看幫助

Help:

  DOS (MBR)

  a  toggle a bootable flag

  b  edit nested BSD disklabel

  c  toggle the dos compatibility flag

  Generic

  d  delete a partition

  F  list free unpartitioned space

  l  list known partition types

  n  add a new partition

  p  print the partition table

  t  change a partition type

  v  verify the partition table

  i  print information about a partition

  Misc

  m  print this menu

  u  change display/entry units

  x  extra functionality (experts only)

  Script

  I  load disk layout from sfdisk script file

  O  mp disk layout to sfdisk script file

  Save & Exit

  w  write table to disk and exit

  q  quit without saving changes

  Create a new label

  g  create a new empty GPT partition table

  G  create a new empty SGI (IRIX) partition table

  o  create a new empty DOS partition table

  s  create a new empty Sun partition table

Command (m for help): n

#輸入n創建一個分區

Partition type

  p  primary (0 primary, 0 extended, 4 free)

  e  extended (container for logical partitions)

Select (default p): p

#選擇主分區

Partition number (1-4, default 1): 1

#選擇編號為1

First sector (2048-4194303, default 2048): 2500000

#起始sector 設為2500000

Last sector, +/-sectors or +/-size{K,M,G,T,P} (2500000-4194303, default 4194303): 4194303

#終止sector 設為4194303

Created a new partition 1 of type 'Linux' and of size 827.3 MiB.

#分區完成,分區大小為827.3 MiB

Command (m for help): n

#繼續創建一個分區

Partition type

  p  primary (1 primary, 0 extended, 3 free)

  e  extended (container for logical partitions)

Select (default p): e

#新增擴展分區

Partition number (2-4, default 2): 2

#選擇編號為2

First sector (2048-4194303, default 2048): 2048

#起始sector為2048

Last sector, +/-sectors or +/-size{K,M,G,T,P} (2048-2499999, default 2499999):

#終止sector為2499999

Created a new partition 2 of type 'Extended' and of size 1.2 GiB.

#新增完成,大小為1.2GiB

Command (m for help): w

#保存

The partition table has been altered.

Calling ioctl() to re-read partition table.

Syncing disks.

c.查看分區後磁碟信息,此時sda磁碟已經有兩個分區

Disk /dev/sda: 2 GiB, 2147483648 bytes, 4194304 sectors

Disk model: VMware Virtual S

Units: sectors of 1 * 512 = 512 bytes

Sector size (logical/physical): 512 bytes / 512 bytes

I/O size (minimum/optimal): 512 bytes / 512 bytes

Disklabel type: dos

Disk identifier: 0xb985e226

Device    Boot  Start    End Sectors  Size Id Type

/dev/sda1      2500000 4194303 1694304 827.3M 83 Linux

/dev/sda2          2048 2499999 2497952  1.2G  5 Extended

Partition table entries are not in disk order.

Disk /dev/sdb: 80 GiB, 85899345920 bytes, 167772160 sectors

Disk model: VMware Virtual S

Units: sectors of 1 * 512 = 512 bytes

Sector size (logical/physical): 512 bytes / 512 bytes

I/O size (minimum/optimal): 512 bytes / 512 bytes

Disklabel type: dos

Disk identifier: 0x3b1ffeba

Device    Boot    Start      End  Sectors  Size Id Type

/dev/sdb1  *        2048  3147775  3145728  1.5G 83 Linux

/dev/sdb2        3147776 138412031 135264256 64.5G  5 Extended

/dev/sdb3      138412032 161480703  23068672  11G 83 Linux

/dev/sdb4      161480704 167770111  6289408    3G 82 Linux swap / Solaris

/dev/sdb5        3149824  34605055  31455232  15G 83 Linux

/dev/sdb6        34607104  66062335  31455232  15G 83 Linux

/dev/sdb7        66064384 138412031  72347648 34.5G 83 Linux

Partition table entries are not in disk order.

d.用ext3的文件系統對分區進行格式化

root@zfy-PC:/home/zfy# mkfs -t ext3 /dev/sda1

mke2fs 1.44.5 (15-Dec-2018)

Creating filesystem with 211788 4k blocks and 52976 inodes

Filesystem UUID: db384338-4af1-4eec-a62d-f2b2f8e0ec96

Superblock backups stored on blocks:

        32768, 98304, 163840

Allocating group tables: done                           

Writing inode tables: done                           

Creating journal (4096 blocks): done

Writing superblocks and filesystem accounting information: done

e.新建一個分區目錄 /data,並掛載

root@zfy-PC:/home/zfy# mkdir data

root@zfy-PC:/home/zfy# mount /dev/sda1 /data

root@zfy-PC:/home/zfy# df -TH /data/#查看是否掛載成功

文件系統      類型  容量  已用  可用 已用% 掛載點

/dev/sda1      ext3  838M  881k  793M    1% /data

f. 用vim打開 etc/fstab並假如 /dev/sda1/data ext3 defaults 0 0,這樣重啟後便不需要再掛載

參考文獻:

【1】 Linux mount命令 | 菜鳥教程 (runoob.com)

【2】 linux添加新磁碟和創建分區 - IT(小菜雞) - 博客園 (cnblogs.com)

C. Linux 命令統計日誌某個欄位的信息

如上圖,某個伺服器的日誌文件,通過命令
grep "Send kafka Success" 2021-08-01-info.log | grep "result_size:100"
可以得到相關日誌。現在要求統計所有result_size累加的結果。

grep "Send kafka Success" 2021-08-01-info.log | grep -o -E "result_size:[0-9]+" | awk -F ':' 'BEGIN{print "開始統計result_size累加和"} {sumSize+=$2 } END{print "sumSize="sumSize}'

sed 命令可以很好的進行行匹配,但從某一行中精確匹配某些內容,則使用 grep 命令並輔以 -o 和 -E 選項可達到此目的。其中 -o 表示「only-matching」,即「僅匹配」之意。光用它不夠,配合 -E 選項使用擴展正則表達式則威力巨大。

比如下面有一條文本 tmp.txt ,其中內容為:

{"aid":45,"path":"attachment/Mon_1112/2_1_5728040df3ab346.jpg"}

我們想從中過略出 aid 的值即 45 ,那麼可以先如下這么做:

grep -o -E 'aid":[1-9]*' tmp.txt

得到的結果為:

aid":45

這時就好辦了,我們可以使用 awk 的 -F 選項指示出冒號分隔符,這樣就容易過濾出 45 這個值來,整個命令綜合如下:

grep -o -E 'aid":[1-9]*' tmp.txt |awk-F: '{print $2}'

參考文檔: https://www.cnblogs.com/hanxing/p/8711705.html

D. 如何查看linux系統警告日誌

1、打開WDCP服務管理系統登錄界面,輸入用戶名和密碼,點擊登錄。

6、在操作日誌中,可以看到進行的操作,必要時可以找回誤刪的數據。

閱讀全文

與linuxjournalsize相關的資料

熱點內容
當樂782舊版本 瀏覽:751
醫院drg可以提取哪些數據 瀏覽:650
一部老虎吃人的電影 瀏覽:137
不用下載可以免費看的 瀏覽:838
凌凌漆電影完整版國語 瀏覽:148
懷孕生子電影大全歐美 瀏覽:702
韓國一部講假期多對情侶 瀏覽:753
壓縮文件可以直接升級嗎 瀏覽:480
oracle游標大資料庫 瀏覽:145
刪除文件命令為linux 瀏覽:506
《黃金屋內多風情》 瀏覽:63
蘋果手機word文件怎麼寫 瀏覽:104
兩片8選1數據選擇器如何四變數 瀏覽:283
linuxcppunit安裝 瀏覽:963
自慰韓國電影 瀏覽:496
PE系統拷貝文件提示需要許可權 瀏覽:644
校園四大天王電影 瀏覽:299
手機emmc編程器哪個好 瀏覽:35
法國禁忌十大片 瀏覽:232
飛盧app怎麼注冊成為作者 瀏覽:400

友情鏈接