Linux实验一报告-副本_第1页
Linux实验一报告-副本_第2页
Linux实验一报告-副本_第3页
Linux实验一报告-副本_第4页
Linux实验一报告-副本_第5页
已阅读5页,还剩6页未读 继续免费阅读

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

1、南京工程学院课程名称 实验名称 院系专业班级实验报告书Linux系统分析Linux的环境认识与常用命令使用计算机工程学院数据科学与大数据技术学生姓名 学生学号 指导教师 成 绩yuyu-VirtualBox:*$ mail user010mcs.njnutar * 111.txt222.txtyuyu-VtrtualBox:-/202180436$ Is1 111.txt 2 222.txt yu.taryuyu-VirtualBox:-/202180436$ tar tvf yu.tar-yu/yu0 2021-03-18 14:22 111.txt-yu/yu0 2021-03-18 14

2、:22 222.txtyuyu-VirtualBox:-/202180436$ !2. mail指令使用-c错误。yuyu-VtrtualBox:*$ mail -s 标题”-c HYPERLINK mailto: HYPERLINK mailto:rootmcs.hpc.njn rootmcs.hpc.njn yu.txt mail: unrecognized option -c,yu0yu-VtrtualBox:mail -s 标题 HYPERLINK mailto: rootmcs.hpc.njnu.e txt13:54 111.txt13:54 yu.txtyuyu-VtrtualBo

3、x:*/yu$ Is 111.txt yu.txt yuyu-VtrtualBox:*/yu$ chmod yuyu-VtrtualBox:*/yu$ Is -1 总用量0-rw-r-r- 1 yu yu 0 3月 18rw-r-r- 1 yu yu 0 3月 18ugo+ 111.txt13:54 111.txt13:54 yu.txt将111. txt设为所有人皆可读。yuyu-VirtualBox:-/yu$ chmod yuyu-VtrtualBox:*/yu$ Is -1总用量0-rwxrwxrwx 1 yu yu 0 3月 18rw-r-r- 1 yu yu 0 3月 18R a+

4、 yu.txt13:54 111.txt13:54 yu.txt将yu. txt设为任何人可读取。yuyu-VtrtualBox:*/yu$ chmod yuyu-VtrtualBox:-/yu$ Is -1总用量e-rwxrwxrwx 1 yu yu 0 3月 18-rwxr-r- 1 yu yu 0 3月 18u+x yu.txt13:54 111.txt13:54 yu.txt将yu. txt设定为只有该档案拥有者可以执行。此外chmod也可以用数字来表示权限 语法为:chmod abc file其中a, b, c各为一个数子,分别表示User、Group及Other的权限。r=4, w

5、=2, x=l假设要rwx属性那么4+2+l=7;假设要rw-属性那么4+2=6;假设要r-x属性那么4+1=7oyuyu-VtrtualBox:*/yu$ chmod 777 111.txt yuyu-VtrtualBox:*/yu$ Is -I 总用量0rwxrwxrwx 1 yu yu 0 3月 18 13:54 111.txt-rw-r-r- 1 yu yu 0 3月 18 13:54 yu.txt将111. txt设为所有人皆可读可写可执行。假设用chmod 4755 filename可使此程式具有root的权限(6)指令名称:1s使用方式:Is -alrtAFR name.说明:显

6、示指定工作目录下之内容(列出目前工作目录所含之档案及子目 录)。yuQyu-VtrtualBox:/bin$-rwxr-xr-x1rootroot-rwxr-xr-x1rootroot rwxr-xr-x1rootroot-rwxr-xr-x1rootroot-rwxr-xr-x1rootroot rwxr-xr-x1rootroot-rwxr-xr-x1rootroot rwsr-xr-x1rootroot-rwxr-xr-x1rootroot-rwxr-xr-x1rootroot rwxr-xr-x1rootroot-rwxr-xr-x1rootroot-rwxr-xr-x1rootroo

7、t rwxr-xr-x1rootroot-rwxr-xr-x1rootroot rwxr-xr-x1rootroot-rwxr-xr-x1rootroot-rwxr-xr-x1rootroot-rwxr-xr-x1rootroot1 rwxrwxrwx1rootrootIrwxrwxrwx1rootrootIrwxrwxrwx1rootrootIrwxrwxrwx1rootrootyuflyu-VirtualBox:/btnSIs -Itr355123500075992350004314410900013990444664391032669671752430801440818496144168

8、4328144001032018235244207* 月月月月月月月月月月 S*月月月月月月月月月wuwdv遥遥V月月月月 411111234111111111199992218181822302623231515151515151515151520202020201720182018201820182018201820192019201920192019201920192019201920192019201922:0722:0722:0722:07setfaclsync stty sleep setfont sedsssusetupconsystend-tty-ask-password-ag

9、ent systemd-trnpfiles systemd-sysusers systemd-nottfysystemd-machine-id-setup systemd-inhibitsystemd-hwdb systemd-escape systemd-ask-password systemctlsh.dtstrtb - dash sh - dashsystemd - /lib/systemd/systemd static-sh - busybox列出目前工作目录下所有名称是s开头的档案,愈新的排愈后面。yuyu-VtrtualBox:/bin$ cd yuyu-VtrtualBox :*

10、-$ Is -AF202180436/ac.a.c.swo.a.c.swp ash bash_history bashlogoutbashrc.cache/.config/engexamples . desktop.gnupg/ICEauthority.local/math.mozilla/profile.sudoasadmin successful.viminfo.xinputrcyu/公共的/模板/频片档载乐面视图文下音桌yuyu-VtrtualBox:-$列出工作目录下所有档案及目录,目录于名称后加可执行档后加yuyu-VtrtualBox:-$ Is -IR/binbashfusern

11、isdomainnamesttybrlttyfusermountntfs-3gSUbunzipZbesyncbusyboxgrepntfscatsystemctlbzcatgunztpntfsclustersystemdbzcmpgzexentfscmpsystemd-ask-passwordbzdtffgztpntfsfallocatesystemd-escapebzegrephctconfigntfsftxsystemd-hwdbbzexehostnamentfsinfosystemd-lnhibttbzfgrepIPntfslssystemd-mach

12、ine-id-setupbzgrepjournalctlntfsmovesystemd-notifybztpZkbd_modentfsrecoversystemd-sysusersbzip2recoverkillntfssecaudttsystemd-tmpftiesbzlesskmodntfstruncatesystemd-tty-ask-password-agentbzmorelessntfsusermaptarcatlessechontfswtpetempftlechadlessfileopentouchchgrplesskeyopenvttruechmodlesspipepidofud

13、evadmchownInPgulockmgr_serverchvtloadkeysptng4amountcploginping6unamecplologinctlPlymouthuncompressdashlowntfs-3gPSuntcode_start将/bin目录以下所有目录及档案详细资料列出。(7)指令名称:rm使用方式:rm options name.说明:删除档案及目录。yuyu-VirtualBox:*$ cd yu yuyu-VirtualBox:*/yu$ Is 111.txt yu.txt yuyu-VirtualBox:-/yu$ rm -i *.txt rm:是否删除普

14、通空文件lll.txf? y rm:是否删除普通空文件-yu.txf? n yuyu-VirtualBox:*/yu$ Is yu. txt vuvu-VltualBox:/vuS删除所有txt文件,删除前逐一询问确认。确认删除111. txt,不删除yu. txtoyuyu-VirtualBox:*/yu$ mkdir 11 yuyu-VirtualBox:*/yu$ Is11 yu.txtyuyu-VirtualBox:*/yu$ rm -r 11 yuyu-VirtualBox:*/yu$ Is yu.txt yuyu-VirtualBox:*/yu$ |将11子目录及子目录中所有档案删

15、除。(8)指令名称:rmdir使用方式: rmdir -p dirName 说明:删除空的目录。参数:-P是当子目录被删除后使它也成为空目录的话,那么顺便一并删除。yuyu-Virtual.Box:-/yu$ mkdir 111 yuyu-VirtualBox:-/yu$ Is111 yu.txtyuyu-VirtualBox:-/yu$ rmdtr 111yuyu-VirtualBox:-/yu$ Is yu.txt yuyu-VttualBox:-/yu$ ,册i)除111目录。yuyu-VirtualBox:*/yu/l$ mkdir 2 yuyu-VirtualBox:*/yu/l$

16、Is 2 yuyu-VtrtualBox:*/yu/l$ cd yuQyu-VtrtualBox:M/yu$ Is 1yuyu-VtrtualBox:-/yu$ rmdtr -p 1/2 yuyu-VirtualBox:/yu$ Is yuyu-VlrtualBox:/yu$在工作目录下的1目录中,删除名为2的子目录。假设2删除后,1目录成为空 目录,那么1亦予删除。(9)指令名称:touch使用方式:touch -acfm-r reference-file -file=reference-file_-t MMDDhhmmCCYY . ss-d time -date=time -time=at

17、ime, access, use, mtime, modify-no-create -help -versionfilel file2 .说明:touch指令改变档案的时间记录。Is -1可以显示档案的时间记录。yuyu-VtrtualBox:*/202180436$ Is -It总用量0rw-r-r- 1 yu yu 0 3月 18 14:15 11 yu yu 0 3月 18 14:14 2yuyu-VirtualBox:-/202180436$ touch -c -t 03171200 1yuyu-VirtualBox:*/2O2180436$ Is -It总用量0rw-r-r- 1 y

18、u yu 0 3月 18 14:14 2rw-r-r- 1 yu yu 0 3月 17 12:00 1vuvu-VtrtualBox:-7202180436$ I将1的时间记录改为3月17日12点0分。通过Is -It命令查看结果。yuyu-VtrtualBox:*/202180436$ Is -It总用量0rw-r-r- 1 yu yu 0 3月 18 14:14 2-rw-r-r- 1 yu yu 0 3月 17 12:00 1yuyu-VirtualBox:*/202180436$ touch -21yuyu-VtrtualBox:*/202180436$ Is -It总用量0rw-r-

19、r- 1 yu yu 0 3月 18 14:14 1rw-r-r- 1 yu yu 0 3月 18 14:14 2VUvu-VlrtualBox:/202180436$ .将1的时间记录改变成与2一样。yuyu-VtrtualBox:-/202180436$ Is -It总用量0rw-r-r- 1 yu yu 0 3月 18 14:14 1rw-r-r- 1 yu yu 0 3月 18 14:14 2yuyu-VirtualBox:-/202180436$ touch -d ”03/08/2021” 1yuyu-VirtualBox:-/202180436$ Is -It总用量01 yu yu

20、 0 3月 18 14:14 2w-1 yu yu 。 3月 81将1的时间记录改成2021年3月8日。(10)指令名称:gzip说明:gzip命令用于压缩文件。 参数:-d将压缩文件解压yuyu-VirtualBox:*/202180436$ Is1 llletxt 2 222.txtyuyu-VtrtualBox:*/202180436$ gzip 111.txtyuyu-VtrtualBox:*/202180436$ Is1 111.txt.gz 2 222.txtyuyu-VtrtualBox:*/202180436$ gzip -d 111.txtgzyuyu-VtrtualBox:

21、-/202180436$ Is1 Ill-txt 2 222.txtyuyu-VtrtualBox:-/202180436$压缩ni.txt文件,压缩后变为红色;解压iu.txt.gz。(11)指令名称:tar说明:tar可以为文件和目录创立档案。利用tar,用户可以为某一特定文件 创立档案(备份文件),也可以在档案中改变文件,或者向档案中加入新的文 件。tar最初被用来在磁带上创立档案,现在,用户可以在任何设备上创立档 案,如软盘。利用tar命令,可以把一大堆的文件和目录全部打包成一个文件, 这对于备份文件或将几个文件组合成为一个文件以便于网络传输是非常有用 的。yuyu-VtrtualBo

22、x:-/202180436$ tar cvf yu.tar * 111.txt 222.txtyuyu-VtrtualBox:-/202180436$ Is1 111.txt 2 222.txt yu.taryuyu-VirtualBox:-/202180436$ tar tvf yu.tar-yu/yu0 2021-03-18 14:22 111.txt-yu/yu0 2021-03-18 14:22 222.txtyuyu-VirtualBox:-/202180436$ !将当前目录中所有文件存档到yu. tar中,并浏览其中内容。yuyu-VirtualBox:*/202180436$ tar xvf yu.tar 111.txt 222.txt将yu. tar档案中的内容取到当前目录中。新版的tar可以直接访问和建立gzip压缩的tar档案,只要在tar命令中加 上z选项就可以了。例如:yuyu-Vtrtua

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

评论

0/150

提交评论