Download presentation
Presentation is loading. Please wait.
Published byMichael Kristian Lawson Modified over 9 years ago
1
Julien Thibault Julien.thibault@utah.edu
2
1969 - Bells Labs develop a new operating system called “UNIX” Written in C instead of assembly code Able to recycle code Improved compatibility between systems Beginning of the 90’s PC becomes popular UNIX too slow for these machines and not free People switch to Windows 3.1 or MS-DOS 1991 – Linus Torvalds (University of Helsinki) starts working on the “Linux” project Free OS Compliant with the original UNIX Today – why do you care? De-facto OS for high-performance computing (clusters) More and more popular in federal agencies and large companies Linus Torvalds
3
Pros Free and open source Large community Secure, almost no virus (compared to Windows) Scalable: from palm to cluster with more 100 nodes Cons Not as user-friendly as Windows or Mac but getting there Many distributions available: Ubuntu, RedHat, Fedora, SUSE, Mandriva, Debian… See: http://futurist.se/gldt/wp-content/uploads/11.04/gldt1104.pnghttp://futurist.se/gldt/wp-content/uploads/11.04/gldt1104.png
4
What a Linux distribution can look like today…
5
Host: sanddunearch.chpc.utah.edu Login: uNID Password:uNID password Using PuTTY (Windows): Just enter the host name Using ssh (Mac or Linux): ssh [-Y] login@host The -Y option is used to enable GUIs (it can be slow!!)
6
cdchange current directory ls [-la]list files pwdshow path to current directory mkdircreate new directory mvmove file/dir to new location cp [-r]copy file (use -r for directory) scp [-r]secured copy over the network ssh secured remote login man cmdcmd command manual
7
Create the directory ~/workshops/linux/test in your home directory Copy the test directory to ~/workshops/linux/test2 Move test2 to your home directory and rename it testlinux
8
Try out Emacs if you cant stand VI… http://www.cs.colostate.edu/helpdocs/emacs.html
9
Insertion mode: i Command mode: ESC dddelete current line (and copy) yycopy current line ppaste before cursor uundo /string or ?stringsearch string after or before cursor n or Ngo to next or previous match :s/pattern/string/g replace pattern by new string :w Save changes :qExit :q! Exit and ignore any changes More commands at: http://www.lagmonster.org/docs/vi.htmlhttp://www.lagmonster.org/docs/vi.html
10
Create a new text document, insert “Hello world” and save it as helloworld.txt Download Moby Dick from http://www.gutenberg.org/ebooks/2701.txt.utf8 and rename it mobydick.txt http://www.gutenberg.org/ebooks/2701.txt.utf8 Delete everything that is before chapter 1 What is the title of chapter 107? What is the last line? Move the first paragraph (chapter 1) to be after the second one How many times does the word ‘France’ appear in the text?
12
Permissions Root (super user) ▪ Can control machine configuration and programs for all the user ls -l will display the permissions for a file/dir Interactive shell configuration aliases (e.g. “ll” instead of “ls -l”) environment variables ▪ $PATH: path to the executables ▪ $HOME: point to your home directory bash / C shell ▪ 2 different scripting methods ▪.bashrc,.bash_profile,.profile /.tcshrc
13
Inside the configuration script: setenv / exportSet environment variable aliasCreate alias C shell script example (CHPC) alias ll “ls -l” setenv EXEC “$HOME/programs” setenv PATH $EXEC/bin/:$PATH Bash script example alias ll=“ls -l” export EXEC=$HOME/programs export PATH=$PATH:$EXEC/bin/ sourceapply changes to bash script for interactive shell echo vardisplay value of environment variable
14
whichreturns the path to the command executable ps [aux]list of active processes toplist of top active processes (updated ) findfind a file or directory grepfind a phrase in text catdisplay content of a file tail [–n]display the last lines of a file suswitch to superuser. Need root privileges chmodchange permissions on a file/dir chownchange owner of a file/dir wgetdownload file from URL
15
Find the location of the Matlab install at CHPC Create an environment variable called $MATLAB_HOME that points to the install of Matlab version R2006 and add it to your PATH so it becomes the default version Create an alias to display the version of java Create a script called hello.sh that says “hello world” when you run it.
16
Ctrl-CCancel job Ctrl-ZStop job cmd &execute cmd in the background bgmove job to background fgmove job to foreground jobslist current jobs
17
$ sleep 100 — Start a dummy job in foreground. (sleep = waits a x amount of second) Press Ctrl+z to stop the current job. $ bg — Move the last stopped job to background. $ sleep 150 — Dummy job 1 Press Ctrl+z to stop the current job. $ sleep 140 — Dummy job 2 Press Ctrl+z to stop the current job. $ sleep 130 — Dummy job 3 Press Ctrl+z to stop the current job. $ jobs — List all active jobs. $ bg 2 — Move the 2nd active job to background.
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.