Difference between revisions of "Introduction to Linux in HPC/Various tips"

From HPC Wiki
Introduction to Linux in HPC/Various tips
Jump to navigation Jump to search
m (Tweak page sorting)
 
(16 intermediate revisions by 3 users not shown)
Line 1: Line 1:
 +
[[Category:Tutorials|Various Tips for Working with Linux]]<nowiki />
 +
{{DISPLAYTITLE:Various Tips for Working with Linux}}<nowiki />
 +
{{Syllabus Introduction to Linux}}<nowiki />
 
__TOC__
 
__TOC__
  
{{Infobox table
+
This video covers a range of miscellaneous topics that are useful, but were not addressed before. For example, there are tools to print the space left on a disk or the recent command history. Other tools regularly execute commands for you or manipulate text.
| REAL-NAME    = HPC.NRW
+
Finally, an overview of common package managers is given.
| image  =  Hpc.nrw_small.png ‎
 
| Feldnamehead1 = Other HPC Courses
 
| Feldname2 = GPU      | Daten3 = Introduction to GPU Programming
 
| Feldname3 = GPROF    | Daten4 = [https://hpc-wiki.info/hpc/GPROF_Tutorial Gprof Tutorial]
 
| Feldnamehead2 = Introduction to Linux in HPC
 
| Feldname5 = 1. | Daten6 = [https://hpc-wiki.info/hpc/Introduction_to_Linux_in_HPC/Historical_Background Historical Background]
 
| Feldname6 = 2. | Daten7 = [https://hpc-wiki.info/hpc/Introduction_to_Linux_in_HPC/The_Command_Line The Command Line]
 
| Feldname7 = 3. | Daten8 = [https://hpc-wiki.info/hpc/Introduction_to_Linux_in_HPC/Directory_structure Directory structure]
 
| Feldname8 = 4. | Daten9 = [https://hpc-wiki.info/hpc/Introduction_to_Linux_in_HPC/Files Files]
 
| Feldname9 = 5. | Daten10 = [https://hpc-wiki.info/hpc/Introduction_to_Linux_in_HPC/Text_display_search Text display search]
 
| Feldname10 = 6. | Daten11 = [https://hpc-wiki.info/hpc/Introduction_to_Linux_in_HPC/Processes_and_permissions Processes and permissions]
 
| Feldname11 = 7. | Daten12 = [https://hpc-wiki.info/hpc/Introduction_to_Linux_in_HPC/The_vim_text_editor The vim text editor]
 
| Feldname12 = 8. | Daten13 = [https://hpc-wiki.info/hpc/Introduction_to_Linux_in_HPC/Shell_scripting_environment_variables Shell scripting environment variables]
 
| Feldname13 = 9. | Daten14 = [https://hpc-wiki.info/hpc/Introduction_to_Linux_in_HPC/System_configuration_files System configuration files]
 
| Feldname14 = 10. | Daten15 = [https://hpc-wiki.info/hpc/Introduction_to_Linux_in_HPC/Various_tips Various tips]
 
| Feldname15= 11. | Daten16 = [https://hpc-wiki.info/hpc/Introduction_to_Linux_in_HPC/Beyond_the_cluster Beyond the cluster]
 
| Feldname16= 12. | Daten17 = [https://hpc-wiki.info/hpc/Introduction_to_Linux_in_HPC/Linux_in_HPC Linux in HPC]
 
| Feldname17= 13. | Daten18 = [https://hpc-wiki.info/hpc/Introduction_to_Linux_in_HPC/SSH_Login SSH Login]
 
}}
 
  
 
=== Video === <!--T:5-->
 
=== Video === <!--T:5-->
  
<youtube width="600" height="400" right>IfD9IPixgpo</youtube>
+
<youtube width="600" height="340" right>8w16X2d2T54</youtube>
  
 +
([[Media:HPC.NRW_Introduction_to_Linux_in_HPC_14_Various_Tips.pdf | Slides as pdf]])
  
 
=== Quiz === <!--T:5-->   
 
=== Quiz === <!--T:5-->   
 +
 +
{{hidden begin
 +
|title = Does <code>df</code> show the size of a given file?
 +
}}
 +
<quiz display=simple>
 +
{
 +
|type="()"}
 +
+  No
 +
|| Explanation: <code>df</code> (disk free) shows how much space is free on a disk. <code>du</code> (disk used) shows how much space is taken up by a given file or directory.
 +
-  Yes
 +
|| Explanation: <code>df</code> (disk free) shows how much space is free on a disk. <code>du</code> (disk used) shows how much space is taken up by a given file or directory.
 +
</quiz>
 +
{{hidden end}}
 +
 +
 +
{{hidden begin
 +
|title = What does <code>ln -s /tmp .</code> do?
 +
}}
 +
<quiz display=simple>
 +
{
 +
|type="()"}
 +
- Create a symbolic link of the current directory in <code>/tmp</code>
 +
||
 +
+ Create a symbolic link of <code>/tmp</code> in the current directory named <code>./tmp</code>
 +
||
 +
- Print a list of files located in <code>/tmp</code> and <code>.</code>
 +
symbolic links
 +
||
 +
</quiz>
 +
{{hidden end}}
 +
 +
 +
{{hidden begin
 +
|title = What is the <code>watch</code> command used for?
 +
}}
 +
<quiz display=simple>
 +
{
 +
|type="()"}
 +
- To open a file of unknown format
 +
||
 +
+ To regularly execute a command and see its output
 +
||
 +
- To watch video files
 +
||
 +
</quiz>
 +
{{hidden end}}
 +
 +
 +
{{hidden begin
 +
|title = What are <code>sed</code> or <code>awk</code> used for?
 +
}}
 +
<quiz display=simple>
 +
{
 +
|type="()"}
 +
+ Manipulate and process text
 +
||
 +
- Set system configuration settings
 +
||
 +
</quiz>
 +
{{hidden end}}
  
  
Line 41: Line 86:
 
</quiz>
 
</quiz>
 
{{hidden end}}
 
{{hidden end}}
 +
  
 
{{hidden begin  
 
{{hidden begin  
Line 54: Line 100:
  
  
{{Warning|mode=info|text= '''Please make backups regularly!'''}}
+
{{Warning|mode=warn|text= '''Please make backups regularly! Hard drives can fail on any computer'''}}
  
{{Warning|mode=warn|text= '''Please make backups regularly!'''}}
+
=== Exercises in Terminal === <!--T:5-->   
 
 
=== Exercises in Terminal (slide 137) === <!--T:5-->   
 
  
 
  1. Find out the number of CPUs and amount of memory you have.
 
  1. Find out the number of CPUs and amount of memory you have.
Line 110: Line 154:
 
     |}
 
     |}
  
 
+
{{Tutorial Navigation
<div style='text-align: left;float:left;width:33%;'>{{Clickable button|[https://hpc-wiki.info/hpc/Introduction_to_Linux_in_HPC/System_configuration_files Previous Page]|color=white}}</div>
+
| previous = [[Introduction_to_Linux_in_HPC/SSH_Graphics_File_Transfer | SSH: Graphics and File Transfer ]]
<div style='text-align: center;float:left;width:33%;'>{{Clickable button|[https://hpc-wiki.info/hpc/Introduction_to_Linux_in_HPC Main Menu Page]|color=white}}</div>
+
| main = [[Introduction_to_Linux_in_HPC | Overview ]]
<div style='text-align: right;float:left;width:33%;'>{{Clickable button|[https://hpc-wiki.info/hpc/Introduction_to_Linux_in_HPC/Beyond_the_cluster Next Page]|color=white}}</div>
+
}}

Latest revision as of 16:27, 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 video covers a range of miscellaneous topics that are useful, but were not addressed before. For example, there are tools to print the space left on a disk or the recent command history. Other tools regularly execute commands for you or manipulate text. Finally, an overview of common package managers is given.

Video

( Slides as pdf)

Quiz

Does df show the size of a given file?

No
Yes


What does ln -s /tmp . do?

Create a symbolic link of the current directory in /tmp
Create a symbolic link of /tmp in the current directory named ./tmp
Print a list of files located in /tmp and .


What is the watch command used for?

To open a file of unknown format
To regularly execute a command and see its output
To watch video files


What are sed or awk used for?

Manipulate and process text
Set system configuration settings


How will you find a specific command in history ? HINT: use grep with history, how to use it?

Click and submit to see the answer


How can you compare two files and display a list of the difference? HINT: man diff

Click and submit to see the answer


Warning:  Please make backups regularly! Hard drives can fail on any computer

Exercises in Terminal

1. Find out the number of CPUs and amount of memory you have.
2. Permanently change your vim color scheme. 


<< SSH: Graphics and File Transfer

Overview