GaGa's Blog

One GaGa, One World !

Shell 脚本是一种用 Shell 语言(通常是 Bash、sh 等)编写的程序,用于自动化任务或执行一系列命令。要运行 Shell 脚本,需要一个特定的运行环境。以下是 Shell 脚本运行环境的详细介绍:


1. 运行 Shell 脚本方式

有几种方法可以在环境中运行 Shell 脚本:

Read more »

在计算机科学中,shell 是一种用户界面,用于与操作系统交互。它通常是一个命令行界面(CLI),允许用户通过输入文本命令来执行任务,比如运行程序、管理文件或配置系统。Shell 的名称来源于它像“壳”一样包裹着操作系统内核,提供了一个与内核沟通的桥梁。

d5352a7a5aada1622c457c7f6131759c.png

常见Shell 类型

  1. Bourne Shell (sh)

    • Unix中最古老的shell之一,由Stephen Bourne开发。
    • 简单但功能有限,很多现代shell都基于它。
  2. Bash (Bourne Again Shell)

    • 最流行的Linux shell,是Bourne Shell的增强版。
    • 支持脚本编写、命令历史、自动补全等功能。
  3. Zsh

    • 一个功能强大的现代shell,扩展了Bash的功能。
    • 提供更好的自定义选项和插件支持,比如Oh My Zsh。
  4. Fish (Friendly Interactive Shell)

    • 以用户友好著称,默认提供语法高亮和智能建议。
  5. PowerShell

    • 微软开发的shell,主要用于Windows,但也支持跨平台。
    • 面向对象,适合系统管理和自动化。
Read more »

Fluent Bit 是一个开源的、高性能的日志处理器和转发器,专为嵌入式系统、物联网设备和云原生环境设计。它由 Treasure Data 开发,现由 CNCF(云原生计算基金会)托管,与 Fluentd 同属一个生态系统,但相比 Fluentd,Fluent Bit 更轻量,资源占用更低,适用于资源受限的场景。

d21f218e7adff052327f1b8b416fe5eb.png

fluent-bit

Read more »

...
Unpacking linux-headers-6.8.0-56 (6.8.0-56.58) ...
dpkg-deb (subprocess): decompressing archive '/var/cache/apt/archives/linux-headers-6.8.0-56_6.8.0-56.58_all.deb' (size=13837808) member 'data.tar': zstd error: Data corruption detected
dpkg-deb: error: <decompress> subprocess returned error exit status 2
...

env

  • ubuntu-24.04.2 LTS (Noble Numbat)
Read more »

OpenObserve 简介

OpenObserve 是一个开源的云原生可观测性平台,专注于日志、指标、追踪、分析和实时用户监控(RUM)。它被设计为 Elasticsearch、Splunk 或 Datadog 的替代品,号称易用性提高 10 倍,存储成本降低 140 倍,支持 PB 级规模。它使用 Rust 编写,内置用户界面,无需额外的组件(如 Kibana),适合快速部署和体验。

使用 Docker 体验 OpenObserve

1. 前提条件

Read more »

dstat命令介绍

dstat 是 Linux 系统中的一个多功能资源统计工具,属于 dstat 软件包。它可以实时监控系统的 CPU、内存、磁盘 I/O、网络流量等多种资源使用情况,被认为是 vmstatiostatnetstatifstat 等传统工具的替代品和增强版。dstat 的优势在于它能以直观的表格形式输出数据,支持灵活的选项和插件,能够同时显示多个维度的统计信息,便于系统管理员和开发者进行性能分析和故障排查。


使用方法

Read more »

1.Fedora Media Writer 介绍

Fedora Media Writer 是一款由 Fedora 项目开发和支持的免费开源工具,旨在帮助用户创建 Fedora Linux 的可启动(Live)USB 安装介质。它提供了一个简单易用的界面,不仅支持将 Fedora 的各种版本(如 Workstation、Server 等)写入 USB 驱动器,还可以直接从官方镜像源下载 Fedora 的 ISO 文件。它适用于 Linux、Windows 和 macOS 等多个平台,是 Fedora 官方推荐的创建安装介质的工具。

download

Read more »

Fedora Workstation Live 42 Beta 于 2025 年 3 月 18 日发布,目前仍处于测试阶段,因此安装过程中可能会遇到一些小问题,但整体体验已经非常接近最终版本。


env

  • virtualbox-v7.1.6
  • Fedora-Workstation-Live-x86_64-42_Beta-1.4.iso
Read more »

1.proc下r/b字段含义解读

3fe06d8e2da8060c65f3373d887da622.png

vmstat 命令中,rb 是两个重要的参数,它们反映了系统的运行状态和资源使用情况。以下是它们的含义:

  • r(run queue):表示运行队列中等待执行的进程数。这个值显示了当前有多少进程正在等待 CPU 资源来运行。如果 r 的值持续高于 CPU 的核心数,说明系统可能存在 CPU 资源瓶颈,任务调度压力较大。

  • b(blocked processes):表示处于不可中断睡眠状态(blocked)的进程数。这些进程通常在等待 I/O 操作(如磁盘读写)完成。如果 b 的值较高,说明系统可能存在 I/O 瓶颈,进程被阻塞在等待外部资源上

Read more »

在 Ubuntu 或其他基于 Debian 的系统中,**dpkg 是一个底层的包管理工具,用于处理 .deb 包**的安装、卸载、查询等操作。


dpkg help

root@vgt-ubuntu-10:~# dpkg --help
Usage: dpkg [<option>...] <command>

Commands:
  -i|--install       <.deb file name>... | -R|--recursive <directory>...  ### 安装
  --unpack           <.deb file name>... | -R|--recursive <directory>...
  -A|--record-avail  <.deb file name>... | -R|--recursive <directory>...
  --configure        <package>... | -a|--pending
  --triggers-only    <package>... | -a|--pending
  -r|--remove        <package>... | -a|--pending   ### 移除
  -P|--purge         <package>... | -a|--pending   ### 移除包及配置
  -V|--verify [<package>...]       Verify the integrity of package(s).
  --get-selections [<pattern>...]  Get list of selections to stdout.
  --set-selections                 Set package selections from stdin.
  --clear-selections               Deselect every non-essential package.
  --update-avail [<Packages-file>] Replace available packages info.
  --merge-avail [<Packages-file>]  Merge with info from file.
  --clear-avail                    Erase existing available info.
  --forget-old-unavail             Forget uninstalled unavailable pkgs.
  -s|--status [<package>...]       Display package status details.
  -p|--print-avail [<package>...]  Display available version details.
  -L|--listfiles <package>...      List files 'owned' by package(s).  ### 列出包内文件
  -l|--list [<pattern>...]         List packages concisely.
  -S|--search <pattern>...         Find package(s) owning file(s).
  -C|--audit [<package>...]        Check for broken package(s).
  --yet-to-unpack                  Print packages selected for installation.
  --predep-package                 Print pre-dependencies to unpack.
  --add-architecture <arch>        Add <arch> to the list of architectures.
  --remove-architecture <arch>     Remove <arch> from the list of architectures.
  --print-architecture             Print dpkg architecture.
  --print-foreign-architectures    Print allowed foreign architectures.
  --assert-help                    Show help on assertions.
  --assert-<feature>               Assert support for the specified feature.
  --validate-<thing> <string>      Validate a <thing>'s <string>.
  --compare-versions <a> <op> <b>  Compare version numbers - see below.
  --force-help                     Show help on forcing.
  -Dh|--debug=help                 Show help on debugging.

  -?, --help                       Show this help message.
      --version                    Show the version.

Validatable things: pkgname, archname, trigname, version.

Use dpkg with -b, --build, -c, --contents, -e, --control, -I, --info,
  -f, --field, -x, --extract, -X, --vextract, --ctrl-tarfile, --fsys-tarfile
on archives (type dpkg-deb --help).

Options:
  --admindir=<directory>     Use <directory> instead of /var/lib/dpkg.
  --root=<directory>         Install on a different root directory.
  --instdir=<directory>      Change installation dir without changing admin dir.
  --pre-invoke=<command>     Set a pre-invoke hook.
  --post-invoke=<command>    Set a post-invoke hook.
  --path-exclude=<pattern>   Do not install paths which match a shell pattern.
  --path-include=<pattern>   Re-include a pattern after a previous exclusion.
  -O|--selected-only         Skip packages not selected for install/upgrade.
  -E|--skip-same-version     Skip packages whose same version is installed.
  -G|--refuse-downgrade      Skip packages with earlier version than installed.
  -B|--auto-deconfigure      Install even if it would break some other package.
  --[no-]triggers            Skip or force consequential trigger processing.
  --verify-format=<format>   Verify output format (supported: 'rpm').
  --no-pager                 Disables the use of any pager.
  --no-debsig                Do not try to verify package signatures.
  --no-act|--dry-run|--simulate
                             Just say what we would do - don't do it.
  -D|--debug=<octal>         Enable debugging (see -Dhelp or --debug=help).
  --status-fd <n>            Send status change updates to file descriptor <n>.
  --status-logger=<command>  Send status change updates to <command>'s stdin.
  --log=<filename>           Log status changes and actions to <filename>.
  --ignore-depends=<package>[,...]
                             Ignore dependencies involving <package>.
  --force-<thing>[,...]      Override problems (see --force-help).
  --no-force-<thing>[,...]   Stop when problems encountered.
  --refuse-<thing>[,...]     Ditto.
  --abort-after <n>          Abort after encountering <n> errors.
  --robot                    Use machine-readable output on some commands.

Comparison operators for --compare-versions are:
  lt le eq ne ge gt       (treat empty version as earlier than any version);
  lt-nl le-nl ge-nl gt-nl (treat empty version as later than any version);
  < << <= = >= >> >       (only for compatibility with control file syntax).

Use 'apt' or 'aptitude' for user-friendly package management.
Read more »

vmstat 是一个在类 Unix 系统中常用的命令行工具,用于报告虚拟内存统计信息。它可以显示系统的内存使用情况、CPU 活动、磁盘 I/O 以及进程相关的信息。


1. 命令简介

vmstat 的全称是 “virtual memory statistics”(虚拟内存统计)。它是一个轻量级的工具,适合实时监控系统性能,尤其在分析内存瓶颈、CPU 使用率或 I/O 负载时非常有用。输出的信息通常以表格形式展示,包含多个字段,反映系统的运行状态。

Read more »
0%