项⽬linux基本命令1答案,10.项⽬Linux基本命令1
实训项⽬1 Linux基本命令
⼀、实训⽬的
? 掌握Linu各类命令的使⽤⽅法; ? 熟悉Linx操作环境
⼆、实训内容
练习使⽤Linux常⽤命令,达到熟练应⽤的⽬的 三、实训步骤
⼦项⽬1.⽂件和⽬录类命令的使⽤
利⽤root⽤户登录到系统,进⼊字符界⾯。 1)⽤pwd命令查看当前所在⽬录。
2)⽤ls命令列出此⽬录下的⽂件和⽬录。
3)⽤-a选项列出此⽬录下包括隐藏⽂件在内的所有⽂件和⽬录。 4)⽤man命令查看ls命令 的使⽤⼿册 5)在当前⽬录下,创建测试⽬录test .
mkdir test
6)利⽤ls命令列出⽂件和⽬录,确认test⽬录创建成功. 7)进⼊test⽬录,利⽤pwd查看当前⼯作⽬录.
8)利⽤touch命令,在当前⽬录创建⼀个新的空⽂件newfile。
touch newfile
9)利⽤cp命令复制系统⽂件/etc/profile到当前⽬录下
cp /etc/profile .
10)复制⽂件profile到⼀个新的⽂件profile.bak,作为备份
cp profile profile.bak
11)⽤ls命令以长格的形式列出当前⽬录下的所有⽂件,注意⽐较每个⽂件的长度和创建时间的不同
ls –l
12)⽤less命令分屏查看⽂件profile的内容.(注:使⽤/字符串,可以在less中查特定的字符)
13)⽤grep命令在profile⽂件中对关键字then进⾏查询,并与上⾯的结果⽐较。
grep -n then profile
14)给⽂件profile创建⼀个软连接lnsprofile和⼀个硬链接lnhprofile
ln –s profile lnsprofile ln profile lnhprofile
15)⽤长格形式显⽰⽂件profile、lnsprofile和lnhprofile的详细信息。
ls –l = ll
16)⽤less命令查看⽂件lnsprofile的内容,显⽰什么?
17) ⽤less命令查看⽂件lnhprofile的内容,显⽰什么? 18)回到上层⽬录
cd ..
19)将当前的⽇期写⼊到linux1中.
date > linux1
20)把⽂件linux1改名为linux2。
mv linux1 linux2
21)显⽰当前⽬录下的⽂件和⽬录列表,确认重命名成功。ls
22)把⽂件linux2移动到test⽬录下。
mv linux2 test
23)显⽰当前⽬录下的⽂件和⽬录列表,确认移动成功。
ls testlinux查看当前路径命令
24)进⼊么test的上⼀级⽬录,复制test⽬录为testbak⽬录. cd ..
cp –R test testbak
25)查etc⽬录下的所有以.conf结尾的⽂件。
Find /etc -name “*.conf”
26)删除test⼦⽬录下的所有⽂件。(在test⽗⽬录下进⾏) rm –rf test
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系QQ:729038198,我们将在24小时内删除。
发表评论