#!/bin/bash
#在以下部分写出完成任务的命令
#*********begin*********#
cd /
ls -a
#********* end *********#
#!/bin/bash
#在以下部分写出完成任务的命令
#*********begin*********#
touch newfile
mkdir newdir
cp newfile newdir/newfileCpy
#********* end *********#
#!/bin/bash
#在以下部分写出完成任务的命令
#*********begin*********#
man fopen
#********* end *********#
#!/bin/bash
#在以下部分写出完成任务的命令
#***********begin*************#
useradd -m newUser
userdel -r oldUser
cd /home/newUser
pwd
#************end**************#
#!/bin/bash
#创建newUser新用户
#***********begin*************#
useradd -m newUser
#************end**************#
#在符号<<前输入设置用户密码的命令(命令与<< EOF保持在同一行), 密码输入在下一行,确认密码输入在下下行
#例如:
#command << EOF
#password
#password
#EOF
#***********begin*************#
passwd newUser << EOF
123
123
EOF
#************end**************#
#!/bin/bash
#创建newUser新用户
#***********begin*************#
useradd -m newUser
#************end**************#
#在符号<<前输入设置用户密码的命令(命令与<< EOF保持在同一行), 密码输入在下一行,确认密码输入在下下行
#例如:
#command << EOF
#password
#password
#EOF
#***********begin*************#
passwd newUser << EOF
123
123
EOF
#************end**************#
#使用su命令切换当前用户身份为newUser,并且执行whoami指令,然后恢复原来的身份;
#提示使用su命令的-c参数完成
#***********begin*************#
su -c whoami newUser
#************end**************#
#!/bin/bash
#在以下部分写出完成任务的命令
#***********begin*************#
groupadd -r newGroup
groupadd -g newGroupID
groupadd -g 1010 newGroupID
groupdel oldGroup
#************end**************#
#!/bin/bash
#在以下部分写出完成任务的命令
#***********begin*************#
useradd -m newUser
usermod -a -G oldGroup newUser
#************end**************#
#!/bin/bash
#在以下部分写出完成任务的命令
#***********begin*************#
usermod -l newName oldName
usermod -d/home/newName newName
groupmod -n newGroup oldGroup
#************end**************#
#!/bin/bash
#在以下部分写出完成任务的命令
#***********begin*************#
touch file1 file2
rm oldFile1 oldFile2
#************end**************#
#!/bin/bash
#在以下部分写出完成任务的命令
#***********begin*************#
mkdir newDir1 newDir2
rm -r oldDir1 oldDir2
#************end**************#
#!/bin/bash
#在以下部分写出完成任务的命令
#***********begin*************#
cp file1 file2 Dir
cp file1 Dir/file1Cpy
mv file3 file4 Dir
mv file5 file6
#************end**************#
#!/bin/bash
#在以下部分写出完成任务的命令
#***********begin*************#
cp -r Dir1 Dir2 Dir
cp -r Dir1 Dir/Dir1Cpy
mv Dir3 Dir4 Dir
mv Dir5 Dir6
#************end**************#
#!/bin/bash
#在以下部分写出完成任务的命令
#***********begin*************#
cat file1
head -n 5 file2
tail -n 5 file2
ls -a /home/
#************end**************#
#!/bin/bash
#在以下部分写出完成任务的命令
#***********begin*************#
chmod u=x oldFile1
chmod g-w oldFile2
chmod o+x oldFile3
chmod 421 oldFile4
#************end**************#
#!/bin/bash
#在以下部分写出完成任务的命令
#***********begin*************#
chmod u=x oldDir1
chmod g-w oldDir2
chmod o+x oldDir3
chmod 421 oldDir4
chmod -R 421 oldDir5
#************end**************#
#!/bin/bash
#在以下部分写出完成任务的命令
#***********begin*************#
chown oldUser oldFile
chown oldUser oldDir1
chown -R oldUser oldDir2
#************end**************#
#!/bin/bash
#在以下部分写出完成任务的命令
#***********begin*************#
chgrp oldGroup oldFile
chgrp oldGroup oldDir1
chgrp -R oldGroup oldDir2
#************end**************#
#!/bin/bash
#在以下部分写出完成任务的命令
#*********begin*********#
du -h oldFile
du -a oldDir
#********* end *********#
#!/bin/bash
#在以下部分写出完成任务的命令
#***********begin*************#
ln oldFile oldFileHardLink
ln -s oldFile oldFileSoftLink
ln -s oldDir oldDirSoftLink
#************end**************#
#!/bin/bash
#在以下部分写出完成任务的命令
#***********begin*************#
chmod u+x,u+s oldFile1
chmod g+s oldDir1
chmod u-s oldFile2
chmod g-s oldDir2
#************end**************#
#!/bin/bash
#在以下部分写出完成任务的命令
#***********begin*************#
chmod o+t oldDir1
chmod o-t oldDir2
#************end**************#
#!/bin/bash
#在以下部分写出完成任务的命令
#***********begin*************#
sudo chattr +i /root/oldFile1
lsattr -Ra /root/oldFile2
sudo chattr -i /root/oldFile3
#************end**************#
#!/bin/bash
#在以下部分写出完成任务的命令
#*********begin*********#
touch oldFile1 oldFile2
tar -cvf newFile.tar oldFile1 oldFile2
tar -xvf oldFile.tar
#********* end *********#
#!/bin/bash
#在以下部分写出完成任务的命令
#*********begin*********#
tar -zcvf newFile.tar.gz oldFile1 oldFile2
bzip2 oldFile.tar
zip oldDir.zip oldDir
#********* end *********#
#!/bin/bash
#在以下部分写出完成任务的命令
#*********begin*********#
tar -zxvf oldFile.tar.gz
bunzip2 oldFile.tar.bz2
unzip oldDir.zip
#********* end *********#
#!/bin/bash
#在以下部分写出完成任务的命令
#*********begin*********#
locate -c group
sudo updatedb
locate newFile
#********* end *********#
#!/bin/bash
#在以下部分写出完成任务的命令
#***********begin*************#
which useradd
whereis useradd
whereis -m useradd
#************end**************#
#!/bin/bash
#在以下部分写出完成任务的命令
#***********begin*************#
find -name "*.conf"
find -name "my*"
find /root -size +1M
find /root -type l -name "*Link" -exec ls -l {} \;
#************end**************#