Computer-Science

OS lecture 1: what do we study?

Reference book: “Understanding Linux Kernel” by Bovet & Cesati

1. Studying OS

2. Linux commands

Following is a simple classification for some of the Linux commands. Read them and do the following lab problems. To access the lab server, you need to download putty.exe from the internet. For korean language support, get 한글 putty and set window>translation to UTF-8. Among the commands, use “man” to find out the meaning/usage of commands or system calls. For example,

      man  man    -- shows the usage of “man” command
      man  ls      -- shows the usage of “ls” command
      man  read   -- shows the usage of “read” system call
      man  kill     -- shows the usage of "kill" command
      man  2  kill   -- shows the usage of "kill" system call
      man  3  printf  -- shows the usage of "printf" c-library function
general: man
process:
         ps : listing processes
         gcc : c compiler
         kill  : stop a process
         ^c   : stop a process
file     :
         vi    : editor
         ls    : listing files and directories in the current directory
         cat   : show the contents of a file
         more : show the contents of a file screen by screen
         xxd    : show the contents of a file in binary
         cp, rm, mv : copy, remove, change the name
         echo  : echo
         grep  : search given string in a given file
         cd    : change directory
         rmdir, mkdir : remove a directory, create a directory

3. vi :editor

vi x.c : edit file x.c

4. gcc : compiler

gcc -o myx x.c

will compile x.c and produce the executable file “myx”. You can run “myx” by typing “myx” and hit the enter key. x.c will look like as follows.

#include <stdio.h>
int main(){
    printf("hello\n");
    return 0;
}