# dotfiles **Repository Path**: jqhr/dotfiles ## Basic Information - **Project Name**: dotfiles - **Description**: linux dotfiles备份 - **Primary Language**: Shell - **License**: GPL-3.0 - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2020-01-27 - **Last Updated**: 2026-02-14 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # linux 配置和linux 软件 和 技巧 * [基本配置文件](#基本配置文件) * [常用软件](#常用软件) * [文本查看与搜索](#文本查看与搜索) * [文件管理](#文件管理) * [模糊查找与导航](#模糊查找与导航) * [系统监控](#系统监控) * [开发工具](#开发工具) * [命令行增强](#命令行增强) * [网络与下载](#网络与下载) * [终端美化与娱乐](#终端美化与娱乐) * [美化](#美化) * [Komorebi](#komorebi) * [linux 命令注记](#linux-命令注记) * [last](#last) * [nc](#nc) * [findmnt](#findmnt) * [pkill](#pkill) * [column](#column) * [at](#at) * [i3wm 相关软件配置](#i3wm-相关软件配置) * [软件列表](#软件列表) * [flameshot](#flameshot) * [compton](#compton) * [linux_notification_center](#linux_notification_center) * [终端控制台用法](#终端控制台用法) * [rime 配置](#rime-配置) ## 基本配置文件 .dircolors i3 i3status .vimrc .Xmodmap .Xresources ## 常用软件 ### 文本查看与搜索 | 软件名称 | 功能描述 | 安装方式 | 官网 | | -------- | -------- | -------- | ---- | | **bat** | cat 的替代者,提供语法高亮和类似 less 的支持 | 包管理器安装 | [GitHub](https://github.com/sharkdp/bat) | | **ag** | 比 grep/ack 更快的文本内容搜索工具 | `sudo zypper in the_silver_searcher` | - | | **fx** | 命令行 JSON 处理工具 | `npm install -g fx` | [GitHub](https://github.com/antonmedv/fx) | | **yq** | 命令行 JSON/YAML/XML 处理器 | 见官网 | [GitHub](https://github.com/mikefarah/yq) | ### 文件管理 | 软件名称 | 功能描述 | 安装方式 | 官网 | | -------- | -------- | -------- | ---- | | **ranger** | 类 vim 的终端文件浏览器 | 包管理器安装 | - | | **nnn** | 快速的终端文件浏览器,支持多标签 | 包管理器安装 | [GitHub](https://github.com/jarun/nnn) | | **ncdu** | 磁盘空间分析工具,du 的替代者 | `sudo zypper in ncdu` | - | | **dust** | 更直观的磁盘空间分析工具,Rust 编写 | `cargo install dust` | [GitHub](https://github.com/bootandy/dust) | | **di** | df 命令的高级版本 | `sudo zypper in di` | [官网](http://www.gentoo.com/di/) | | **fpp** | 命令行路径识别与交互选择工具 | 见官网 | [GitHub](https://github.com/facebook/PathPicker) | ### 模糊查找与导航 | 软件名称 | 功能描述 | 安装方式 | 官网 | | -------- | -------- | -------- | ---- | | **fzf** | 强大的模糊查找工具,支持目录搜索和历史命令 | 见官网 | [GitHub](https://github.com/junegunn/fzf) | | **fzy** | 轻量级模糊查找工具,用 C 编写 | 包管理器安装 | [GitHub](https://github.com/jhawthorn/fzy) | | **z** | 目录历史记录与快速跳转(bash) | 见官网 | [GitHub](https://github.com/rupa/z) | | **z.lua** | 目录历史记录与快速跳转(zsh) | 见官网 | [GitHub](https://github.com/skywind3000/z.lua) | | **zoxide** | 更智能的目录跳转工具,Rust 编写 | `curl -sS https://webinstall.dev/zoxide \| bash` | [GitHub](https://github.com/ajeetdsouza/zoxide) | ### 系统监控 | 软件名称 | 功能描述 | 安装方式 | 官网 | | -------- | -------- | -------- | ---- | | **progress** | 监控 cp、mv 等命令的进度 | 包管理器安装 | [GitHub](https://github.com/Xfennec/progress) | | **nethogs** | 网络流量监控,按进程显示带宽占用 | 包管理器安装 | [GitHub](https://github.com/raboof/nethogs) | | **nmon** | 系统状态监控工具,类似 htop | 包管理器安装 | - | | **gotop** | 系统状态监控,比 glances 快 | 见官网 | [GitHub](https://github.com/cjbassi/gotop) | | **ytop** | gotop 的 Rust 重写版本 | `cargo install ytop` | [GitHub](https://github.com/cjbassi/ytop) | ### 开发工具 | 软件名称 | 功能描述 | 安装方式 | 官网 | | -------- | -------- | -------- | ---- | | **tokei** | 代码行数统计工具,比 cloc 更快 | `cargo install tokei` | [GitHub](https://github.com/XAMPPRocky/tokei) | | **mise** | 开发环境管理工具,类似 asdf | `curl https://mise.run \| sh` | [官网](https://mise.jdx.dev/) | | **Claude Code** | Anthropic 官方 CLI 工具,AI 编程助手 | `npm install -g @anthropic-ai/claude-code` | [官网](https://claude.ai/code) | ### 命令行增强 | 软件名称 | 功能描述 | 安装方式 | 官网 | | -------- | -------- | -------- | ---- | | **x-cmd** | POSIX shell 编写的强大工具集 | `eval "$(curl https://get.x-cmd.com)"` | [官网](https://x-cmd.com/) | | **iflow** | AI 命令行工具,智能辅助操作 | 见官网 | - | | **how2** | 自然语言查询 shell 命令用法 | `npm install -g how-2` | [GitHub](https://github.com/santinic/how2) | | **cheat** | 命令行备忘录,查看常用命令示例 | 见官网 | [GitHub](https://github.com/cheat/cheat) | | **navi** | 交互式命令行备忘单工具 | 见官网(需 fzf) | [GitHub](https://github.com/denisidoro/navi) | | **http-prompt** | 交互式 HTTP 客户端 | `pip install http-prompt` | [官网](https://http-prompt.com/) | ### 网络与下载 | 软件名称 | 功能描述 | 安装方式 | 官网 | | -------- | -------- | -------- | ---- | | **apt-fast** | apt-get 加速脚本,使用多线程下载 | 见官网 | - | | **translate-shell** | 命令行翻译工具 | `sudo zypper in translate-shell` | [GitHub](https://github.com/soimort/translate-shell) | | **You-Get** | 命令行视频下载工具 | 见官网 | [GitHub](https://github.com/soimort/you-get) | ### 终端美化与娱乐 | 软件名称 | 功能描述 | 安装方式 | 官网 | | -------- | -------- | -------- | ---- | | **catimg** | 在终端显示图片 | `dnf install catimg` | [GitHub](https://github.com/posva/catimg) | | **emoj** | 命令行表情包工具 | 见官网 | [GitHub](https://github.com/sindresorhus/emoj) | | **Terminalizer** | 命令行录制工具,生成 GIF 或 web 播放器 | 见官网 | [GitHub](https://github.com/faressoft/terminalizer) | ## 美化 ### Komorebi Komorebi是适用于所有Linux平台的出色动画墙纸管理器。它提供了完全可定制的图像,视频和网页壁纸,可以随时对其进行调整!

Platform (GNU/Linux) Awesome Build Status

#### 安装方式 #### Packaged install (easy) 1. Download `Komorebi` from the [Komorebi releases page](https://github.com/cheesecakeufo/komorebi/releases). 2. Install Komorebi using your favorite package installer (aka. double click on it) 3. Launch Komorebi! [ github ](https://github.com/cheesecakeufo/komorebi) ## linux 命令注记 ### last last 是一个记录用户访问本机的命令,包含用户名时间、tty等 ``` last ``` ### nc netcat 网络工具的瑞士军刀 ``` # To open a TCP connection from to of , with a timeout of nc -p -w # To open a UDP connection to of : nc -u # To open a TCP connection to port 42 of using as the IP for the local end of the connection: nc -s # To create and listen on a UNIX-domain stream socket: nc -lU /var/tmp/dsocket # To connect to of via an HTTP proxy at , # . This example could also be used by ssh(1); see the ProxyCommand # directive in ssh_config(5) for more information. nc -x: -Xconnect # The same example again, this time enabling proxy authentication with username "ruser" if the proxy requires it: nc -x: -Xconnect -Pruser # To choose the source IP for the testing using the -s option nc -zv -s source_IP target_IP Port ``` ### findmnt 树形结构查看已经加载的文件系统 ``` findmnt TARGET SOURCE FSTYPE OPTIONS / /dev/sda2 ext4 rw,relatime,data=ordered ├─/sys sysfs sysfs rw,nosuid,nodev,noexec,relatime │ ├─/sys/kernel/security securityfs securityfs rw,nosuid,nodev,noexec,relatime │ ├─/sys/fs/cgroup tmpfs tmpfs ro,nosuid,nodev,noexec,mode=755 │ │ ├─/sys/fs/cgroup/unified cgroup cgroup2 rw,nosuid,nodev,noexec,relatime │ │ ├─/sys/fs/cgroup/systemd cgroup cgroup rw,nosuid,nodev,noexec,relatime,xattr,name=systemd │ │ ├─/sys/fs/cgroup/cpu,cpuacct cgroup cgroup rw,nosuid,nodev,noexec,relatime,cpu,cpuacct │ │ ├─/sys/fs/cgroup/rdma cgroup cgroup rw,nosuid,nodev,noexec,relatime,rdma │ │ ├─/sys/fs/cgroup/freezer cgroup cgroup rw,nosuid,nodev,noexec,relatime,freezer │ │ ├─/sys/fs/cgroup/cpuset cgroup cgroup rw,nosuid,nodev,noexec,relatime,cpuset │ │ ├─/sys/fs/cgroup/blkio cgroup cgroup rw,nosuid,nodev,noexec,relatime,blkio │ │ ├─/sys/fs/cgroup/memory cgroup cgroup rw,nosuid,nodev,noexec,relatime,memory │ │ ├─/sys/fs/cgroup/net_cls,net_prio cgroup cgroup rw,nosuid,nodev,noexec,relatime,net_cls,net_prio │ │ ├─/sys/fs/cgroup/devices cgroup cgroup rw,nosuid,nodev,noexec,relatime,devices │ │ ├─/sys/fs/cgroup/perf_event cgroup cgroup rw,nosuid,nodev,noexec,relatime,perf_event │ │ ├─/sys/fs/cgroup/pids cgroup cgroup rw,nosuid,nodev,noexec,relatime,pids │ │ └─/sys/fs/cgroup/hugetlb cgroup cgroup rw,nosuid,nodev,noexec,relatime,hugetlb │ ├─/sys/fs/pstore pstore pstore rw,nosuid,nodev,noexec,relatime │ ├─/sys/kernel/debug debugfs debugfs rw,relatime │ │ └─/sys/kernel/debug/tracing tracefs tracefs rw,relatime │ └─/sys/fs/fuse/connections fusectl fusectl rw,relatime ├─/proc proc proc rw,nosuid,nodev,noexec,relatime │ └─/proc/sys/fs/binfmt_misc systemd-1 autofs rw,relatime,fd=31,pgrp=1,timeout=0,minproto=5,maxproto=5,direct,pipe_ino=13885 ├─/dev devtmpfs devtmpfs rw,nosuid,size=1594276k,nr_inodes=398569,mode=755 │ ├─/dev/shm tmpfs tmpfs rw,nosuid,nodev │ ├─/dev/pts devpts devpts rw,nosuid,noexec,relatime,gid=5,mode=620,ptmxmode=000 │ ├─/dev/mqueue mqueue mqueue rw,relatime │ └─/dev/hugepages hugetlbfs hugetlbfs rw,relatime ├─/run tmpfs tmpfs rw,nosuid,nodev,mode=755 │ └─/run/user/1000 tmpfs tmpfs rw,nosuid,nodev,relatime,size=321236k,mode=700,uid=1000,gid=100 │ └─/run/user/1000/gvfs gvfsd-fuse fuse.gvfsd-fuse rw,nosuid,nodev,relatime,user_id=1000,group_id=100 └─/home /dev/sda5 xfs rw,relatime,attr2,inode64,noquota ``` ### pkill 按进程名称杀死进程 #### Example ```sh pkill uwsgi # this will kill the process which command name uwsgi ``` 类似的还有killall ### column column 是一个格式化输出的命令,比如mount 输出的挂载项没有按空格对齐,但是mount| column -t却能够对齐 ```sh mount sysfs on /sys type sysfs (rw,nosuid,nodev,noexec,relatime) proc on /proc type proc (rw,nosuid,nodev,noexec,relatime) devtmpfs on /dev type devtmpfs (rw,nosuid,size=1596580k,nr_inodes=399145,mode=755) securityfs on /sys/kernel/security type securityfs (rw,nosuid,nodev,noexec,relatime) tmpfs on /dev/shm type tmpfs (rw,nosuid,nodev) devpts on /dev/pts type devpts (rw,nosuid,noexec,relatime,gid=5,mode=620,ptmxmode=000) tmpfs on /run type tmpfs (rw,nosuid,nodev,mode=755) tmpfs on /sys/fs/cgroup type tmpfs (ro,nosuid,nodev,noexec,mode=755) cgroup on /sys/fs/cgroup/unified type cgroup2 (rw,nosuid,nodev,noexec,relatime) cgroup on /sys/fs/cgroup/systemd type cgroup (rw,nosuid,nodev,noexec,relatime,xattr,name=systemd) ... mount|column -t sysfs on /sys type sysfs (rw,nosuid,nodev,noexec,relatime) proc on /proc type proc (rw,nosuid,nodev,noexec,relatime) devtmpfs on /dev type devtmpfs (rw,nosuid,size=1596580k,nr_inodes=399145,mode=755) securityfs on /sys/kernel/security type securityfs (rw,nosuid,nodev,noexec,relatime) tmpfs on /dev/shm type tmpfs (rw,nosuid,nodev) devpts on /dev/pts type devpts (rw,nosuid,noexec,relatime,gid=5,mode=620,ptmxmode=000) tmpfs on /run type tmpfs (rw,nosuid,nodev,mode=755) tmpfs on /sys/fs/cgroup type tmpfs (ro,nosuid,nodev,noexec,mode=755) cgroup on /sys/fs/cgroup/unified type cgroup2 (rw,nosuid,nodev,noexec,relatime) cgroup on /sys/fs/cgroup/systemd type cgroup (rw,nosuid,nodev,noexec,relatime,xattr,name=systemd) ``` ### at 计划任务,安排任务在指定时间执行,如 ```sh echo "ls -l > /dev/pts/0" | at 14:012 ``` ## i3wm 相关软件配置 ### 软件列表 ### flameshot linux 下优秀的截图软件,可截图并编辑 [github](https://raw.githubusercontent.com/lupoDharkael/flameshot/master/img/preview/animatedUsage.gif) #### compton 透明窗口管理器(需要安装) i3 config 下执行 exec --no-startup-id compton -b ### linux_notification_center Haskell编写的通知中心,面向喜欢具有样式的桌面的用户。 ![screenshot](https://github.com/phuhl/linux_notification_center/blob/master/README.org.img/org_20181125_131724_ZI9o09.jpg) [github](https://github.com/phuhl/linux_notification_center) ## 终端控制台用法 linux控制台和终端自带的快捷键 小贴士:执行bind -p 可以查看终端快捷键 | command | intro | | --------- | -------------------------- | | \ | 进入行首 | | \ | 进入历史命令筛选模式 | | \ | 进入行尾 | | \ | 向后移动一个字符 | | \ | 向前移动一个字符 | | \ | 删除当前字符到行首的字符 | | \ | 向前删除一个字符 | | \ | 清除屏幕 | | \ | 删除一个单词(以空格为分割) | | \ | 后退一个单词 | | \ | 前进一个单词 | 以上是emacs快捷键 bash/zsh有vi-mode,set -o vi即可切换,不过vi mode仅在命令过长的情况下才有用 ## rime 配置 1.opensuse 安装好ibus-rime 之后,在system setting > region and language 里添加rime 2.从http://98wb.ys168.com/上下载Lua版-98五笔-Gnome-ibus解决方案,下载完之后,运行里而的appimage文件,然后将其中的rime.tar.xz解压$HOME/.config/ibus/rime中,并将其中的fonts添加到系统字体(fc-cache或其他都可以) 3.配置完之后运行 ``` killall ibus-daemen ibus-daemen -d ```