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