Basic unix commands that everyone should know (Even if you have a mac) Slightly more advanced:

Slides:



Advertisements
Similar presentations
Learning Unix/Linux Bioinformatics Orientation 2008 Eric Bishop.
Advertisements

1 Introduction to UNIX Ke Liu
ATS Programming Short Course I INTRODUCTORY CONCEPTS Tuesday, Jan. 27 th, 2009 Essential Unix Commands.
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.
T UTORIAL OF U NIX C OMMAND & SHELL SCRIPT S 5027 Professor: Dr. Shu-Ching Chen TA: Samira Pouyanfar Spring 2015.
1 Basics of Linux On linux machine: Login at your home directory Open a “shell” or “terminal” or “xterm” workspace (4) On windows machine Intall linux.
Unix Basics. Systems Programming: Unix Basics 2 Unix Basics  Unix directories  Important Unix file commands  File and Directory Access Rights through.
Linux Commands LINUX COMMANDS.
CS 141 Labs are mandatory. Attendance will be taken in each lab. Make account on moodle. Projects will be submitted via moodle.
Linux Installation and Administration Lesson 2 Tutor: George Papamarkos.
Systems Programming Concepts
Introduction to Linux Workshop February Introduction Rob Lane & The HPC Support Team Research Computing Services CUIT.
Learning basic Unix command IT 325 operating system.
"Two of the most famous products of Berkeley are LSD and Unix. I don't think that this is a coincidence.” Anonymous.
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.
Brief introduction to UNIX A. Emerson CINECA, High Performance Systems.
Help session: Unix basics Keith 9/9/2011. Login in Unix lab  User name: ug0xx Password: ece321 (initial)  The password will not be displayed on the.
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.
Chapter 9 Part II Linux Command Line Access to Linux Authenticated login using a Linux account is required to access a Linux system. The Linux prompt will.
CHAPTER 1 UNIX FOR NONPROGRAMMERS By U ğ ur Halıcı.
Linux Directory Navigation. File & Directory Commands This is a minimal list of Unix commands that you must know for file management: ls (list) mkdir.
Essential Unix at ACEnet Joey Bernard, Computational Research Consultant.
Unix Basics Chapter 4.
The UNIX Shell. The Shell Program that constantly runs at terminal after a user has logged in. Prompts the user and waits for user input. Interprets command.
LIN Unix Lecture 3 Hana Filip. LIN UNIX Resources UNIX Tutorials UNIX help for.
Introduction to Unix – CS 21 Lecture 9. Lecture Overview Shell description Shell choices History Aliases Topic review.
PROGRAMMING PROJECT POLICIES AND UNIX INTRO Sal LaMarca CSCI 1302, Fall 2009.
System Administration Introduction to Unix Session 2 – Fri 02 Nov 2007 Reference:  chapter 1, The Unix Programming Environment, Kernighan & Pike, ISBN.
Session 2 Wharton Summer Tech Camp Basic Unix. Agenda Cover basic UNIX commands and useful functions.
Lesson 2-Touring Essential Programs. Overview Development of UNIX and Linux. Commands to execute utilities. Communicating instructions to the shell. Navigating.
Second edition Your UNIX: The Ultimate Guide Das © 2006 The McGraw-Hill Companies, Inc. All rights reserved. UNIX Commands cal – will print a calendar.
L&T Infotech1 UNIX – Getting Started - Aneesh Ramani.
ITR3 lecture 6: intoduction to UNIX Thomas Krichel
Unix Commands PowerPoint Presentation developed for LS 560 Information Technology online class - University of Alabama by Debey Sklenar TENacious Cohort.
E X C E E D I N G E X P E C T A T I O N S Basic LINUX Linux System Administration Dr. Hoganson Kennesaw State University Operating Systems Directory structure:
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)
Linux Commands C151 Multi-User Operating Systems.
2 Manual & Filestore Mauro Jaskelioff. Introduction Using the manual The UNIX filestore File permissions.
1 Lecture 2 Working with Files and Directories COP 3353 Introduction to UNIX.
UNIX filesystem CS 2204 Class meeting 2 *Notes by Doug Bowman and other members of the CS faculty at Virginia Tech. Copyright
Linux A practical introduction. 1)Background and Getting Started Linux is an operating system with multiple providers Red Hat/CentOS (our version) Ubuntu.
The Kernel At a high level, the kernel in an operating system serves as the bridge between applications and the actual data processing of the hardware.
1 CS3695 – Network Vulnerability Assessment & Risk Mitigation – Introduction to Unix & Linux.
Unix Fundamentals CS 127. File navigation cd - change directory cd /var/log cd /etc/apache2 cd ~/Desktop ~ is a shortcut for the home directory.
Learning basic Unix command It 325 operating system.
File Management commands cat Cat command cat cal.txt cat command displays the contents of a file here cal.txt on screen (or standard out).
Linux Tutorial Lesson Two *Getting Help in Linux *Data movement and manipulation *Relative and Absolute path *Processes Note: see chapter 1,2,3 from Linux.
Learning Unix/Linux Based on slides from: Eric Bishop.
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.
Tutorial of Unix Command & shell scriptS 5027
Chapter 11 Command-Line Master Class
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.
Andy Wang Object Oriented Programming in C++ COP 3330
Some Linux Commands.
C151 Multi-User Operating Systems
The Command Prompt Commands are the way to “do things” in Unix
Introduction to Linux Dr Karina Kubiak - Ossowska
Tutorial of Unix Command & shell scriptS 5027
Basic UNIX OLC Training.
Introduction to UNIX.
Tutorial of Unix Command & shell scriptS 5027
Using Linux Commands Lab 3.
Tutorial of Unix Command & shell scriptS 5027
The Unix File System.
Lab 2: Terminal Basics.
January 26th, 2004 Class Meeting 2
Presentation transcript:

Basic unix commands that everyone should know (Even if you have a mac) Slightly more advanced:

What the ~*&?! ~ “tilde” indicates your home directory: /home/you * “star”: wildcard, matches anything ? wildcard, matches any one character ! History substitution, do not use & run a job in the background, or redirect errors #% special characters for most crystallography programs `\([“’ back-quote, backslash, etc. special to shell _ underscore, use this instead of spaces!!!

Where am I? Print name of the “current working directory” This is the default directory/folder where the shell program will look first for programs, files, etc. It is “where you are” in Unix space. pwd

What is a directory? Directories are places you put files. They are represented as words connected by the “/” character. On Windows, they use a “\”, just to be different. On Mac, they are called “folders”. Whatever you do… DO NOT PUT SPACES In directory/file names! /home/yourname/whatever

What have we here? List contents of the current working directory ls –l - long listing, with dates, owners, etc. ls –lrt - above, but sorted by time ls –lrt /home/yourname/something - long-list a different directory ls

Go somewhere else? Change the current working directory cd /tmp/yourname/ - go to your temporary directory cd - - go back to where you just were cd - no arguments, go back “home” “home” is where your login starts cd

A new beginning… Create a new directory. mkdir./something - make it cd./something - go there ls - check its is empty mkdir

How do I get help? Display the manual for a given program man ls - see manual for the “ ls ” command man tcsh - learn about the C shell man bash - learn about that other shell man man - read the manual for the manual to return to the command prompt, type “ q ” man

Move it! Move or rename a file. If you think about it, these are the same thing. mv stupidname.txt bettername.txt - change name mv stupidplace/file.txt../betterplace/file.txt - same name, different directory mv stupidname_*.img bettername_*.img Will not work! Never ever do this! mv

Copy machine Copy a file. This is just like “ mv ” except it does not delete the original. cp stupidname.txt bettername.txt - change name, keep original rm stupidname.txt - now this is the same as “ mv ” cp

“Permission denied” !? Change the “permission” of a file. chmod a+r filename.txt - make it so everyone can read it chmod u+rwx filename.txt - make it you can read/write/execute it chmod –R u+rw /some/random/place - make it so you can read/write everything under a directory chmod

Destroy! Remove a file forever. There is no “trash” or “undelete” in unix. rm unwanted_file.txt - delete file with that name rm –f /tmp/yourname/* - forcefully remove everything in your temporary directory. Will not prompt for confirmation! rm

less is more Display the contents of a text file, page by page more filename.txt - display contents less filename.txt- many installs now have a replacement for “ more ” called “less” which has nicer search features. to return to the command prompt, type “ q ” more

After the download… File compression and decompression gunzip ~/Downloads/whatever.tar.gz - decompress gzip ~/Downloads/whatever.tar - compress, creates file with.gz extension gunzip

Where the %$#& is it? Search through directories, find files find./ -name ’important*.txt’ - look at everything under current working directory with name starting with “ important ” and ending in “.txt ” find / -name ’important*.txt’ - will always find it, but take a very long time! find

Did I run out of disk space? Check how much space is left on disks df - look at space left on all disks df. - look at space left in the current working directory du –sk. | sort –g - add up space taken up by all files and subdirectories, list biggest hog last df du

Why so slow? Look for programs that may be eating up CPU or memory. top - list processes in order of CPU usage jobs - list jobs running in background of current terminal ps –fHu yourname - list jobs belonging to your account in order of what spawned what ps top

Die Die Die! Stop jobs that are running in the background kill %1 - kill job [1], as listed in “ jobs ” kill kill job listed as 1234 by “ ps ” or “ top ” kill that was not a suggestion! kill -9 -g 1234 – seriously kill that job and the program that launched it kill