User:Mukund-pondkule-6a11@uni-paderborn.de

From HPC Wiki
Jump to navigation Jump to search

An Introduction to the Linux Operating System and Command Line. The course provides students with a hands-on approach for learning Linux through assignments and projects.

Historical Background

Video: Slide 17 - 23 (7 pages), 5 min 45 sec (Text) + 15 sec (Quiz)

Text and slides path


Caption
Header 1 Header 2 Header 3 Header 4 Data 1 Data 2 Data 3 Data 4

Quiz:

1. Are all Top 500 supercomputers using Linux in HPC?
  A: Yes
  B: No
2. What does GNU stands for?
  A. GNU's Not Unix
  B. Geek Needed Unix
  C. General Unix
  D. General Unix
  E. None of the Above
  Answer: a)

Exercises in Terminal: no exercises in this section

The Command Line

Video: Slide 17 - 23 (7 pages), 5 min 45 sec (Text) + 15 sec (Quiz)

Text and slides path


Quiz:

1. Which keys can be used for command history?
  A: up- and down-arrow keys
  B: Page-up and Page-down keys
Info:  Working directory in console reminds user, where they are. (page 3)
Warning:  In command line user may forget where they are (page 2). Child processes may stop, if parent shell exits (page 2).

Exercises in Terminal:

1. What's your username on a Linux computer?
  There are two ways to find your username on a Linux computer 
2. What's the hostname of a Linux computer?
  There are two ways to find the hostname on a Linux computer.
3. What's your current working directory on a Linux computer?
   There are two ways to find your current working directory on a Linux computer.
4.  Use up- and down-arrow keys to see the command history.
5.  Run sleep 1h command and wait, then use Ctrl-C to kill it.

Directory structure

Video: Slide 33 - 48 (16 pages), 5 min 45 sec (Text + Demo + Quiz) + 15 sec (Tips and Warning)

Text and slides path


Quiz:

1. Which one is the top directory in Linux?
  A: /
  B: /home
  C: C:\
2. The command 'cd ' without arguments : if you start in var/log/ and run cd with no arguments, what do you expect will happen?
  A: Nothing it stays in /var/log/.
  B: It goes to your home directory.
  C: It goes to the filesystem root
  D: The shell prompt turns into a shark and eats you.
  E: It’s an error.
  F: The shell stops having a working directory.
Warning:  no undo and make sure what you want to do (page 16)

Exercises in Terminal (slide 49):

1. Go to a specific subfolder of a folder (example: cd Documents/courses/ ) and get back to the home directory using cd command. List 3 different ways to do it using one command. check after every action your path with pwd command.
2. Go to the directory /tmp and jump between /tmp and your home directory back and forth. check after every action your path with pwd command.

Files

Video: Slide 51 - 56 (6 pages), 5 min 30 sec (Text + Demo + Quiz) + 15 sec (Tips and Warning)

Text and slides path


Quiz:

1. Can you copy directory with cp <old_dir> <new_dir> ? 
  A: Yes
  B: No, -r option is needed for copying directory
Warning:  rm -f: no confirmation! Use with care (page 3). Wildcards expand before given to program (page 6).

Exercises in Terminal:

1. Use the find command to search for files, whose name ends with dat, in your home directory.
2. Use the find command to search for directories, whose name begins with test and ends with _dir, in your home directory.

Text display, search

Video: Slide 58 - 64 (7 pages), 5 min 40 sec (Text + Demo) + 15 sec (Quiz)

Text and slides path

Quiz:

1. Which command can be used to append text to filename?
  A: command > filename
  B: command >> filename
2. How do I find all files containing specific text on Linux?
   HINT: use grep command

Exercises in Terminal (slide 65):

1. Create a file using cat (some filename) and write some text in it as below. than use grep to find and display the line number and the line with the word Alan in the file.
        the best way to predict
        the future is to invent it
        –  Alan Kay

Processes and permissions

Video: Slide 67 - 88 (22 pages), 7 min 40 sec (Text + Demo)

Text and slides path

Quiz:

1. Which command can prevent other users not in your group from writing to input.dat? 
  A: chmod u-w input.dat
  B: chmod o-w input.dat
  C: chmod g-w input.dat

Exercises in Terminal (slide 89):

1. Create an empty file, make it read-only, make it executable.
2. Start a process (e.g. sleep 10m)
3. Start a process, bring it into background/foreground.