More Unix Naomi Altman. Directories Directory = folder mkdir - makes a new directory rmdir - removes an empty directory cd mydirectory - moves you into.

Slides:



Advertisements
Similar presentations
 Statistics package  Graphics package  Programming language  Can be used to share/reproduce analyses  Many new packages being created - can be downloaded.
Advertisements

NETW-240 Shells Last Update Copyright Kenneth M. Chipps Ph.D. 1.
Cosc 4750 Getting Started in UNIX Don’t be afraid of the prompt, in linux it can be your best friend. In some cases, the only way to do certain things.
CS Lecture 03 Outline Sed and awk from previous lecture Writing simple bash script Assignment 1 discussion 1CS 311 Operating SystemsLecture 03.
Introducing the Command Line CMSC 121 Introduction to UNIX Much of the material in these slides was taken from Dan Hood’s CMSC 121 Lecture Notes.
Guide To UNIX Using Linux Third Edition
Basic Unix Dr Tim Cutts Team Leader Systems Support Group Infrastructure Management Team.
UNIX By Darcy Tatlock. 1. Successful Log Into Unix To actively manipulate your website you need to be logged in. Without being logged in you cannot enter.
Using Linux Commands 2 Lab#5
A Mini UNIX Tutorial. What’s UNIX?  An operating system run on many servers/workstations  Invented by AT&T Bell Labs in late 60’s  Currently there.
Linux Shell. 2 Linux Command-Line Interface ■ Linux shells: A shell is a command interpreter that allows you to type commands from the keyboard to interact.
Using Linux Commands 2 Lab#5. Sort command Sort the lines of text files. $ sort fileName by default it will sort in normal order(alphabetical 0-9 A-Z.
Using Macs and Unix Nancy Griffeth January 6, 2014 Funding for this workshop was provided by the program “Computational Modeling and Analysis of Complex.
Introduction to Linux Operating System Tutorial 1
1 Day 3 Directories Files Moving & Copying. 2 Case Sensitive First thing to learn about UNIX is that everything is case sensitive. Thus the files: –enda.
Unix Primer. Unix Shell The shell is a command programming language that provides an interface to the UNIX operating system. The shell is a “regular”
Lesson 7-Creating and Changing Directories. Overview Using directories to create order. Managing files in directories. Using pathnames to manage files.
Linux Directory Navigation. File & Directory Commands This is a minimal list of Unix commands that you must know for file management: ls (list) mkdir.
Introduction to Shell Script Programming
CPS120: Introduction to Computer Science Operating Systems Nell Dale John Lewis.
Essential Unix at ACEnet Joey Bernard, Computational Research Consultant.
Unix Basics Chapter 4.
Basic unix commands that everyone should know (Even if you have a mac) Slightly more advanced:
Computer Programming for Biologists Oct 30 th – Dec 11 th, 2014 Karsten Hokamp  Fill out.
Introduction Use of makefiles to manage the build process Declarative, imperative and relational rules Environment variables, phony targets, automatic.
The UNIX development environment CS 400/600 – Data Structures.
Unix Tutorial for FreeSurfer Users. Helpful To Know FreeSurfer Tutorial Wiki:
Unix Tutorial for FreeSurfer Users. Helpful To Know FreeSurfer Tutorial Wiki:
INTRODUCTION TO LINUX Jacob Chan. GNU/Linux Consists of Linux kernel, GNU utilities, and open source and commercial applications Works like Unix –Multi-user.
UNIX Commands. Why UNIX Commands Are Noninteractive Command may take input from the output of another command (filters). May be scheduled to run at specific.
1 Operating Systems and Using Linux Topics What is an Operating System? Linux Overview Frequently Used Linux Commands Some content in this lecture added.
Operating Systems and Using Linux CMSC 104, Lecture 3 John Y. Park 1.
1 Operating Systems and Using Linux Topics What is an Operating System? Linux Overview Frequently Used Linux Commands Reading None.
L&T Infotech1 UNIX – Getting Started - Aneesh Ramani.
Introduction to UNIX Geraint Vaughan. What is UNIX? Command-line operating system (not point- and click) Designed for ‘experts’ Lots of different variants.
Log-in to the Unix Server A successful log-in allows access to the server through the Secure Shell. SSH, also known as Secure Shocket Shell, is a Unix.
Unix Commands PowerPoint Presentation developed for LS 560 Information Technology online class - University of Alabama by Debey Sklenar TENacious Cohort.
Agenda Basic Unix Commands (Chapters 2 & 3) Miscellaneous Commands: whereis, which, whoami, finger, passwd, cal, date Working with Files: cat, more, less.
Introduction to Programming Using C An Introduction to Operating Systems.
CSE 374 Programming Concepts & Tools Hal Perkins Fall 2015 Lecture 2a – A Unix Command Sampler (Courtesy of David Notkin, CSE 303)
CS 245 – Part 1 Using Operating Systems and Networks for Programmers Jiang Guo Dept. of Computer Science California State University Los Angeles.
Object Oriented Programming COP3330 / CGS5409.  Assignment Submission Overview  Compiling with g++  Using Makefiles  Misc. Review.
A Brief Overview of Unix Brandon Bohrer. Topics What is Unix? – Quick introduction Documentation – Where to get it, how to use it Text Editors – Know.
Learning basic Unix command It 325 operating system.
Object Oriented Programming COP3330 / CGS5409.  Compiling with g++  Using Makefiles  Debugging.
Object Oriented Programming COP3330 / CGS5409.  Assignment Submission Overview  Compiling with g++  Using Makefiles  Misc. Review.
Login Being logged into a command line prompt allows a user to easily and simply execute multiple commands (one-by-one or at the same time) that would.
CMSC 104, Version 9/011 Operating Systems and Using Linux Topics What is an Operating System? Linux Overview Frequently Used Linux Commands Reading None.
By Jonathan Rinfret UNIX/LINUX By Jonathan Rinfret
Introduction to Unix for FreeSurfer Users
UNIX To do work for the class, you will be using the Unix operating system. Once connected to the system, you will be presented with a login screen. Once.
Commands Basic syntax of shell commands UNIX or shell commands have a basic structure command -options target command comes first (such as cd or ls) any.
Linux Commands Help HANDS ON TRAINING Author: Muhammad Laique
Some Linux Commands.
The Command Prompt Commands are the way to “do things” in Unix
The Linux Operating System
CSE 374 Programming Concepts & Tools
Shell Environments.
Operating Systems and Using Linux
Operating Systems and Using Linux
Operating Systems and Using Linux
Operating Systems and Using Linux
Operating Systems and Using Linux
Introduction Paul Flynn
Operating Systems and Using Linux
Operating Systems and Using Linux
Operating Systems and Using Linux
CSE 303 Concepts and Tools for Software Development
Operating Systems and Using Linux
Presentation transcript:

More Unix Naomi Altman

Directories Directory = folder mkdir - makes a new directory rmdir - removes an empty directory cd mydirectory - moves you into a directory cd - moves you to "home" pwd - names the current directory. - is the current directory../ - is the directory above the current

Environment printenv Prints the settings for your current Unix environment. These can be changed using "set". This is dangerous - you can totally mess up your system by resetting variables in the environment. It is also very useful - e.g. you can set up mail folders, auxillary storage locations, commands. Most of the settings are determined by the files ".cshrc" and ".login"

Paths A path is a set of directories to search for commands and files. Generally, you have 2 paths set up - one for commands, programs, etc - one for documentation to be found by "man" echo $path Sometimes you may "lose" a program because it is not in your path. whereis R

Adding to your Path set mypath (. usr/local/bin/R) set path ($path $mypath) You can add this to the.cshrc file (using the text editor)

File Names Any number of characters and numerals, as well as ".","_" or spaces, but the name should start with a letter. Upper and Lower case are different - i.e. myfile and MyFile are different names. Extensions are not used by Unix, although they may be used by some programs (e.g. Netscape recognizes.htm and.html) or they may be created by some programs (e.g. compilers) Filenames ending in % are meant to be temporary files and may be removed during "clean-up" operations.

Wild Cards Many Unix commands recognize "regular expressions". These allow you to search for files or directories, or to find words within files. * matches anything of any length ? matches a single character [x-y] where x and y are numbers or letters matches a single character including x and y and everything that normally falls between them.

Matching ls -a ls.g* ls.g[a-c]* ls.g?conf Beware the dreaded rm * (Sad but true): The week before my dissertation draft was due, I ran out of disk space. To remove temporary files I typed rm * % instead of rm *%. OOPS!!! On our system, rm has an "alias" rm -i which asks before removing.

Alias Which reminds me that you can make new commands: alias MyCmdName "commands" creates a new command named MyCmdName that executes all the commands in the ""s The new command name will overwrite any Unix command with the same name (so be careful).

History history (show command history list) % !! (recall last command) % !-3 (recall third most recent command) % !5 (recall 5th command in list) % !g (recall last command starting with g) % set history=100 Also !!$ is the result of the last function. ls rm !!$

Writing Software The make command allows programmers to manage large programs or groups of programs. It aids in developing large programs by keeping track of which portions of the entire program have been changed, compiling only those parts of the program which have changed since the last compile. The make program gets its set of compile rules from a text file called makefile which resides in the same directory as the source files. It contains information on how to compile the software, e.g. the optimization level, whether to include debugging info in the executable. It also contains information on where to install the finished compiled binaries (executables), manual pages, data files, dependent library files, configuration files, etc.

Writing Software I can no longer tell you the details of creating a makefile, but it was extremely useful when I was writing c and fortran programs for my dissertation. (These days, that would be c++, java, etc) because it automated the updating process.

The Unix Philosophy Unix was written as a toolkit (The LEGO philosophy). The developers provided nails, screws, hammers, etc and expected others to write software. The pieces all fit together - if you don't have the piece you need, you can build it. Because of this, Unix was written for programmers, not users. The user interfaces have been built on top of the toolkit.

R and the Unix Philosophy S was a statistical package built to use with Unix. It followed the Unix philosophy. R is a modern version of the original S. When you are running R in Unix, you can execute "shell commands" by proceeding them by ! e.g. ls() is a list of objects in the R workspace !ls is a list of objects in the directory in which you are running R.

Why Bother with Unix/Linux Unix was written by a bunch of programmers to facilitate programming. So, it was written to be easy for programmers to extend, which they have. Lots of cool programming tools and environments are available. Unix has much better memory management than Windows, which allows e.g. background computing, and stringing together many CPUs (a cluster) into a supercomputer.

Linux Clusters at Penn State