前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >Bash快捷指令

Bash快捷指令

作者头像
宋天伦
发布2023-10-20 12:57:31
2020
发布2023-10-20 12:57:31
举报
文章被收录于专栏:frytea

本文 首发于 🌱 煎茶,请注明 来源。

查看磁盘使用情况命令#

代码语言:javascript
复制
$ df -lh                # 查看磁盘使用情况及文件系统挂载位置, -h 为根据大小适当显示
$ fdisk -l              # 查看磁盘分区表及分区结构, -l 获得所有硬盘的分区情况
$ du -sh                # 查看当前目录的大小
$ du -lh --max-depth=1  # 查看当前目录下一级子文件和子目录占用的磁盘容量。

# df -lh
文件系统                        容量  已用  可用 已用% 挂载点
devtmpfs                        937M     0  937M    0% /dev
tmpfs                           958M     0  958M    0% /dev/shm
tmpfs                           383M  924K  383M    1% /run
/dev/mapper/fedora_fedora-root   15G  5.1G   10G   34% /
tmpfs                           958M  4.0K  958M    1% /tmp
/dev/sda2                      1014M  193M  822M   19% /boot
/dev/sda1                       599M  8.5M  591M    2% /boot/efi
tmpfs                           192M  4.0K  192M    1% /run/user/0

# fdisk -l
Disk /dev/sda:127 GiB,136365211648 字节,266338304 个扇区
磁盘型号:Virtual Disk
单元:扇区 / 1 * 512 = 512 字节
扇区大小(逻辑/物理):512 字节 / 4096 字节
I/O 大小(最小/最佳):4096 字节 / 4096 字节
磁盘标签类型:gpt
磁盘标识符:83C725D2-CC2F-428D-9B8F-195886809B76

设备          起点      末尾      扇区   大小 类型
/dev/sda1     2048   1230847   1228800   600M EFI 系统
/dev/sda2  1230848   3327999   2097152     1G Linux 文件系统
/dev/sda3  3328000 266336255 263008256 125.4G Linux LVM

Disk /dev/mapper/fedora_fedora-root:15 GiB,16106127360 字节,31457280 个扇区
单元:扇区 / 1 * 512 = 512 字节
扇区大小(逻辑/物理):512 字节 / 4096 字节
I/O 大小(最小/最佳):4096 字节 / 4096 字节

Disk /dev/zram0:957 MiB,1003487232 字节,244992 个扇区
单元:扇区 / 1 * 4096 = 4096 字节
扇区大小(逻辑/物理):4096 字节 / 4096 字节
I/O 大小(最小/最佳):4096 字节 / 4096 字节

git 设置和取消代理#

代码语言:javascript
复制
git config --global http.proxy http://192.168.6.233:7890
git config --global https.proxy https://192.168.6.233:7890

git config --global http.proxy http://127.0.0.1:7890
git config --global https.proxy https://127.0.0.1:7890

只对github进行代理,对国内的仓库不影响
git config --global http.https://github.com.proxy http://192.168.6.107:7890
git config --global https.https://github.com.proxy https://192.168.6.107:7890

git config --global http.https://github.com.proxy http://127.0.0.1:7890
git config --global https.https://github.com.proxy https://127.0.0.1:7890

git config --global --unset http.proxy
git config --global --unset https.proxy

npm config delete proxy

设置和取消代理#

代码语言:javascript
复制
export http_proxy=192.168.6.233:7890
export https_proxy=192.168.6.233:7890

export http_proxy="socks5://127.0.0.1:7070"
export https_proxy="socks5://127.0.0.1:7070"
要取消该设置:1)

unset http_proxy
unsethttps_proxy

参考文献#

注:本作品采用 知识共享署名-非商业性使用-相同方式共享 4.0 国际许可协议 进行许可。

本文参与 腾讯云自媒体同步曝光计划,分享自作者个人站点/博客。
如有侵权请联系 cloudcommunity@tencent.com 删除

本文分享自 作者个人站点/博客 前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文参与 腾讯云自媒体同步曝光计划  ,欢迎热爱写作的你一起参与!

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
目录
  • 查看磁盘使用情况命令#
    • git 设置和取消代理#
      • 设置和取消代理#
      • 参考文献#
      领券
      问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档