Second edition Your UNIX: The Ultimate Guide Das © 2006 The McGraw-Hill Companies, Inc. All rights reserved. UNIX Commands cal – will print a calendar.

Slides:



Advertisements
Similar presentations
By: Tony Andrews.  Linux directory ordering system  Navigating and creating directories ◦ Listing directories and files ◦ Creating directories ◦ Changing.
Advertisements

Learning Unix/Linux Bioinformatics Orientation 2008 Eric Bishop.
Jump to first page Unix Commands Monica Stoica Jump to first page Introduction to Unix n Unix was born in 1969 at Bell Laboratories, a research subdivision.
Unix. Outline Commands Environment Variables Basic Commands CommandMeaning lslist files and directories ls -alist all files and directories mkdirmake.
1 Introduction to UNIX Ke Liu
NETW-240 Shells Last Update Copyright Kenneth M. Chipps Ph.D. 1.
Working with Files How to create, view, copy, rename and print files.
Lab6 CPCS361 I.Mona Alshehri. Working with Files and Directories Creating files Create a file with the cat command type the command cat > name_of_file.
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.
UNIX Chapter 00 A “ Quick Start ” into UNIX Operating System Mr. Mohammad Smirat.
T UTORIAL OF U NIX C OMMAND & SHELL SCRIPT S 5027 Professor: Dr. Shu-Ching Chen TA: Samira Pouyanfar Spring 2015.
Linux Commands LINUX COMMANDS.
L INUX C OMMAND L INE I NTERFACE G UNAANBAN.G
CS 141 Labs are mandatory. Attendance will be taken in each lab. Make account on moodle. Projects will be submitted via moodle.
Using Macs and Unix Nancy Griffeth January 6, 2014 Funding for this workshop was provided by the program “Computational Modeling and Analysis of Complex.
Learning basic Unix command IT 325 operating system.
COMP1070/2002/lec4/H.Melikian COMP1070 Lecture #5  Files and directories in UNIX  Various types of files  File attributes  Notion of pathname  Commands.
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”
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.
Working with Files Chapter 5. Display a Calendar Display a calendar for a specific month – cal Display a calendar for a specific year – cal 2000.
Linux environment ● Graphical interface – X-window + window manager ● Text interface – terminal + shell.
Agenda User Profile File (.profile) –Keyword Shell Variables Linux (Unix) filters –Purpose –Commands: grep, sort, awk cut, tr, wc, spell.
Unix Basics Chapter 4.
Basic unix commands that everyone should know (Even if you have a mac) Slightly more advanced:
LIN Unix Lecture 3 Hana Filip. LIN UNIX Resources UNIX Tutorials UNIX help for.
File Permissions. What are the three categories of users that apply to file permissions? Owner (or user) Group All others (public, world, others)
Jozef Goetz, expanded by Jozef Goetz, 2009 Credits: Parts of the slides are based on slides created by UNIX textbook authors, Syed M. Sarwar, Robert.
ICT Foundation 1 Copyright © 2010, IT Gatekeeper Project – Ohiwa Lab. All rights reserved. File and Directory.
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.
Chapter 0 A “Quick-Start” into the UNIX Operating System.
Lesson 2-Touring Essential Programs. Overview Development of UNIX and Linux. Commands to execute utilities. Communicating instructions to the shell. Navigating.
L&T Infotech1 UNIX – Getting Started - Aneesh Ramani.
BIF713 Basic Unix/Linux Commands Getting Help with Commands.
Welcome to CS323 Operating System lab 1 TA: Nouf Al-Harbi NoufNaief.net.
Unix Commands PowerPoint Presentation developed for LS 560 Information Technology online class - University of Alabama by Debey Sklenar TENacious Cohort.
UNIX An Introduction. Brief History UNIX UNIX Created at Bell Labs, 1969 Created at Bell Labs, 1969 BSD during mid 70s BSD during mid 70s AT&T began offering.
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.
Agenda Basic Unix Commands (Chapters 2 & 3) Miscellaneous Commands: which, passwd, date, ps / kill Working with Files: file, touch, cat, more, less, grep,
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.
AN INTRO TO UNIX/LINUX COMMANDS BY: JIAYANG WANG.
1 Introduction to Unix. 2 What is UNIX?  UNIX is an Operating System (OS).  An operating system is a control program that helps the user communicate.
Learning basic Unix command It 325 operating system.
File Processing. Introduction More UNIX commands for handling files Regular Expressions and Searching files Redirection and pipes Bash facilities.
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.
1 Linux Commands. 2 Path You specify a file or directory by its path name:  the full, or absolute, path name or the one relative to a location. The full.
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
Getting started with CentOS Linux
Linux Commands Help HANDS ON TRAINING Author: Muhammad Laique
Andy Wang Object Oriented Programming in C++ COP 3330
Some Linux Commands.
C151 Multi-User Operating Systems
Agenda Basic Unix Commands (Chapters 2 & 3) Miscellaneous Commands:
CSE 374 Programming Concepts & Tools
Tutorial of Unix Command & shell scriptS 5027
Basic UNIX OLC Training.
Tutorial of Unix Command & shell scriptS 5027
Web Programming Essentials:
Tutorial of Unix Command & shell scriptS 5027
Getting started with CentOS Linux
Andy Wang Object Oriented Programming in C++ COP 3330
Linux Commands LINUX COMMANDS.
Presentation transcript:

second edition Your UNIX: The Ultimate Guide Das © 2006 The McGraw-Hill Companies, Inc. All rights reserved. UNIX Commands cal – will print a calendar for a specified month apache{kkhan}2: cal January 2008 S M Tu W Th F S

second edition Your UNIX: The Ultimate Guide Das © 2006 The McGraw-Hill Companies, Inc. All rights reserved. UNIX Commands cal apache{kkhan}21: cal June 2008 S M Tu W Th F S

second edition Your UNIX: The Ultimate Guide Das © 2006 The McGraw-Hill Companies, Inc. All rights reserved. UNIX Commands cal 2008 apache{kkhan}25: cal 2008 Jan Feb Mar S M Tu W Th F S S M Tu W Th F S S M Tu W Th F S Apr May Jun S M Tu W Th F S S M Tu W Th F S S M Tu W Th F S

second edition Your UNIX: The Ultimate Guide Das © 2006 The McGraw-Hill Companies, Inc. All rights reserved. UNIX Commands cat The command outputs the contents of a text file. cat file1 >> file2 Appends file1 onto the end of file2 apache[kkhan:193] cat foo1 Desktop PUTTY.RND foo1 typescript apache[kkhan:194] cat foo2 Mail QUIZ 2.doc foo2 typescript /net/core/export/home/cs/001/k apache[kkhan:197] cat foo1 >> foo2 Mail QUIZ 2.doc foo2 typescript /net/core/export/home/cs/001/k Desktop PUTTY.RND foo1 typescript

second edition Your UNIX: The Ultimate Guide Das © 2006 The McGraw-Hill Companies, Inc. All rights reserved. UNIX Commands cd – This command changes your current directory location. By default, your UNIX login session begins in your home directory. cd myfiles – will switch to subdirectory named myfiles cd /home/myfiles/mydocs – will switch to mydocs directory cd.. – will move the parent directory of the current directory cd / - to move to the roor directory chmod – This command changes the permission information associated with a file. All UNIX directories and files are stored with the permissions to read, write, or execute the file, abbreviated as r, w, x. These permissions are broken down for three categories of user: the owner of the file ‘u’, a group to which both the user and the file may be associated ‘g’; and all users ‘o’.

second edition Your UNIX: The Ultimate Guide Das © 2006 The McGraw-Hill Companies, Inc. All rights reserved. UNIX Commands chmod u+x myfile – allow yourself to execute a file that you own chmod o+rx myfile – allow anyone who has access to the directory in which myfile is stored to read or execute myfile; perform ‘ls –l’ to view the directory cp – This command copies a file, preserving the original and creating an identical copy. If you already have a file with the new name, cp will overwrite and destroy the duplicate. It is always safe to use ‘-i’ option; so the system ask for your approval before it destroys any files. cp -i oldfile newfile

second edition Your UNIX: The Ultimate Guide Das © 2006 The McGraw-Hill Companies, Inc. All rights reserved. UNIX Commands cp -i /home/myfiles/notes/meeting1. The. period indicates the current directory as destination, and the -i ensures that if there is another file named meeting1 in the current directory, you will not overwrite it by accident cp -i oldfile ~/myfiles/newfile The ~ character (tilde) is interpreted as the path of your home directory. Note: You must have permission to read a file in order to copy it.

second edition Your UNIX: The Ultimate Guide Das © 2006 The McGraw-Hill Companies, Inc. All rights reserved. UNIX Commands find This find command lists all of the files within a directory and its subdirectories that match a set of conditions. This command is most commonly used to find all of the files that have a certain name. find. –name lecture* -print find "$HOME/" -name lecture* -print searching for files containing lecture in the name in the home directory

second edition Your UNIX: The Ultimate Guide Das © 2006 The McGraw-Hill Companies, Inc. All rights reserved. UNIX Commands jobs This command reports any programs that you suspended and still running or waiting in the background (Ctrl-z to suspend) kill Use this command as a last resort to destroy any jobs or programs that you suspended and are unable to restart. Use the jobs command to see a list of suspended jobs kill %3 – to kill a suspended job number three kill -9 %3 – If the job has not been cancelled, harsher measures may be necessary.

second edition Your UNIX: The Ultimate Guide Das © 2006 The McGraw-Hill Companies, Inc. All rights reserved. UNIX Commands less and more Both less and more display the contents of a file one screen at a time, waiting for you to press Spacebar between screens. This lets you read text without it scrolling quickly off the screen. The less utility is more powerful and flexible than more, but more is available of all UNIX systems while less may not be. less myfile ls –la | less

second edition Your UNIX: The Ultimate Guide Das © 2006 The McGraw-Hill Companies, Inc. All rights reserved. UNIX Command lpr and lp These commands print a file on a printer connected to the computer network. The lpr command is used on BSD systems, and the lp command is used in System V Note: BSD: Berkley Software Distribution System V: Developed by AT&T; release in 1983

second edition Your UNIX: The Ultimate Guide Das © 2006 The McGraw-Hill Companies, Inc. All rights reserved. UNIX Commands lpr –Plp1 myfile will print a files named myfile on a printer named lp1 with lpr lp –dlp1 myfile will print the same file to the same printer with lp command ls – list the files stored in a directory ls –a – will list the configuration files such as.login (dot files) ls –la – to see the file permissions, owners, and sizes of all files ls –la | less

second edition Your UNIX: The Ultimate Guide Das © 2006 The McGraw-Hill Companies, Inc. All rights reserved. UNIX Commands mkdir – will make a new subdirectory mkdir mystuff create a subdirectory named mystuff in the existing directory mkdir /tmp/mystuff create subdirectory named mystuff in the existing directory named tmp Note: In order to create a subdirectory in a particular directory, you must have permission to write to that directory mv – this command will move a file use mv not only to change the directory location of a file, but also rename files; Unlike the cp command, mv will not preserve the original file

second edition Your UNIX: The Ultimate Guide Das © 2006 The McGraw-Hill Companies, Inc. All rights reserved. UNIX Commands As with the cp command, you should always use –i to make sure you do not overwrite an existing file mv –i oldname newname to move a file named oldname in the current directory to the new name newname mv –i newhw/hw1 oldhw move a file named hw1 from subdirectory named newhow to another subdirectory oldhw mv -i newhw/hw1 oldhw/firsthw you also want to give the file a new name; such as firsthw

second edition Your UNIX: The Ultimate Guide Das © 2006 The McGraw-Hill Companies, Inc. All rights reserved. UNIX Commands ps This command displays information about processes that are currently running. ps –alxww (BSD) to view detailed information about all running processes ps –elf (in System V)

second edition Your UNIX: The Ultimate Guide Das © 2006 The McGraw-Hill Companies, Inc. All rights reserved. UNIX Commands pwd The command reports the current directory path. rm The command will remove (destroy) a file. must enter with -i option for confirmation rm -i junk will permanently remove the file rm –rf oldstuff will remove a directory and all its contents- oldstuff rmdir This command will remove a subdirectory rmdir oldstuff (must be empty)

second edition Your UNIX: The Ultimate Guide Das © 2006 The McGraw-Hill Companies, Inc. All rights reserved. UNIX Commands set This command displays or changes various settings and options associated with your UNIX session. set | less vi This command starts a vi text editor vi myfile w and who w – gets the list of what users are doing who – gets the computer names of the terminal they are using

second edition Your UNIX: The Ultimate Guide Das © 2006 The McGraw-Hill Companies, Inc. All rights reserved. UNIX Commands tail show the last 10 lines of a file clear clears the terminal window head writes the first 10 lines of the file to the screen head -5 myfile

second edition Your UNIX: The Ultimate Guide Das © 2006 The McGraw-Hill Companies, Inc. All rights reserved. UNIX Commands grep search for a string in a file use -i option to ignore upper/lower case distinction use –v option to display lines that do not match sort sort alphabetically or numerically a list ls | sort who | sort ls ?ouse will match one character (house, mouse, not grouse)

second edition Your UNIX: The Ultimate Guide Das © 2006 The McGraw-Hill Companies, Inc. All rights reserved. UNIX Commands apropos When you are not sure of the exact name of a command apropos keyword will give you the commands with keyword in their manual pages try apropos copy