一些有用的脚本

check_version.sh

检查编译环境的版本情况,摘自Linux from Scratch LFS文档

#!/bin/bash
# Simple script to list version numbers of critical development tools
bash --version | head -n1 | cut -d" " -f2-4
echo -n "Binutils: "; ld --version | head -n1 | cut -d" " -f3-4
bzip2 --version 2>&1 < /dev/null | head -n1 | cut -d" " -f1,6-
echo -n "Coreutils: "; chown --version | head -n1 | cut -d")" -f2
diff --version | head -n1
find --version | head -n1
gawk --version | head -n1
gcc --version | head -n1
/lib/libc.so.6 | head -n1 | cut -d" " -f1-7
grep --version | head -n1
gzip --version | head -n1
make --version | head -n1
patch --version | head -n1
sed --version | head -n1
tar --version | head -n1


create_fhs.sh
创建符合FHS标准的根文件系统,摘自FHS文档

#!/bin/bash
#Create Standard Root Directory Structure
#Note: This scripts will create directory at current direcotry

install -d {bin,boot,dev,etc/opt,home,lib,mnt}
install -d {sbin,srv,usr/local,var,opt}
install -d root -m 0750
install -d tmp var/tmp -m 1777
install -d media/{floppy,cdrom}
install -d usr/{bin,include,lib,sbin,share,src}
ln -s share/{man,doc,info} usr
install -d usr/share/{doc,info,locale,man}
install -d usr/share/{misc,terminfo,zoneinfo}
install -d usr/share/man/man{1,2,3,4,5,6,7,8}
install -d usr/local/{bin,etc,include,lib,sbin,share,src}
ln -s share/{man,doc,info} usr/local
install -d usr/local/share/{doc,info,locale,man}
install -d usr/local/share/{misc,terminfo,zoneinfo}
install -d usr/local/share/man/man{1,2,3,4,5,6,7,8}
install -d var/{lock,log,mail,run,spool}
install -d var/{opt,cache,lib/{misc,locate},local}
install -d opt/{bin,doc,include,info}
install -d opt/{lib,man/man{1,2,3,4,5,6,7,8}}

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值