论坛风格切换切换到宽版
  • 576阅读
  • 6回复

[问题求助]在国外学习linux,作业求助 [复制链接]

上一主题 下一主题
离线taimushan.
 
发帖
2270
C币
-60211
威望
434
贡献值
1
银元
-3
铜钱
5074
人人网人气币
0
只看楼主 倒序阅读 使用道具 楼主  发表于: 2009-05-01
Write your answers into a single text file. Su.bmit the text fil.e. 域名


(16 marks)
Hints. Use a single. comma.nd line where possible. Check your answers. 健康



Write UNIX .commands to 服务器


a) show. the. current value of the environment variable PATH.     健康


b) show the count of how many characters the date c.o.mmand outputs.              电子


c) copy all C source fi.les (the filenames have the .extension .c) fr.om the present working direc.tory into a subdirectory called Cfiles. --------------彩票


d) list all files in .the present working directory that .hav.e filenames that match: 外贸
starts .with ei.ther a or B 电影


AND the extensio.n .is a single digit .


e.) comp.ress all the files in the directory Docs/ and store them .in an archive called Docs.tar .


f) sort the file /etc/passwd in reverse alphabetical order by usern.ame. I.ts the firs.t field.            女人


g) Change to. th.e tsch shell.              电子

h) Append the date and current proces.ses list to a file calle.d Log. .


(4 marks)
m1, m2 and m3 are text files. .What do the fol.low commands do unde.r bash? Explain your answer. .


a.) cat m2 & m1 投资


b) cat 0 m1  sort 1 m2 .2. m3     健康


(4 marks)
A d.irectory structure look.s like: 投资


             .            .           /学习
                               .  /  .   \    外汇
                              .  /   .    \.
   .               .           subdir1  subdir2.
                          .    /   \  .     \.
.                            /     .\       \    健康
                 .      .   file1  file2   subdir3.
              
  That is:
     subdir1 a..nd subdir2 are subdirectories of the root directory /;.
     s.ubdir1 contains file1 and file2;..
     and subdir2. contains su.bdirectory subdir3外贸


a) What is the absolute pathname fo.r su.bdir3            鲜花
(

b) If the pr.esent working directory is /subdir1 give a command to move all the files in subdir1 into subdir3. using .r.elative pathnames.           婚庆



(6 marks)
Br.ief answers please.               乙肝


a) Wha.t are the 4 freedoms associated with Free Software.? see www.gnu.org/ph.ilosophy/free-sw.html <性病>



b) Why GNU claim free soft.ware is. more reliable than proprietary software? --------------彩票

c) Name a .URL th.at has online tutorial on Linux.虚拟主机

评价一下你浏览此帖子的感受

精彩

感动

搞笑

开心

愤怒

无聊

灌水
发帖
2059
C币
-132341
威望
398
贡献值
1
银元
-2
铜钱
4694
人人网人气币
0
只看该作者 沙发  发表于: 2010-04-14
作业要自己做。。。

发帖
2168
C币
-60397
威望
407
贡献值
1
银元
-1
铜钱
4944
人人网人气币
0
只看该作者 板凳  发表于: 2010-04-14
既然是作业,为什么不自己做呢?
老师不可能要你们做一些毫无头绪的东西吧。

离线sisikie.
发帖
2119
C币
-60363
威望
375
贡献值
1
银元
-7
铜钱
4641
人人网人气币
0
只看该作者 地板  发表于: 2010-04-14
在国外更要学会自力更生阿……

离线lin0.
发帖
1969
C币
-235422
威望
377
贡献值
1
银元
-1
铜钱
4513
人人网人气币
0
只看该作者 4楼 发表于: 2010-04-14
Hints. Use a single command line where possible. Check your answers.



Write UNIX commands to


a) show the current value of the environment variable PATH.
( $echo $PATH )

b) show the count of how many characters the date command outputs.
( $date | wc -c )

c) copy all C source files (the filenames have the extension .c) from the present working directory into a subdirectory called Cfiles.
( $cp *.c Cfiles )

d) list all files in the present working directory that have filenames that match:
starts with either a or B
( $ls {a,B}?  )

AND the extension is a single digit


e) compress all the files in the directory Docs/ and store them in an archive called Docs.tar
( $tar -zcvf Docs.tar Docs/  )

f) sort the file /etc/passwd in reverse alphabetical order by username. Its the first field.
( $sort -r /etc/passwd )

g) Change to the tsch shell.
   (  $tcsh  )
h) Append the date and current processes list to a file called Log.
( ps >> Log )

(4 marks)
m1, m2 and m3 are text files. What do the follow commands do under bash? Explain your answer.


? a) cat m2 >& m1
? b) cat 0< m1 | sort 1> m2 2> m3

(4 marks)
A directory structure looks like:


                                    /
                                 /     \
                                /       \
                             subdir1  subdir2
                              /   \       \
                             /     \       \
                          file1  file2   subdir3
              
  That is:
     subdir1 and subdir2 are subdirectories of the root directory /;
     subdir1 contains file1 and file2;
     and subdir2 contains subdirectory subdir3


a) What is the absolute pathname for subdir3
( /root/subdir2/subdir3 )

b) If the present working directory is /subdir1 give a command to move all the files in subdir1 into subdir3 using relative pathnames.
( cp -r * ../subdir2/subdir3  )

离线samual142.
发帖
2122
C币
-60236
威望
412
贡献值
1
银元
-1
铜钱
4815
人人网人气币
0
只看该作者 5楼 发表于: 2010-04-14
很想帮你看啊,不过不太看得懂
对于检察,你把答案敲出来看是否满足题目要求不就是了~

离线qiusibo.
发帖
2049
C币
-559669
威望
386
贡献值
3
银元
0
铜钱
4557
人人网人气币
0
只看该作者 6楼 发表于: 2010-04-14
这个作业很不错,特别是最后几题!
——再次反思国人教育

快速回复
限100 字节
如果您在写长篇帖子又不马上发表,建议存为草稿
 
上一个 下一个