导航:首页 > 编程系统 > 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相关的资料

热点内容
同性恋男电影 浏览:796
kettle大数据效率 浏览:725
在网站提交文件提交不了该怎么办 浏览:680
有一部关于射箭的外国电影 浏览:157
上海点合网络技术 浏览:100
阿甘正传主人公叫什么 浏览:353
信用卡客户数据库 浏览:714
湖北延长产假的文件哪里找 浏览:155
牛蛙吃人的电影名字 浏览:93
免费鬼片观看 浏览:342
在线免费观看韩国高分爱情片韩国伦理片 浏览:707
mod是什么文件 浏览:777
韩国女保姆的电影 浏览:788
微信发送照片如何不变文件名称 浏览:453
穿越一战欧洲类小说 浏览:948
韩国动漫电影爱情推理片 浏览:464
主角叫萧晨的重生小说 浏览:355
印度迷情杀机演员 浏览:194
微信朋友圈找不到视频文件夹 浏览:262
亚马逊原始森林电影大全 浏览:879

友情链接