LinuxSir.cn,穿越时空的Linuxsir!

 找回密码
 注册
搜索
热搜: shell linux mysql
查看: 942|回复: 1

明天考试,请高手把下面题的答案作出来看看吧

[复制链接]
发表于 2002-12-12 12:08:50 | 显示全部楼层 |阅读模式
Write a single Unix command to save the current date and time into a file called current_date. This file should only contain the current date and time. (1 mark)



Write a single Unix pipeline command to display a sorted list of all unique lines in a file called phone_numbers.txt.  (2 marks)



Write a single Unix pipeline command to display the total number of files begining with a number, but not ending with two numbers. (2 marks)


Write a single Unix pipeline command to display only the file-type information for file types called ascii (either uppercase or lowercase - 2 marks)


Write a single Unix pipeline command to display the number of times that you are logged into the current server (make certain to use one environment variable - 2 marks)


Write a single Unix pipeline command to display only lines 7 to 14 for a file called “input” contained in your current directory (2 marks)


Write a single Unix command to display all pathnames containing the utility grep or all pathnames containing manual pages for the grep utility. (1 mark)




All answers are based on the following tree diagram displayed below. You can assume that your Matrix username is called skywalkr and you will be currently located in the directory called /home/skywalker for each of the following questions. Assume all questions are independent of one another. skywalker and obiwan belong to different groups.


/home
    |- skywalkr
    |         |-- jedi_manual.txt
    |         |-- rebel.TXT
    |         |-- create_force1.TXT
    |         |-- create_force2.c
    |         |-- HOMEWORK1
    |         |-- HOMEWORK2
    |         |-- POD_RACER
    |                  |-- op_manual.txt
    |                  |-- schedule
    |                             |-- june.txt
    |                             |-- august.txt
    |- obiwan
    |     |-- create_force1.TXT
    |     |-- light_saber.txt
    |     |-- pointers.c
    |     |-- TRAINING
    |                |-- jedi_mind_trick.txt

Write a single Unix command to add the following directory path starting from the POD_RACER directory.        (1 mark)

POD_RACER
        |-- MANUALS
        |-- PARTS
                |-- FUSION
      



Write a single Unix command to allow the user obiwan to at least read the files in your schedule directory. You can assume you have pass-through permissions in your home and POD_RACER directories.        (2 marks)



Write a single Unix command to copy all text files (i.e. files that end with an uppercase or lowercase .txt ) in obiwan’s home directory to your home directory. Make certain that you do not accidentally overwrite any of your files.        (2 marks)
发表于 2002-12-12 16:51:28 | 显示全部楼层
这些都是很简单的linux/unix操作,难道你一点都不会吗?
如果你没有把握,你可以把你的答案贴出来,让大家讨论。
您需要登录后才可以回帖 登录 | 注册

本版积分规则

快速回复 返回顶部 返回列表