1 / 36

RCC Lunch and Learn “ Let ’ s Start at the Very Beginning…. ” *

RCC Lunch and Learn “ Let ’ s Start at the Very Beginning…. ” *. Februrary 13, 2014 Connie Woodward, clwoodward@fsu.edu Dirac Science Library 150. Trivia question & prize to follow at the end about this quote…. Let ’ s Get the Terminology. Operating System

nyx
Télécharger la présentation

RCC Lunch and Learn “ Let ’ s Start at the Very Beginning…. ” *

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. RCC Lunch and Learn“Let’s Start at the Very Beginning….”* Februrary 13, 2014 Connie Woodward, clwoodward@fsu.edu Dirac Science Library 150 Trivia question & prize to follow at the end about this quote….

  2. Let’s Get the Terminology • Operating System • Operating systems perform basic tasks, such as recognizing input from the keyboard, sending output to the display screen, keeping track of files and directories on the disk, managing the cpu, networking, memory and peripherals • More user related tasks, such as user IDs, user and group permissions, quotas

  3. Terminology – Operating System Continued • The RCC systems all run an operating system called “Linux” • Within “Linux” there are different “flavors” (or “distros) – we run what is called “RedHat Enterprise Edition Linux or RHEL • This is important if you compiling your own programs or something you downloaded from the web, there are slight nuances between the “distros” and you may not be able to follow the documentation exactly if the program was meant to run on a different distro

  4. Terminology – Shell • As a user (process or real), you interact with the operating system via a special type of program called a “shell” • Sometimes using the shell is also referred to as using the command line interface (CLI) for linux • There are several different shell programs you can choose from (sh, ksh, bash, csh)

  5. Terminology – Shell Continued • You select which shell you would like to be your default from the RCC account management web page • Some shells are better for programming in, others are better for interactive use. • If you are not already in love with a particular shell program, I’d recommend using “bash” which is a good, versatile one

  6. How You Access • On Macs and Linux boxes, you should find an application called “terminal”, that allows you to do an “ssh” (secure shell) to login to a RCC machine • Windows boxes do not come with an appropriate program, so you must install one that does “ssh”. Commonly one called “Putty” is used, but there are many available.

  7. The Shell • When you first login to one of the job submission nodes, or a spear node, you are “in the shell” or also referred to as the “command line interface (CLI)”

  8. The Shell When you first login, you see the “Message of the Day (MOTD)”, which may give important info about scheduled downtimes, outages, etc.

  9. The Shell • After the MOTD, you have a shell prompt displayed. This can be customized in many ways. • Here I have mine showing my userID I am currently logged as, the hostname of the machine I am on, the directory I am in, and the date: See attachment A for how I customized my prompt.

  10. The Shell By default, your account’s prompt will look like this: [joe-user@machine ~]$ • Your user ID @ the machine you are on, then the “~” means your home directory. • Your “home directory” is where you are “deposited” when you first login, your “working directory” is whatever directory you are sitting in. • Note, directories are to Linux as folders are on Mac or PCs

  11. Your Identity You have a user ID, as well as a default group you belong to, but you may belong to multiple groups My defaults: After I change to the “idadmins” group: Now any file I create will have the group ownership as “idadmins” and anyone in the “idadmins” group can read/write/execute as I have the group permissions set on the file

  12. File Permissions Files have owner, group and world permission attributes. The basic permission options are: read/write/execute An “ls –l filename” will show you the permissions set on a file: In this example, the file can be read & write & executed by the owner (clwoodward), read & executed by anyone in the clwoodward group, and read & executed by the world. For details on setting file and directory permissions, do a “man” on “chmod”

  13. Directories To move to a different directory, you use the command “cd” (change directory): To check what directory you are currently in, you can use the “pwd” (print working directory) command:

  14. Directories To move to a different directory, you use the command “cd directory_you_want_to_go_to” (change directory): To check what directory you are currently in, you can use the “pwd” (print working directory) command:

  15. Directories To move back to your home directory, you can issue just a plan “cd” or you can do “cd ~” (The tilde is an special key for your home directory)

  16. Getting Help There are several ways to invoke the command help system – or what is referred to as the “man” (short for manual) pages • If you know the command you want info on, and just want to read the details or options available on it, you can do, for example: man df • You can use the spacebar key to go through the pages of information

  17. Shell – Getting Help If you didn’t know the exact command you were looking for, you can do “man –k usage” (or some other appropriate keyword for what you are looking for info on) You could also do “whatis df” and it would show you a synopsis: Then you could do “man 1p df”

  18. Directories On Linux, the directory structure is specified with forward slashes, like this: /home/clwoodward • A single “/” is the root of the directory tree • “/home” is one level down • “/home/clwoodward” is where clwoodward is a subdirectory under “/home” • To go back up a directory level, you can do: “cd ..” • Or “cd ../../” to go back up two levels • If you get lost, you can always do a “pwd” to see where you are

  19. Directories • To create a new directory, you use the “mkdir newdirname” command • To remove an empty directory, you can use the “rmdir dirname” command • To remove a directory and all the files in it, you can use the “rm –rf dirname” command (use with caution) • NOTE – on Linux, when using the shell, if you remove a file or directory, it is gone forever – there is not a “trashcan”/”recycle-bin”

  20. Working with Files • To copy a file, you do “cp oldfile newfile” • To rename a file, you can do “mv oldfilename newfilename” • To delete a file, you can do “rm filename” • NOTE – on Linux, when using the shell, if you remove a file or directory, it is gone forever – there is not a “trashcan”/”recycle-bin”

  21. More Working with Files There are several ways you can get more information about a file. “ls –lasg filename” will show you the owner, file system, permissions and last date modified “file filename” will show you want kind of file it is (text, compiled executable, binary file, image file, etc.) “cat filename” (if the file is a text file) will display the contents of the file. If the file is big, you may want to do “cat filename | more” which will show your file’s contents a page at a time. You use the spacebar key to move to the next page. (the “|” is a special feature called a pipe, the output from one command is feed to the next command before being displayed)

  22. Fast Typing The bash shell allows several cool ways of cheating on your typing • One is “tab completion”, if you start to type a directory name or file name, you can type a few characters, and then hit “tab”, it will then cycle through all the possibilities in the directory that match what you are typing: • Here I typed “cd x<tab>” and it filled in the rest of the matching directory name “xdd”

  23. Fast Typing - More Another way to save typing is using the up arrow to recall a command, and then arrowiing over and correcting or changing the command as you need Another trick is to set up frequently used commands as “aliases”. You set these in your ~/.bash_profile or ~/.bashrc file • ~/.bash_profile • The personal initialization file, executed for login shells • ~/.bashrc • The individual per-interactive-shell startup files

  24. Fast Typing - More Here are some aliases I have in my .bash_profile: alias ls=“ls -F --color=auto” alias ll=“ls –lh” alias la=“ls –a” alias df=“df –h” alias bye=“exit” alias grep=“grep --color -d skip” alias gerp=“grep --color -d skip” alias grpe=“grep --color -d skip” Notice that I have several misspellings that I commonly type for “grep” and I am telling the system to correct them for me

  25. More tricks If you use the default setup for an account, you may notice that when you do an “ls” in a directory, it is hard to tell what is a file, what is an executable file, what is a link, what is a directory, etc. If you have the right terminal type, then these are color coded:

  26. More tricks You can tweak this a bit by changing your “ls” alias to be: “ls –F –color=auto”, then it will but a “*” by executables, a “/” at the end of directory names, and a “@” by names that are links, as well as color code them:

  27. More tricks The shell uses the “*” character as a wildcard, so if for example, you wanted to see all the files that start with “slurm”: Note: be very careful with wildcarding (or sometimes called “globbing”), especially if you are doing a “rm”

  28. More tricks The shell uses the “*” character as a wildcard, so if for example, you wanted to see all the files that start with “slurm”: Note: be very careful with wildcarding (or sometimes called “globbing”), especially if you are doing a “rm”

  29. Commonly Used Commands For more info, do a “man” on these commands “cd” – changes to another directory “exit” – logs you out of a shell “kill” – terminates a process “ls” – lists the contents of a directory “date” – prints the date and time “ps/top” – shows the status of processes “chmod/chown” – change the permissions or owner of a file “newgrp” – change your current group to be a different one “chgrp” – change the group owner of a file or directory “mv” – move a file to a new name or location “vi” – a commonly used, very powerful text editor “diff” – compare two files “grep” – a tool for searching for patterns within files “find/locate” – tools for finding files

  30. Questions and Comments • Support: support@hpc.fsu.edu • More info: http://rcc.fsu.edu Google is your friend, there are many, many resources available online. Just search for “bash”, “shell programming”, “linux shell”, etc.

  31. Trivia! “Let’s start at the very beginning” Is a quote from what 1965 movie?

  32. Trivia! “Let’s start at the very beginning” Is a quote from what 1965 musical movie? Hints: • ABC shows it every year on TV during the Christmas holidays

  33. Trivia! “Let’s start at the very beginning” Is a quote from what 1965 musical movie? Hints: • ABC shows it every year on TV during the Christmas holidays • Almost every high school theatre troup and community theatre performs it

  34. Trivia! “Let’s start at the very beginning” Is a quote from what 1965 musical movie? Hints: • ABC shows it every year on TV during the Christmas holidays • Almost every high school theatre troup and community theatre performs it • Starred Julie Andrews

  35. Trivia! “Let’s start at the very beginning” Is a quote from what 1965 musical movie? Hints: • ABC shows it every year on TV during the Christmas holidays • Almost every high school theatre troup and community theatre performs it • Starred Julie Andrews • Recently remade with Carrie Underwood as the lead

  36. Trivia! “Let’s start at the very beginning” The Sound of Music Let's start at the very beginning A very good place to sing When you read you begin with A B C When you sing you begin with Do Re Mi

More Related