RHCE033 Lecture15

本文介绍了计算机中文件系统的概念,包括目录、文件类型、符号链接等,并提供了一个用于批量创建用户及其密码的Shell脚本示例。通过本文,读者可以了解文件系统的组织方式以及如何使用基本的文件系统命令。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

Partitions and Filesystems

 

Inodes

 

A directory is a mapping between the human name for the file and the computer's inode number .

 

 

ln -s /root/1.txt .

 

ln-s ../1.txt 3.txt 

 

The seven fundamental file types

 

d   directory

 

b   block special file

 

c character special file

 

du -hs  /etc/      search  firm space 

 

df -h   serach  filesystem

 

Removable Media

 

tar cvf etc.tar /etc/

 

tar cvzf etc.tar.gz /etc/

 

file etc.tar      check the file format

 

tar cvjf etc.tar.bz2

 

tar vxf etc.tar.bz2 -C /tmp    -C   save the files to directory

 

vim users.txt

 

tom:123

jack:123

jace:123

 

vim /sample

 

 

#!/bin/bash

 

if  [   $UID -ne 0 ]

then

                 echo "Please run this scripts "

                  exit 1

 

fi

 

DBFILE=/root/users.txt

for USRINFO in 'cat $DBFILE

do

              USERNAME='echo  $USERINFO |cut -d: -f1 '

              PASSWORD='echo $USERINFO | cut -d: -f2'

              if 'id $USERNAME&> /dev/null '  ;then

                   echo " User exist." &> /dev/null

                   else

                                         useradd $USERNAME

                            fi

                                echo $PASSWORD | passwd - -stdin $USERNAME

 

              done

 

 

 

 

 

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值