UNIX Quick Reference

Similar documents
Introduction p. 1 Who Should Read This Book? p. 1 What You Need to Know Before Reading This Book p. 2 How This Book Is Organized p.

acmteam/unix.pdf How to manage your account (user ID, password, shell); How to compile C, C++, and Java programs;

Computer Systems and Architecture

System Administration

AN INTRODUCTION TO UNIX

Some useful UNIX Commands written down by Razor for newbies to get a start in UNIX

IMPORTANT: Logging Off LOGGING IN

UNIX Quick Reference

Mills HPC Tutorial Series. Linux Basics I

Useful Unix Commands Cheat Sheet

Computer Systems and Architecture

Getting Started. Running Utilities. Shells. Special Characters. Special Characters. Chapter 2 Unix Utilities for non-programmers

Introduction to Linux

Introduction to Linux Organizing Files

Introduction to Unix The Windows User perspective. Wes Frisby Kyle Horne Todd Johansen

Embedded Linux Systems. Bin Li Assistant Professor Dept. of Electrical, Computer and Biomedical Engineering University of Rhode Island

Linux Command Line Primer. By: Scott Marshall

Basic Shell Commands

Unix Workshop Aug 2014

Command-line interpreters

Lab 2: Linux/Unix shell

Perl and R Scripting for Biologists

Introduction to UNIX. Logging in. Basic System Architecture 10/7/10. most systems have graphical login on Linux machines

Research. We make it happen. Unix Basics. User Support Group help-line: personal:

Introduction to Linux

Set 1 MCQ Which command is used to sort the lines of data in a file in reverse order A) sort B) sh C) st D) sort -r

FREEENGINEER.ORG. 1 of 6 11/5/15 8:31 PM. Learn UNIX in 10 minutes. Version 1.3. Preface

Linux Reference Card - Command Summary

Introduction to UNIX Shell Exercises

Unix/Linux Basics. Cpt S 223, Fall 2007 Copyright: Washington State University

Oxford University Computing Services. Getting Started with Unix

CSCE 212H, Spring 2008, Matthews Lab Assignment 1: Representation of Integers Assigned: January 17 Due: January 22

First of all, these notes will cover only a small subset of the available commands and utilities, and will cover most of those in a shallow fashion.

Unix/Linux Operating System. Introduction to Computational Statistics STAT 598G, Fall 2011

MTU Computer Structure

CSCI 2132 Software Development. Lecture 4: Files and Directories

Outline. Structure of a UNIX command

Introduction: What is Unix?

The Unix Shell & Shell Scripts

CSE Linux VM. For Microsoft Windows. Based on opensuse Leap 42.2

Introduction to remote command line Linux. Research Computing Team University of Birmingham

BIOINFORMATICS POST-DIPLOMA PROGRAM SUBJECT OUTLINE Subject Title: OPERATING SYSTEMS AND PROJECT MANAGEMENT Subject Code: BIF713 Subject Description:

RH033 Red Hat Linux Essentials

Read the relevant material in Sobell! If you want to follow along with the examples that follow, and you do, open a Linux terminal.

UNIX Basics. Science & Technology Support Group High Performance Computing Ohio Supercomputer Center 1224 Kinnear Road Columbus, OH 43212

Contents. xxvii. Preface

UNIX Essentials Featuring Solaris 10 Op System

Introduction to Linux Workshop 1

Linux environment. Graphical interface X-window + window manager. Text interface terminal + shell

Introduction to UNIX Command Line

Essential Unix (and Linux) for the Oracle DBA. Revision no.: PPT/2K403/02

Linux/Cygwin Practice Computer Architecture

CS4350 Unix Programming. Outline

Introduction to UNIX/Linux

hash Remember the full pathname of a name argument head Output the first part of file(s) history Command History hostname Print or set system name

Lecture # 2 Introduction to UNIX (Part 2)

CSE 391 Lecture 3. bash shell continued: processes; multi-user systems; remote login; editors

UNIX Basics. UNIX Basics CIS 218 Oakton Community College

CHAPTER 1 UNIX FOR NONPROGRAMMERS

Basic Unix Commands. CGS 3460, Lecture 6 Jan 23, 2006 Zhen Yang

A Brief Introduction to Unix

M2PGER FORTRAN programming. General introduction. Virginie DURAND and Jean VIRIEUX 10/13/2013 M2PGER - ALGORITHME SCIENTIFIQUE

Common UNIX Utilities Alphabetical List

Operating Systems Lab 1 (Users, Groups, and Security)

Introduction to the Linux Command Line January Presentation Topics

Introduction to the Linux Command Line

Introduction to Linux

XSEDE Scholars Program Introduction to the Linux Environment. Tips and Tricks for Linux Users John Lockman III June 5 th, 2012

Introduction to Linux

Introduction. File System. Note. Achtung!

Introduction to the Linux for HPC. Basic Linux for Beginner HPC Users

Std: XI CHAPTER-3 LINUX

Bioinformatics. Computational Methods I: Genomic Resources and Unix. George Bell WIBR Biocomputing Group

Introduction to UNIX. Introduction EECS l UNIX is an operating system (OS). l Our goals:

Introduction to the UNIX command line

UNIX. Basic UNIX Command

Basic Linux Command Line Interface Guide

Basic Linux Command Line Interface Guide

The UNIX Shells. Computer Center, CS, NCTU. How shell works. Unix shells. Fetch command Analyze Execute

GNU/Linux 101. Casey McLaughlin. Research Computing Center Spring Workshop Series 2018

Appendix B WORKSHOP. SYS-ED/ Computer Education Techniques, Inc.

Using the Unix system. UNIX Introduction

CSE 390a Lecture 3. bash shell continued: processes; multi-user systems; remote login; editors

Table of contents. Our goal. Notes. Notes. Notes. Summer June 29, Our goal is to see how we can use Unix as a tool for developing programs

Processes. Shell Commands. a Command Line Interface accepts typed (textual) inputs and provides textual outputs. Synonyms:

Introduction to Linux (Part I) BUPT/QMUL 2018/03/14

CS370 Operating Systems

Connecting to ICS Server, Shell, Vim CS238P Operating Systems fall 18

Introduction to Linux Environment. Yun-Wen Chen

Introduction to Linux

Bharadia Jaydeep OS with Unix MCQ

CS Fundamentals of Programming II Fall Very Basic UNIX

Quick Start Guide. by Burak Himmetoglu. Supercomputing Consultant. Enterprise Technology Services & Center for Scientific Computing

CS197U: A Hands on Introduction to Unix

An Introduction to Unix Power Tools

CSCI 2132 Software Development. Lecture 5: File Permissions

SIEMENS UserAdmin Workshop TELEPERM XP Version 4 Chapter 1

Command Line Interface Techniques

Assume that username is cse. The user s home directory will be /home/cse. You may remember what the relative pathname for users home directory is: ~

Introduction To. Barry Grant

Transcription:

UNIX Quick Reference This card represents a brief summary of some of the more frequently used UNIX commands that all users should be at least somewhat familiar with. Some commands listed have much more functionality than can be included on this card. Please consult their respective manual pages for more information (man command). Filesystem Management ls List normal files. ls file List only file. ls -a List all files. ls -l Verbosely list normal files. ls -al Verbosely list all files. ls -al file Verbosely list only file. rm file rm -r dir mv file1 file2 mv dir1 dir2 cp file1 file2 cd dir mkdir dir rmdir dir chown user file chgrp group file chmod nnn file locate file find dir -name file Remove file. Remove dir and all subdirs. Move/Rename file1 to file2. Move/Rename dir1 to dir2. Copy file1 to file2. Change directory to dir. Make a directory dir. Remove the directory dir. Change owner of file to user. Change group of file to group. Change permissions on file to 755 rwxr-xr-x 700 rwx------ 644 rw-r--r-- 600 rw------- Find file (fast, not reliable). Find file in subdir of dir (very slow, reliable).

Account Management passwd Change your password. chsh Change your login shell. chfn Change your finger info. who w quota -v du -k dir df -k Show who is logged on. Show who is doing what. Show your disk quota info. Show disk usage of dir. Show filesystem usage. File Manipulation vi file pico file wc file more file head -n file tail -n file grep pattern file cat file1 file2 > file3 Edit file with vi editor. Edit file with pico editor. Count words/lines in file. Show contents of file. Show first n lines of file. Show last n lines of file. Search file for pattern. Append file2 to file1 and save results as file3. Process (Job) Mananagement top Show the top cpu processes. ps -elf Show info about all processes. kill pid Kill process pid. kill -9 pid Kill stubborn process pid. ^C Interrupt a foreground process. ^Z Suspend a foreground process. jobs Show jobs from this session. bg Send process to background. fg Bring process to foreground. nice command Run command at lower priority. renice -n n pid Lower priority of pid by n. time command Time the execution of command. Archiving and Compression tar cf file.tar files tar xf file.tar gzip file gzip -d file.gz compress file uncompress file.z Archive files as file.tar Extract archive file.tar. Compress file to file.gz. Uncompresss file.gz. Compress file to file.z. Uncompress file.z.

Printing lpr file lpr -Pprinter file lpq lpq -Pprinter lprm - lprm -Pprinter - lprm job lprm -Pprinter job Print file to default printer. Print file to printer. Show default print queue. Show printer print queue. Purge default printer. Purge printer. Remove job on default printer. Remove job on printer. Compilation (Fortran) (C) (C++) f77 options file1.f... filen.f cc options file1.c... filen.c CC options file1.c... filen.c Some of the more important compiler options are summarised below. Please note that some compilers are slightly different than others, the options included here are common to most compilers. -o file.x Create executable called file.x. -g Include info for debugging. -c Compile, but do not link objects. -ON Optimize executable (1 N 3). -lfoo Include library libfoo.a. The dbx Debugger dbx file.x Start debugger with file.x. rerun Rerun from beginning. stop in sub Set breakpoint in subroutine. stop at N Set breakpoint at line N. trace var Set a tracewatch on variable. status Show breakpoints and traces. delete N Delete N th breakpoint/trace. delete all Delete all breakpoints/traces. cont Continue running (after a stop). step Execute the next line and stop. next Same as step, but steps over calls. list List 10 lines of source. list N List 10 lines from line N. print var Print the value of variable. dump Print the value of all variables. quit Quit the debugger.

Getting Help man command man -k keyword Show the manual for command. Search man pages for keyword. I/O Redirection < file Redirect file to STDIN. > file Redirect STDOUT to file. >! file Redirect STDOUT to file (overwrite). >> file Redirect STDOUT to file (append). >& file Redirect STDOUT & STDERR to file. tee file Show STDOUT and copy to file. Redirect STDOUT of one command to STDIN of another (ie: ls more). Environment Variables (csh/tcsh) echo $var printenv setenv var value unsetenv var Show value of var. Show value of all variables. Set value of var to val. Remove the variable var. Aliases (csh/tcsh) alias alias name alias name command Show all aliases. Show alias name. Create an alias called name for command. The vi Editor (Basics) <Esc> Return to command mode. :q Quit. :q! Quit and discard changes. :w Save. :w file Save as file. :wq Save and quit. :wq! Save and quit (for readonly files). ZZ Save and quit. i Insert text mode. a Append text mode. R Replace text mode. u Undo last action. U Redo last action.. Repeat last command.

The vi Editor (Editing) o O r Nx dnd dw dw D yny p P J Insert new line below cursor. Insert new line above cursor. Replace character. Delete N characters. Delete N lines. Delete word (punctuation exluded). Delete word (punctuation included). Delete here to end of line. Yank N lines to buffer. Paste buffer after cursor. Paste buffer before cursor. Join current and next line. The vi Editor (Movement and Searching) Go to start of line. $ Go to end of line. G Go to last line. Ng Go to Nth line. ^f Page down. ^b Page up. % Find matching brackets. /pattern Search forward for pattern.?pattern Search backward for pattern. n Go to next pattern. N Go back to previous pattern. :1,$s/pat1/pat2/g Replace all pat1 with pat2. The vi Editor (vim Extensions) ^V :center :left :right :set ruler :syntax on :help :set wrapmargin=n Visual block mode. Center current line. Left-align current line. Right-align current line. Show the cursor position. Enable syntax highlighting. Additional help. Wrap line when < n columns remain.

c 2000 Douglas Weir - University of Waterloo. /u/dweir/latex/quickref/quickref.tex