• 파일시티 이벤트
  • LF몰 이벤트
  • 서울좀비 이벤트
  • 탑툰 이벤트
  • 닥터피엘 이벤트
  • 아이템베이 이벤트
  • 아이템매니아 이벤트

시스템프로그래밍 Lecture4,5 linux command, string

*지*
개인인증판매자스토어
최초 등록일
2015.01.04
최종 저작일
2013.04
18페이지/한글파일 한컴오피스
가격 1,000원 할인쿠폰받기
다운로드
장바구니

소개글

수정할 곳 없는 정말 완벽한 보고서입니다.
보고서 쓰시는데 도움이 되었으면 좋겠습니다.

목차

Lecture4 : linux command
9) Redirect the output of ex1 to another file using ">" symbol.
10) Use grep to search "hello" in all files (use –nr option).
11) Find out what processes exist in your system. Use "ps –ef".
12) "ps -ef" shows all the processes in the system. How do you know which ones are yours? Remember all of you are using the same user ID, and the question is how you can tell which processes belong to you. Use "tty" for this purpose.
13) Modify ex1.c so that it receives two numbers from the user and prints the sum. Use scanf() for this.
14) Modify ex1.c so that it contains an infinite loop after printing "hello".
15) Run the program with & at the end, and use ps to check its status.
16) Kill it.
17) Run the program again without & at the end. Open another login window, find out the process ID of the process running in the first window, and kill it.
18) Use objdump to dump the assembly code of ex1. The dump file is very long. How can you read this file?
19) Write a program to read a sentence and echo it as follows.

Lecture5 : string
hw5-1) Try above code.
hw5-2) Same as 1), but print all ascii codes for characters in x[0] to x[9].
hw5-3) Declare a character array with 128 rooms. Store 0 to 127 in this array and print the corresponding character for each ascii code in the array. Find ASCII table in the Internet and confirm the results.
hw5-3-1) Generate a random 5-letter name using rand() function. Read a 5-letter name from the user and check if they are same.
hw5-5) Define a character array x with 50 rooms. Store “hello” in x. Print x. Compare x with “hel” and “hello” using strcmp(). What are the comparison results? Display each character in x using %c and %d. What is the length of x?
hw5-6) Read a mixture of an integer, string, character and display them. Use scanf() to read the inputs.
hw 5-7-1) Do hw 5-3-1) again, but this time store the random name as a string in name1. name1 should have a length of at least 6. Use strcmp() to implement eqname().
char name1[6];
5-10) Use strtok to extract words from a sentence and store them in an array. Display the number of words as below.

본문내용

9) Redirect the output of ex1 to another file using ">" symbol.

처음에는 ex라는 파일이 없었으나 >심볼을 사용하여 ex을 생성하고 ex1.c의 결과를 복사하고 실행하였다.

10) Use grep to search "hello" in all files (use –nr option).
$ grep는 해당 문자열이 포함된 파일을 찾아주는 명령어입니다. 여기에 –nr이라는 option을 사용하여 해당 문자열이 파일에서 몇 번째 라인인지 검색하여 나타내줍니다.

11) Find out what processes exist in your system. Use "ps –ef".

$ ps –e : 현재 실행중인 모든 프로세스를 표시한다.
$ ps -f : 프로세스 시작시간, 프로세스의 부모 ID, 그 프로세스에 관련된 사용자ID, 명령 이름과 가능한 매개변수(있다면) 등 모든 정보를 출력한다.
$ ps -p(pid) : 지정된 프로세스에 대한 정보를 출력한다.
$ ps -t(tty) : 지정된 터미널에 연관된 프로세스에 대한 정보를 출력한다.
$ ps -u(uid) : 지정된 사용자에 연관된 프로세스에 대한 정보를 출력한다.

<중 략>

$ kill : 프로세스에 시그널을 전송하는 명령어이다. 시그널 지정을 생략한 경우, TERM 시그널을 전송하여 프로세스를 전송시킨다. 쉘 빌트인으로서의 KILL명령어는 프로세스 ID 대신 job 번호를 사용할 수 있다.
$ kill [PID] : 시그널을 보내고 싶은 프로세서의 ID를 지정하여 종료한다.

Ctrl+c를 이용하여 프로그램을 강제 종료할 수 있고, Kill 명령어를 사용하여 종료할 수 있다.

17) Run the program again without & at the end. Open another login window, find out the process ID of the process running in the first window, and kill it.

tty 명령어를 이용하여 현재 나의 터미널명이 pts/1이라는 것을 알 수 있고, ./ex1 명령어로 실행시킨다.

참고 자료

없음
*지*
판매자 유형Silver개인인증

주의사항

저작권 자료의 정보 및 내용의 진실성에 대하여 해피캠퍼스는 보증하지 않으며, 해당 정보 및 게시물 저작권과 기타 법적 책임은 자료 등록자에게 있습니다.
자료 및 게시물 내용의 불법적 이용, 무단 전재∙배포는 금지되어 있습니다.
저작권침해, 명예훼손 등 분쟁 요소 발견 시 고객센터의 저작권침해 신고센터를 이용해 주시기 바랍니다.
환불정책

해피캠퍼스는 구매자와 판매자 모두가 만족하는 서비스가 되도록 노력하고 있으며, 아래의 4가지 자료환불 조건을 꼭 확인해주시기 바랍니다.

파일오류 중복자료 저작권 없음 설명과 실제 내용 불일치
파일의 다운로드가 제대로 되지 않거나 파일형식에 맞는 프로그램으로 정상 작동하지 않는 경우 다른 자료와 70% 이상 내용이 일치하는 경우 (중복임을 확인할 수 있는 근거 필요함) 인터넷의 다른 사이트, 연구기관, 학교, 서적 등의 자료를 도용한 경우 자료의 설명과 실제 자료의 내용이 일치하지 않는 경우

이런 노하우도 있어요!더보기

최근 본 자료더보기
탑툰 이벤트
시스템프로그래밍 Lecture4,5 linux command, string 무료자료보기
  • 레이어 팝업
  • 레이어 팝업
  • 레이어 팝업
AI 챗봇
2024년 06월 03일 월요일
AI 챗봇
안녕하세요. 해피캠퍼스 AI 챗봇입니다. 무엇이 궁금하신가요?
11:06 오전
New

24시간 응대가능한
AI 챗봇이 런칭되었습니다. 닫기