Introduction_to_Linux_P1_SUM23
Introduction_to_Linux_P1_SUM23
(Part 1/2)
Misha Ahmadian
High Performance Computing Center
Summer 2023
About this Training Workshop?
Course Schedule:
The Introduction to Linux Training is offered twice per semester.
Each session will be held for 4 hours per day (10 am – 12 pm) and
(1 pm – 3 pm) with a 1-hour lunch break.
Requirements:
Attendees are preferred to have a ready-to-use HPCC account:
• HPCC Login nodes
• Linux/Mac Laptops
• Windows machines with WSL or Linux on a Virtual Machine
• Online Linux Virtual Consoles (It may not offer full functionality) – e.g. JSLinux
About this Training Workshop?
Follow the instructor and try the new Linux commands on your
Linux/Mac console.
About Linux
– ssh eraider@quanah.hpcc.ttu.edu
Windows Users:
• MobaXterm (Recommended):
– https://mobaxterm.mobatek.net
• Putty:
– https://www.putty.org
GNU Project:
Richard Stallman started the GNU project in 1983
• After AT&T imposed commercial licensing on Unix Operating System
Linux:
Linus Torvalds created the Linux kernel in the early 1990s
• Linus released the first kernel under the GPL (General Public License)
Debian/RedHat/SUSE/…
• The major difference is the software package management on these distros.
Structure of Linux OS
Linux Shell
• Here is where you start • User software and
interacting with the OS applications
• Multiuser environments Supplemental • High-level programs
Software
Core Linux
Tools
• OS core commands
• System-level programs
• GNU tools • Process/Thread scheduling
• Compilers • Memory Management
Linux Kernel
• File and I/O management
• Device drivers
• System calls
Linux Shell
quanah:$ command
What is Terminal?
Terminal is a program that opens in a window and lets users interact with the shell.
Working with
Files and Directories
Understanding Linux Directory Structure
/
boot
/
/boot
etc
/etc
tmp
/tmp
home
/home
mahmadia
/home/mahmadia
mydir
/home/mahmadia/mydir
eRaider /home/eraider
var /var
lustre /lustre
work /lustre/work
scratch /lustre/scratch
...
Basic Directory Operations
Where am I?
pwd command to print working directory
quanah:$ pwd
/home/username
quanah:$ ls -a
quanah:$ ls -l
quanah:$ ls
file1.txt
quanah:$ cp file1.txt file2.txt
quanah:$ ls
file1.txt file2.txt
quanah:$ cp -r ../mydir ./
quanah:$ cp ../mydir2/* /home/bob/
quanah:$ cp ./*.txt ~/text_dir/
File and Directory Operations
quanah:$ ls
file1.txt
quanah:$ mv file1.txt file2.txt
quanah:$ ls
file2.txt
quanah:$ mv mydir/ ../temp/
quanah:$ mv ../docs/*.pdf ./
File and Directory Operations
So far, all the commands that we used sent their output to the
screen. We can control this in Linux:
• < redirects to the standard input
• > redirects the standard output
• >> appends the standard output
• 1> redirects the standard output (equals to >)
• 2> redirects the standard error
• &> redirects the standard output and standard error
• | (pipe) pass the output of one command to another
Exercise #2
If you set write permission for a directory, you can (create/delete) new entries
If you set read permission for a directory, you can list (ls) the contents
If you set execute permission for a directory, you can (cd) into the directory
Linux Essential Commands 2
1. Search in your history and try to list your last 10 “ls” commands
that you have used
2. Check the manual of the “man” command and see what type of
manuals are available on Linux
Coming in Part 2 of this Training …