>> Edit article
이름
제목
패스워드
안녕하세요? 전학원서 유닉스를 배우는 학생입니다. 이번에 저희 선생님이 유닉스 유틸을 이용하는 문제를 냈는데 제 수준에선 넘 어렵군요..나.밥5.. 여기에 관해 아시는 실력있는 분은 제발 답좀 남겨주세요 감사합니다 Followings are the scripting of the current directory. /users/wchung/temp/midterm% ls -R D1/ D2/ D1: d1 d2 d3 D2: d4 d5 d6 /users/wchung/temp/midterm% (a) (5) How do you remove the all the three files under the D1 directory in a single command? 디렉토리 밑에 있는 모든 파일만 지우는 명령어. (b) (5) How do you remove the D1 directory as well as the three files under it? 디렉토리까지 함께 지울수 있는 명령어 (옵션포함)를 나타내시요. (c) (5) How do you make D2/p7 file while you are under midterm directory? 현재 midterm이라는 디렉토리에 있을 때 D2/p7와 같은 p7 디렉토리를 만들수 있는 명령어를 제공하시요. 2. (5) myprog이라는 프로그램을 수행할 때 error 메세지를 errfile에 담아 기록하고 싶다. 어떻게 만들수 있는가? 3. (5) How do you make your program myprogram to run slowly so that other processes might run faster? 내가 실행하고저 하는 프로그램을 다른 프로세스에 양보함으로 천천히 수행하고 싶다면 어떻게 명령어를 사용해야 하는가? 4. (5) How do you make your program myjobs to run still after you loged off the terminal? 5. (5) How do you get all the currently running processes using the ps command? 6. (5) 다음 명령어의 출력은 무엇인가? 그 이유는 무엇인가? $ echo Hello > /dev/null || echo Everyone 7. (5) 다음과 같은 파일을 현재의 디렉토리가 가지고 있을때 아래에서 기대되는 명령어의 출력 내용은? $ ls ch1 ch2 ch3 ch4 ch10 abc ab.c $ ls ch[0-15] . . . 8. (5) Suppose that you are the superuser. You want to change the ownership of all the files under DIR directory. How do you do that? 여기서 DIR은 디렉토리 이름이다. 9. (5) How can you append the string ``This is it!'' at the end of thefile file without using an editor? Use echo command. 10. (5) 현재의 홈디렉토리에서 모든 파일을 가장 오래된 파일부터 최근에 만들어진 파일을 single column으로 출력하고자 한다면 어떤 명령어를 사용하여야 하는가? 11. (5) 현재 CWD (Current Working Directory)가 $HOME이라한다. HW1, HW2 및 HW3의 내용을 하나의 파일 (HW.tar파일) 로 묶어서 만들고자 한다면 어떤 명령어를 사용해야 하는가? 12. (5) Before you retrieve the files from the tar file, how do you know what files are in the archive file? 위 문제에서 실제로 만들어진 tar 파일에서 어떠한 파일들이 존재하는지를 알고 싶다. 어떠한 tar 옵션을 사용하는가? 13. (5) You want to know the file names that are bigger than 200 KBytes in size under your home directroy. How do you find them? 파일의 크기가 200 KByte 이상이 되는 파일 이름을 여러분의 홈디렉토리에서 찾고 싶다. 어떤 명령어를 사용하는가? 14. (10) You want to remove the files that are older than 30 days but is created earlier than thatfile. 파일을 찾는데 만든지 30일 이상 되었지만 thatfile 보다는 늦게 만들어진 파일 이름을 나타낸다. Give the single line command for the job. 한 줄의 명령어를 사용하여 나타내어라. 15. (10) 여러분이 superuser라고 가정하고 본 교과목을 수강하는 모든 학생의 파일을 조사하여 그것의 크기가 100KByte 이상이고 100일 이상 오래된 파일을 찾아 제거 (rm)하고자 한다. 어떤한 명령어를 필요로하는가? 16. (10) With the dictionary words file /usr/share/lib/dict/words (or some other word file), you want to find the all the words starting with the letter k and ending with the same k. 17. (10) 다음 3개의 프로세스 p1, p2 and p3는 순차적으로 실행이 되는 프로그램이며, stdin 및 stdout을 사용할 수 있는 프로그램이라한다. 이때 3개의 프로그램을 실행하여 그 결과를 얻고자 할때 p1의 결과를 p1.out, p2의 결과를 p2.out에 저장하면서 3개의 프로그램을 수행하고자 한다. p1 프로그램의 입력파일이 infile이고 p3의 출력파일이 outfile이라 한다면 이것을 pipeline을 이용하여 어떻게 구현할 수 있는가? 물론, 한 줄의 명령어를 사용한다. 18. (10) 다음은 /etc/passwd파일의 구성중에서 3명의 학생에 관한 내용이다. 본 교과목을 수강하는 학생의 명단을 이름 및 username의 순서로 정열된 파일 NameUID을 생성하시요. 이때 이름과 username은 원래의 field separator와 같이 "colon"을 사용하시요. s5313554:x:20003:102:김수환:/users/sprog/s5313554:/usr/local/bin/tcsh s5313567:x:20004:102:박용훈:/users/sprog/s5313567:/usr/local/bin/tcsh s5313600:x:20005:102:이상재:/users/sprog/s5313600:/usr/local/bin/tcsh 19. (10) 여러분이 생성한 파일중에서 7일 이전에 만들어 졌으며, 그 크기가 100 block이상이 되는 파일을 rm하는 명령어를 제공하시요. 20. (5) 다음의 명령어에 대한 출력을 완성하시요. $ ls -d $HOME > /dev/null && echo FOUND ... $ ls -d $HOME && echo FOUND ... 21. (10) 어떤 디렉토리에 파일의 갯수가 20개 이상이면 너무 많은 파일이 존재한다라고 할 수 있다. 20개 이상의 파일이 존재하면 "Too many files in this directory"라는 메세지를 나타내는 bourne shell 스크립트를 작성하시요. 22. (10) 아래 bourn shell의 출력에대한 내용 (...부분)을 채우시요. $ echo $val rabbits rabbits $ echo ${val:-10} rabbits ... $ echo $val rabbits ... $ echo ${val:=20} rabbits ... $ echo $val rabbits ... $ 23. (10) 다음 출력내용의 ... 부분을 완성하시요. 여기서 $HOME은 학생 자신의 홈디렉토리를 의미한다. $ echo $HOME ... $ echo $HOME ... $ echo "$HOME" ... $ echo '$HOME' ... $ 24. (10) Sometimes we forget the file name that we created, but oftentimes remember what the some parts of contents are. Let's say that you want to find the name of the file in which the word ``Congratulation'' is included. You need to use find command. You had better to consider the back quotation ` ` to execute the command inside and get the standard output as an argument to the find command. 파일 내용의 일부를 이용하여 그 파일 이름을 찾아내는 문제로서 수업시간에 문제의 성격에 대해서 설명을 드렸음. 여러분의 홈디렉토리 밑에 있는 파일중에서 어떤 파일이 "Congratulations"라는 단어를 가지고 있는지 그 파일 이름을 찾아내는 문제이다. 힌트로서 find를 사용하되 디렉토리 파일이 아닌 ordinary file인 경우만을 찾아 그 파일이름을 find command의 argument로 제공한다. 25. (10) Write a Bourne shell script such that it sums and prints to the standard output of all the numerical arguments. --------------------------------------------------------------------------------
Copyleft
1999-2026 by
JSBoard Open Project
Theme Designed by
IDOO
All right reserved