Difference between revisions of "Introduction to Linux in HPC/Linux Directory Structure"

From HPC Wiki
Introduction to Linux in HPC/Linux Directory Structure
Jump to navigation Jump to search
m
m (Tweak category sorting)
 
(4 intermediate revisions by 2 users not shown)
Line 1: Line 1:
[[Category:Tutorials]]<nowiki />
+
[[Category:Tutorials|Linux Directory Structure]]<nowiki />
{{DISPLAYTITLE:<span style="position:absolute; top:-9999px;">Introduction to Linux in HPC/</span>Directory structure}}<nowiki />
+
{{DISPLAYTITLE:Linux Directory Structure}}<nowiki />
 
{{Syllabus Introduction to Linux}}<nowiki />
 
{{Syllabus Introduction to Linux}}<nowiki />
 
__TOC__
 
__TOC__
Line 25: Line 25:
 
||  
 
||  
 
-  <code>C:\</code>
 
-  <code>C:\</code>
||  
+
|| That's Windows
 
</quiz>
 
</quiz>
 
{{hidden end}}
 
{{hidden end}}
Line 62: Line 62:
 
+ Everything is a file
 
+ Everything is a file
 
|| Explanation: In Linux, directories are files with a directory flag. There are even more "special" files, like <code>/dev/null/</code>, <code>/proc/cpuinfo/</code> or links.
 
|| Explanation: In Linux, directories are files with a directory flag. There are even more "special" files, like <code>/dev/null/</code>, <code>/proc/cpuinfo/</code> or links.
- Directories are files and and files are directories
+
- Directories are files and files are directories
 +
|| Explanation:  Directories are files, but files are not directories
 +
- All of the above
 
||
 
||
 
</quiz>
 
</quiz>
Line 70: Line 72:
 
{{Warning|mode=warn|text= '''no undo and make sure what you want to do (page 48)'''}}
 
{{Warning|mode=warn|text= '''no undo and make sure what you want to do (page 48)'''}}
  
=== Exercises in Terminal (slide 49)=== <!--T:5-->  
+
=== Exercises in Terminal=== <!--T:5-->  
  
  1. Go to a specific subfolder of a folder (example: <code>cd Documents/courses/</code>) and get back to the home directory using <code>cd</code> command. List 3 different ways to do it using one command. Check after every action your path with <code>pwd</code> command.
+
  4. Go to a specific subfolder of a folder (example: <code>cd Documents/courses/</code>) and get back to the home directory using <code>cd</code> command. List 3 different ways to do it using one command. Check after every action your path with <code>pwd</code> command.
 
   {| role="presentation" class="wikitable mw-collapsible mw-collapsed"
 
   {| role="presentation" class="wikitable mw-collapsible mw-collapsed"
 
     | <strong>Answer:</strong>
 
     | <strong>Answer:</strong>
Line 83: Line 85:
 
     |}
 
     |}
 
        
 
        
  2. Go to the directory <code>/tmp</code> and jump between <code>/tmp</code> and your home directory back and forth. Check after every action your path with <code>pwd</code> command.
+
  5. Go to the directory <code>/tmp</code> and jump between <code>/tmp</code> and your home directory back and forth. Check after every action your path with <code>pwd</code> command.
 
   {| role="presentation" class="wikitable mw-collapsible mw-collapsed"
 
   {| role="presentation" class="wikitable mw-collapsible mw-collapsed"
 
     | <strong>Answer:</strong>
 
     | <strong>Answer:</strong>
Line 95: Line 97:
  
 
{{hidden begin  
 
{{hidden begin  
|title = 4. How do you copy and paste in the Linux terminal?
+
|title = Bonus question: How do you copy and paste in the Linux terminal?
 
}}
 
}}
 
<quiz display=simple>
 
<quiz display=simple>
Line 101: Line 103:
 
|type="()"}
 
|type="()"}
 
- Ctrl-C & Ctrl-V
 
- Ctrl-C & Ctrl-V
||  
+
|| That's Windows
 
- <code>yy</code> & <code>pp</code>
 
- <code>yy</code> & <code>pp</code>
||
+
|| That's vim
 
+ Middle Mouse
 
+ Middle Mouse
 
|| Alternative Solution: Ctrl-Shift-C & Ctrl-Shift-V
 
|| Alternative Solution: Ctrl-Shift-C & Ctrl-Shift-V

Latest revision as of 17:20, 4 December 2020

Tutorial
Title: Introduction to Linux in HPC
Provider: HPC.NRW

Contact: tutorials@hpc.nrw
Type: Multi-part video
Topic Area: HPC Platforms
License: CC-BY-SA
Syllabus

1. Background and History
2. The Command Line
3. Linux Directory Structure
4. Files
5. Text display and search
6. Users and permissions
7. Processes
8. The vim text editor
9. Shell scripting
10. Environment variables
11. System configuration
12. SSH Connections
13. SSH: Graphics and File Transfer
14. Various tips

This part of the tutorial introduces the directory structure on a Linux system and shows how to navigate in it. It explains how a path looks like in Linux, which standard directory structure is shared by most systems and how to navigate from one directory to another.

Video

(Slides as pdf)

Quiz

1. Which one is the top directory in Linux?

/
/home
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?

Nothing it stays in /var/log/
It goes to your home directory
It goes to the filesystem root
The shell stops having a working directory
It’s an error
The shell prompt turns into a shark and eats you


3. Which of these oversimplifications describes the directory structure in a Linux system best?

Everything is a directory
Everything is a file
Directories are files and files are directories
All of the above


Warning:  no undo and make sure what you want to do (page 48)

Exercises in Terminal

4. 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.
5. 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.


Bonus question: How do you copy and paste in the Linux terminal?

Ctrl-C & Ctrl-V
yy & pp
Middle Mouse
You can't, that's a Windows feature.



<< The Command Line

Overview

Files >>