• AI글쓰기 2.1 업데이트
BRONZE
BRONZE 등급의 판매자 자료
non-ai
판매자가 AI를 사용하지 않은 독창적인 자료

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

수정할 곳 없는 정말 완벽한 보고서입니다. 보고서 쓰시는데 도움이 되었으면 좋겠습니다.
18 페이지
한컴오피스
최초등록일 2015.01.04 최종저작일 2013.04
18P 미리보기
시스템프로그래밍 Lecture4,5 linux command, string
  • 미리보기

    소개

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

    목차

    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 명령어로 실행시킨다.

    참고자료

    · 없음
  • 자료후기

      Ai 리뷰
      지식판매자가 제공한 자료는 정보가 풍부하고, 내용이 명확하게 정리되어 있어 과제를 작성하는데 큰 도움이 되었습니다. 매우 추천할 만한 자료입니다!
    • 자주묻는질문의 답변을 확인해 주세요

      해피캠퍼스 FAQ 더보기

      꼭 알아주세요

      • 자료의 정보 및 내용의 진실성에 대하여 해피캠퍼스는 보증하지 않으며, 해당 정보 및 게시물 저작권과 기타 법적 책임은 자료 등록자에게 있습니다.
        자료 및 게시물 내용의 불법적 이용, 무단 전재∙배포는 금지되어 있습니다.
        저작권침해, 명예훼손 등 분쟁 요소 발견 시 고객센터의 저작권침해 신고센터를 이용해 주시기 바랍니다.
      • 해피캠퍼스는 구매자와 판매자 모두가 만족하는 서비스가 되도록 노력하고 있으며, 아래의 4가지 자료환불 조건을 꼭 확인해주시기 바랍니다.
        파일오류 중복자료 저작권 없음 설명과 실제 내용 불일치
        파일의 다운로드가 제대로 되지 않거나 파일형식에 맞는 프로그램으로 정상 작동하지 않는 경우 다른 자료와 70% 이상 내용이 일치하는 경우 (중복임을 확인할 수 있는 근거 필요함) 인터넷의 다른 사이트, 연구기관, 학교, 서적 등의 자료를 도용한 경우 자료의 설명과 실제 자료의 내용이 일치하지 않는 경우

    함께 구매한 자료도 확인해 보세요!

    문서 초안을 생성해주는 EasyAI
    안녕하세요 해피캠퍼스의 20년의 운영 노하우를 이용하여 당신만의 초안을 만들어주는 EasyAI 입니다.
    저는 아래와 같이 작업을 도와드립니다.
    - 주제만 입력하면 AI가 방대한 정보를 재가공하여, 최적의 목차와 내용을 자동으로 만들어 드립니다.
    - 장문의 콘텐츠를 쉽고 빠르게 작성해 드립니다.
    - 스토어에서 무료 이용권를 계정별로 1회 발급 받을 수 있습니다. 지금 바로 체험해 보세요!
    이런 주제들을 입력해 보세요.
    - 유아에게 적합한 문학작품의 기준과 특성
    - 한국인의 가치관 중에서 정신적 가치관을 이루는 것들을 문화적 문법으로 정리하고, 현대한국사회에서 일어나는 사건과 사고를 비교하여 자신의 의견으로 기술하세요
    - 작별인사 독후감
    해캠 AI 챗봇과 대화하기
    챗봇으로 간편하게 상담해보세요.
    2025년 12월 28일 일요일
    AI 챗봇
    안녕하세요. 해피캠퍼스 AI 챗봇입니다. 무엇이 궁금하신가요?
    4:55 오전