版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
1、course materials may not be reproduced in whole or in part without the prior written permission of ibm.5.04.1 copyright ibm corporation 2008 unit 5 using files copyright ibm corporation 2008unit objectivesafter completing this unit, you should be able to: use the cp command to copy files use the mv
2、command to move or rename files use the wc command to count the number of lines, words, and bytes in a named file use the ln command to allow a file to have more than one name display the contents of a file using the cat, pg, and more commandsuse the rm command to remove files print files copyright
3、ibm corporation 2008to copy the file /home/team03/pgms/suba to /home/team01/doc and name it programa:$ pwd/home/team01/doc$ cp /home/team03/pgms/suba programamon_reporttrio_ltrwalrushometeam01docmon_reportprogramatrio_ltrwalrushometeam01doccp source targetcp file1 file2 . target_dir beforeaftercopyi
4、ng files copyright ibm corporation 2008$ cd /home/team01$ cp doc/programa test1 filemanualstest1cprogramaprogramatest1dochometeam01ctrio_ltrtrio_ltrdochometeam01ctrio_ltrdoc$ cd /home/team01/doc$ cp trio_ltr ./ccp examples copyright ibm corpor
5、ation 2008$ pwd/home/team01/c$ mv trio_ltr t.letterhometeam01ctrio_ltrhometeam01ct.lettermv source target mv file1 file2 . target_dir moving and renaming files copyright ibm corporation 2008$ pwd/home/team01/c$ mv t.letter ./doc/letterhometeam01cmon_reportdochometeam01ctrio_ltrletterdochometeam01ctr
6、io_ltrt.letterdochometeam01cmon_reportdoc$ pwd/home/team01/c$ mv ./doc/mon_report .mv examples copyright ibm corporation 2008$ cat walrusthe time has come, the walrus said,to talk of many things:of shoes - and ships - and sealing wax -of cabbages - and kings -and why the sea is boiling hot - and whe
7、ther pigs have wings.from the walrus and the carpenterby lewis carroll (1871)cat file1 file2 . listing file contents copyright ibm corporation 2008pg filenamemore filename $ pg walrusthe time has come, the walrus said,to talk of many things:of shoes - and ships - and sealing wax -of cabbages - and k
8、ings -and why the sea is boiling hot - and whether pigs have wings.: one page at a time$ more walrusthe time has come, the walrus said,to talk of many things:of shoes - and ships - and sealing wax -of cabbages - and kings -and why the sea is boiling hot - and whether pigs have wings.walrus (100%) di
9、splaying files copyright ibm corporation 200817126 1085 myfilecharacterswordslineswc commandthe wc command counts the number of lines, words, and bytes in a named file:$ wc -c -l -w filenameoptions:-ccounts the number of bytes-lcounts lines-wcounts wordsexample:$ wc myfile copyright ibm corporation
10、2008activityactivity: working with the wc command copyright ibm corporation 2008 allows files to have more than one name in the directory structure both files reference the same i-node cannot be used with directories, cannot span file systemsln source_file target_file linking files$ ls li63 -rw-r-r-
11、 2 team01 staff 1910 nov 21 14:19 man_files$ ln man_files manuals$ ls -li63 -rw-r-r- 2 team01 staff 1910 nov 21 14:19 man_files63 -rw-r-r- 2 team01 staff 1910 nov 21 14:19 manuals$ copyright ibm corporation 2008 creates an indirect reference to a file (symbolic link) name references the original fil
12、es name and path can be used with directories and span file systemsln s source_file target_file linking files (cont.)$ ls li63 -rw-r-r- 2 team01 staff 1910 nov 21 14:19 man_files$ ln s man_files manuals$ ls -li63 -rw-r-r- 1 team01 staff 1910 nov 21 14:19 man_files66 lrwxrwxrwx 1 team01 staff 1910 no
13、v 21 14:19 manuals - man_files$ copyright ibm corporation 2008rm file1 file2 file3 . removing files$ lsmon_report trio_ltr walrus$ rm mon_report$ lstrio_ltr walrus$ rm i walrusrm: remove walrus?y$ lstrio_ltr$ copyright ibm corporation 2008printing fileslqprt - queue files to the printerlqchk display
14、 the current status of a print queuelqcan cancel a print job (specify job number)$ qprt walrus$ qchkqueue dev status job files user pp% blks cp rnklp0 lp0 running 99 walrus team01 1 1 1 1$ qcan x 99$ copyright ibm corporation 2008checkpoint1. what is the effect of the following commands?$ cd /home/t
15、eam01$ cp file1 file22. what is the effect of the following commands?$ cd /home/team01$ mv file1 newfile3. what is the effect of the following commands?$ cd /home/team01$ ln newfile myfile4. list commands that can be used to view the contents of a file. copyright ibm corporation 2008checkpoint solut
16、ions1. what is the effect of the following commands?$ cd /home/team01$ cp file1 file2the cp command creates a new file, file 2 from a copy of file1. each copy will have a different name, as shown, file1 and file2. the two copies are independent of each other. if one file is modified, it does not ref
17、lect in the second file.2. what is the effect of the following commands?$ cd /home/team01$ mv file1 newfilethese commands will rename file1 to newfile. file1 will no longer exist, but instead be shown as newfile.3. what is the effect of the following commands?$ cd /home/team01$ ln newfile myfilethe
18、file called newfile is now know as myfile. an ls -l will show both files. an ls li will show that both files share the same node number. note that there is still only one physical file on disk. if a change is made to newfile that change will also be reflected if using myfile.4. list commands that can be used to view the contents of a file.cat, pg, more copyright ibm corporation 2008exercise: using files copyright ibm corporation 2008unit summarythe cp command can be used to copy files.the mv command can be used to
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- GB/T 29999-2026铜矿山酸性废水综合处理规范
- 《儿童慢性病居家深静脉血栓预防专科护理》
- Chapter 1- Alibaba.com跨境基础及电商1
- 湖南郴州汝城县2025-2026学年数学三下期末考试模拟试题(含答案)
- 科学探索日:发现周围的世界小学主题班会课件
- 企业信息安全管理规范实施手册
- 个人信用管理三步骤操作指南
- 湖南省长沙市岳麓区2025届数学三年级上学期阶段调研模拟试题含答案解析
- 2026年年终业绩报告通知(8篇范文)
- 采购订单延期交付提醒函(7篇)
- 2025年贵阳市中考地理试卷(含答案解析)
- 四川省南充市普通高中2024-2025学年高一下学期期末学业质量监测地理试题(原卷版)
- 高中地理教师考试教案模板
- Q-JJJ 9002-2025 铁路建设项目安全穿透式管理实施指南
- T/SHWSHQ 01-2023医疗卫生机构安全生产标准化管理规范
- 高考英语必背单词10000词汇思马得记忆法100句背7000单词
- 2025-2030年中国液体燃烧油行业竞争格局及投资发展预测研究报告
- 农业职业经理人考试的实操能力评测试题及答案
- 家中老年人常见急救知识培训
- AI技术赋能办公室工作:机遇、挑战与对策
- DB11T 065-2022 电气防火检测技术规范
评论
0/150
提交评论