Top Banner
logo - Lecture 2: ES 102 Linux Commands Introduction to Computing IIT Gandhinagar, India Sep, 2013 Bireswar, Shivkumar (IIT Gandhinagar) Lecture 2 Sep 2013 1 / 12
52

Lecture 2: ES 102 Linux Commands · logo-Lecture 2: ES 102 Linux Commands Introduction to Computing IIT Gandhinagar, India Sep, 2013 Bireswar, Shivkumar (IIT Gandhinagar) Lecture

Sep 24, 2020

Download

Documents

dariahiddleston
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Lecture 2: ES 102 Linux Commands · logo-Lecture 2: ES 102 Linux Commands Introduction to Computing IIT Gandhinagar, India Sep, 2013 Bireswar, Shivkumar (IIT Gandhinagar) Lecture

logo

-

Lecture 2: ES 102Linux Commands

Introduction to Computing

IIT Gandhinagar, India

Sep, 2013

Bireswar, Shivkumar (IIT Gandhinagar) Lecture 2 Sep 2013 1 / 12

Page 2: Lecture 2: ES 102 Linux Commands · logo-Lecture 2: ES 102 Linux Commands Introduction to Computing IIT Gandhinagar, India Sep, 2013 Bireswar, Shivkumar (IIT Gandhinagar) Lecture

logo

Directory Structure in Linux

/

bin dev ....... home .... etc sys var

root

iitgn es102 guest

Cprog Folder1 Desktop .... file1 ...

prog1.c Prog2.c

Home Folder

path /home/es102/Cprog/Prog2

Bireswar, Shivkumar (IIT Gandhinagar) Lecture 2 Sep 2013 2 / 12

Page 3: Lecture 2: ES 102 Linux Commands · logo-Lecture 2: ES 102 Linux Commands Introduction to Computing IIT Gandhinagar, India Sep, 2013 Bireswar, Shivkumar (IIT Gandhinagar) Lecture

logo

Directory Structure in Linux/

bin dev ....... home .... etc sys var

root

iitgn es102 guest

Cprog Folder1 Desktop .... file1 ...

prog1.c Prog2.c

Home Folder

path /home/es102/Cprog/Prog2

Path of directory Folder1 is /home/username/ES102/Folder1.

Parent directory: Directory that contains it.

Home directory: Each user has a directory with the same name aslogin id. This directory called home directory.

pwd print home directory.

mkdir create directory.

ls list directory and files.

Bireswar, Shivkumar (IIT Gandhinagar) Lecture 2 Sep 2013 3 / 12

Page 4: Lecture 2: ES 102 Linux Commands · logo-Lecture 2: ES 102 Linux Commands Introduction to Computing IIT Gandhinagar, India Sep, 2013 Bireswar, Shivkumar (IIT Gandhinagar) Lecture

logo

Directory Structure in Linux/

bin dev ....... home .... etc sys var

root

iitgn es102 guest

Cprog Folder1 Desktop .... file1 ...

prog1.c Prog2.c

Home Folder

path /home/es102/Cprog/Prog2

Path of directory Folder1 is /home/username/ES102/Folder1.

Parent directory: Directory that contains it.

Home directory: Each user has a directory with the same name aslogin id. This directory called home directory.

pwd print home directory.

mkdir create directory.

ls list directory and files.

Bireswar, Shivkumar (IIT Gandhinagar) Lecture 2 Sep 2013 3 / 12

Page 5: Lecture 2: ES 102 Linux Commands · logo-Lecture 2: ES 102 Linux Commands Introduction to Computing IIT Gandhinagar, India Sep, 2013 Bireswar, Shivkumar (IIT Gandhinagar) Lecture

logo

Directory Structure in Linux/

bin dev ....... home .... etc sys var

root

iitgn es102 guest

Cprog Folder1 Desktop .... file1 ...

prog1.c Prog2.c

Home Folder

path /home/es102/Cprog/Prog2

Path of directory Folder1 is /home/username/ES102/Folder1.

Parent directory: Directory that contains it.

Home directory: Each user has a directory with the same name aslogin id. This directory called home directory.

pwd print home directory.

mkdir create directory.

ls list directory and files.

Bireswar, Shivkumar (IIT Gandhinagar) Lecture 2 Sep 2013 3 / 12

Page 6: Lecture 2: ES 102 Linux Commands · logo-Lecture 2: ES 102 Linux Commands Introduction to Computing IIT Gandhinagar, India Sep, 2013 Bireswar, Shivkumar (IIT Gandhinagar) Lecture

logo

Directory Structure in Linux/

bin dev ....... home .... etc sys var

root

iitgn es102 guest

Cprog Folder1 Desktop .... file1 ...

prog1.c Prog2.c

Home Folder

path /home/es102/Cprog/Prog2

Path of directory Folder1 is /home/username/ES102/Folder1.

Parent directory: Directory that contains it.

Home directory: Each user has a directory with the same name aslogin id. This directory called home directory.

pwd print home directory.

mkdir create directory.

ls list directory and files.

Bireswar, Shivkumar (IIT Gandhinagar) Lecture 2 Sep 2013 3 / 12

Page 7: Lecture 2: ES 102 Linux Commands · logo-Lecture 2: ES 102 Linux Commands Introduction to Computing IIT Gandhinagar, India Sep, 2013 Bireswar, Shivkumar (IIT Gandhinagar) Lecture

logo

Directory Structure in Linux/

bin dev ....... home .... etc sys var

root

iitgn es102 guest

Cprog Folder1 Desktop .... file1 ...

prog1.c Prog2.c

Home Folder

path /home/es102/Cprog/Prog2

Path of directory Folder1 is /home/username/ES102/Folder1.

Parent directory: Directory that contains it.

Home directory: Each user has a directory with the same name aslogin id. This directory called home directory.

pwd print home directory.

mkdir create directory.

ls list directory and files.

Bireswar, Shivkumar (IIT Gandhinagar) Lecture 2 Sep 2013 3 / 12

Page 8: Lecture 2: ES 102 Linux Commands · logo-Lecture 2: ES 102 Linux Commands Introduction to Computing IIT Gandhinagar, India Sep, 2013 Bireswar, Shivkumar (IIT Gandhinagar) Lecture

logo

Directory Structure in Linux/

bin dev ....... home .... etc sys var

root

iitgn es102 guest

Cprog Folder1 Desktop .... file1 ...

prog1.c Prog2.c

Home Folder

path /home/es102/Cprog/Prog2

Path of directory Folder1 is /home/username/ES102/Folder1.

Parent directory: Directory that contains it.

Home directory: Each user has a directory with the same name aslogin id. This directory called home directory.

pwd print home directory.

mkdir create directory.

ls list directory and files.

Bireswar, Shivkumar (IIT Gandhinagar) Lecture 2 Sep 2013 3 / 12

Page 9: Lecture 2: ES 102 Linux Commands · logo-Lecture 2: ES 102 Linux Commands Introduction to Computing IIT Gandhinagar, India Sep, 2013 Bireswar, Shivkumar (IIT Gandhinagar) Lecture

logo

Directory Structure in Linux/

bin dev ....... home .... etc sys var

root

iitgn es102 guest

Cprog Folder1 Desktop .... file1 ...

prog1.c Prog2.c

Home Folder

path /home/es102/Cprog/Prog2

Path of directory Folder1 is /home/username/ES102/Folder1.

Parent directory: Directory that contains it.

Home directory: Each user has a directory with the same name aslogin id. This directory called home directory.

pwd print home directory.

mkdir create directory.

ls list directory and files.

Bireswar, Shivkumar (IIT Gandhinagar) Lecture 2 Sep 2013 3 / 12

Page 10: Lecture 2: ES 102 Linux Commands · logo-Lecture 2: ES 102 Linux Commands Introduction to Computing IIT Gandhinagar, India Sep, 2013 Bireswar, Shivkumar (IIT Gandhinagar) Lecture

logo

Navigation

Basic command cd path

Some shorthands:

1 special name for root directory /2 The shorthand for current directory .3 The shorthand for parent directory ..4 The shorthand for home directory ∼

Examples $cd $cd . $cd .. $ cd ../..

Bireswar, Shivkumar (IIT Gandhinagar) Lecture 2 Sep 2013 4 / 12

Page 11: Lecture 2: ES 102 Linux Commands · logo-Lecture 2: ES 102 Linux Commands Introduction to Computing IIT Gandhinagar, India Sep, 2013 Bireswar, Shivkumar (IIT Gandhinagar) Lecture

logo

Navigation

Basic command cd path

Some shorthands:

1 special name for root directory /2 The shorthand for current directory .3 The shorthand for parent directory ..4 The shorthand for home directory ∼

Examples $cd $cd . $cd .. $ cd ../..

Bireswar, Shivkumar (IIT Gandhinagar) Lecture 2 Sep 2013 4 / 12

Page 12: Lecture 2: ES 102 Linux Commands · logo-Lecture 2: ES 102 Linux Commands Introduction to Computing IIT Gandhinagar, India Sep, 2013 Bireswar, Shivkumar (IIT Gandhinagar) Lecture

logo

Navigation

Basic command cd path

Some shorthands:1 special name for root directory /

2 The shorthand for current directory .3 The shorthand for parent directory ..4 The shorthand for home directory ∼

Examples $cd $cd . $cd .. $ cd ../..

Bireswar, Shivkumar (IIT Gandhinagar) Lecture 2 Sep 2013 4 / 12

Page 13: Lecture 2: ES 102 Linux Commands · logo-Lecture 2: ES 102 Linux Commands Introduction to Computing IIT Gandhinagar, India Sep, 2013 Bireswar, Shivkumar (IIT Gandhinagar) Lecture

logo

Navigation

Basic command cd path

Some shorthands:1 special name for root directory /2 The shorthand for current directory .

3 The shorthand for parent directory ..4 The shorthand for home directory ∼

Examples $cd $cd . $cd .. $ cd ../..

Bireswar, Shivkumar (IIT Gandhinagar) Lecture 2 Sep 2013 4 / 12

Page 14: Lecture 2: ES 102 Linux Commands · logo-Lecture 2: ES 102 Linux Commands Introduction to Computing IIT Gandhinagar, India Sep, 2013 Bireswar, Shivkumar (IIT Gandhinagar) Lecture

logo

Navigation

Basic command cd path

Some shorthands:1 special name for root directory /2 The shorthand for current directory .3 The shorthand for parent directory ..

4 The shorthand for home directory ∼Examples $cd $cd . $cd .. $ cd ../..

Bireswar, Shivkumar (IIT Gandhinagar) Lecture 2 Sep 2013 4 / 12

Page 15: Lecture 2: ES 102 Linux Commands · logo-Lecture 2: ES 102 Linux Commands Introduction to Computing IIT Gandhinagar, India Sep, 2013 Bireswar, Shivkumar (IIT Gandhinagar) Lecture

logo

Navigation

Basic command cd path

Some shorthands:1 special name for root directory /2 The shorthand for current directory .3 The shorthand for parent directory ..4 The shorthand for home directory ∼

Examples $cd $cd . $cd .. $ cd ../..

Bireswar, Shivkumar (IIT Gandhinagar) Lecture 2 Sep 2013 4 / 12

Page 16: Lecture 2: ES 102 Linux Commands · logo-Lecture 2: ES 102 Linux Commands Introduction to Computing IIT Gandhinagar, India Sep, 2013 Bireswar, Shivkumar (IIT Gandhinagar) Lecture

logo

Navigation

Basic command cd path

Some shorthands:1 special name for root directory /2 The shorthand for current directory .3 The shorthand for parent directory ..4 The shorthand for home directory ∼

Examples $cd $cd . $cd .. $ cd ../..

Bireswar, Shivkumar (IIT Gandhinagar) Lecture 2 Sep 2013 4 / 12

Page 17: Lecture 2: ES 102 Linux Commands · logo-Lecture 2: ES 102 Linux Commands Introduction to Computing IIT Gandhinagar, India Sep, 2013 Bireswar, Shivkumar (IIT Gandhinagar) Lecture

logo

Copying and Moving

Basic command cp filePath destinationPath.

If destination is a directory cp creates a copy inside the directory.

If destination is a file name, cp creates a copy with that name.

Copying directory cp -r dirPath destinationPath.

Basic command mv sourcePath destinationPath.

Examples:cp Cprog/Prog2.c ../new.ccp Cprog/Prog2.c ../mv Cprog ../newFoldermv Cprog ../Folder2

Bireswar, Shivkumar (IIT Gandhinagar) Lecture 2 Sep 2013 5 / 12

Page 18: Lecture 2: ES 102 Linux Commands · logo-Lecture 2: ES 102 Linux Commands Introduction to Computing IIT Gandhinagar, India Sep, 2013 Bireswar, Shivkumar (IIT Gandhinagar) Lecture

logo

Copying and Moving

Basic command cp filePath destinationPath.

If destination is a directory cp creates a copy inside the directory.

If destination is a file name, cp creates a copy with that name.

Copying directory cp -r dirPath destinationPath.

Basic command mv sourcePath destinationPath.

Examples:cp Cprog/Prog2.c ../new.ccp Cprog/Prog2.c ../mv Cprog ../newFoldermv Cprog ../Folder2

Bireswar, Shivkumar (IIT Gandhinagar) Lecture 2 Sep 2013 5 / 12

Page 19: Lecture 2: ES 102 Linux Commands · logo-Lecture 2: ES 102 Linux Commands Introduction to Computing IIT Gandhinagar, India Sep, 2013 Bireswar, Shivkumar (IIT Gandhinagar) Lecture

logo

Copying and Moving

Basic command cp filePath destinationPath.

If destination is a directory cp creates a copy inside the directory.

If destination is a file name, cp creates a copy with that name.

Copying directory cp -r dirPath destinationPath.

Basic command mv sourcePath destinationPath.

Examples:cp Cprog/Prog2.c ../new.ccp Cprog/Prog2.c ../mv Cprog ../newFoldermv Cprog ../Folder2

Bireswar, Shivkumar (IIT Gandhinagar) Lecture 2 Sep 2013 5 / 12

Page 20: Lecture 2: ES 102 Linux Commands · logo-Lecture 2: ES 102 Linux Commands Introduction to Computing IIT Gandhinagar, India Sep, 2013 Bireswar, Shivkumar (IIT Gandhinagar) Lecture

logo

Copying and Moving

Basic command cp filePath destinationPath.

If destination is a directory cp creates a copy inside the directory.

If destination is a file name, cp creates a copy with that name.

Copying directory cp -r dirPath destinationPath.

Basic command mv sourcePath destinationPath.

Examples:cp Cprog/Prog2.c ../new.ccp Cprog/Prog2.c ../mv Cprog ../newFoldermv Cprog ../Folder2

Bireswar, Shivkumar (IIT Gandhinagar) Lecture 2 Sep 2013 5 / 12

Page 21: Lecture 2: ES 102 Linux Commands · logo-Lecture 2: ES 102 Linux Commands Introduction to Computing IIT Gandhinagar, India Sep, 2013 Bireswar, Shivkumar (IIT Gandhinagar) Lecture

logo

Copying and Moving

Basic command cp filePath destinationPath.

If destination is a directory cp creates a copy inside the directory.

If destination is a file name, cp creates a copy with that name.

Copying directory cp -r dirPath destinationPath.

Basic command mv sourcePath destinationPath.

Examples:cp Cprog/Prog2.c ../new.ccp Cprog/Prog2.c ../mv Cprog ../newFoldermv Cprog ../Folder2

Bireswar, Shivkumar (IIT Gandhinagar) Lecture 2 Sep 2013 5 / 12

Page 22: Lecture 2: ES 102 Linux Commands · logo-Lecture 2: ES 102 Linux Commands Introduction to Computing IIT Gandhinagar, India Sep, 2013 Bireswar, Shivkumar (IIT Gandhinagar) Lecture

logo

Copying and Moving

Basic command cp filePath destinationPath.

If destination is a directory cp creates a copy inside the directory.

If destination is a file name, cp creates a copy with that name.

Copying directory cp -r dirPath destinationPath.

Basic command mv sourcePath destinationPath.

Examples:cp Cprog/Prog2.c ../new.ccp Cprog/Prog2.c ../mv Cprog ../newFoldermv Cprog ../Folder2

Bireswar, Shivkumar (IIT Gandhinagar) Lecture 2 Sep 2013 5 / 12

Page 23: Lecture 2: ES 102 Linux Commands · logo-Lecture 2: ES 102 Linux Commands Introduction to Computing IIT Gandhinagar, India Sep, 2013 Bireswar, Shivkumar (IIT Gandhinagar) Lecture

logo

Some Other Commands

rm -iv path remove a file.

rm -riv path remove a directory.

locate name locate a file/directory with the name.

bc -l arbitrary precision calculator.

Some useful tricks in terminal:

1 Press Tab to autocomplete.2 Press Up arrow to get previous commands.3 Select to copy, middle click to paste.

Bireswar, Shivkumar (IIT Gandhinagar) Lecture 2 Sep 2013 6 / 12

Page 24: Lecture 2: ES 102 Linux Commands · logo-Lecture 2: ES 102 Linux Commands Introduction to Computing IIT Gandhinagar, India Sep, 2013 Bireswar, Shivkumar (IIT Gandhinagar) Lecture

logo

Some Other Commands

rm -iv path remove a file.

rm -riv path remove a directory.

locate name locate a file/directory with the name.

bc -l arbitrary precision calculator.

Some useful tricks in terminal:

1 Press Tab to autocomplete.2 Press Up arrow to get previous commands.3 Select to copy, middle click to paste.

Bireswar, Shivkumar (IIT Gandhinagar) Lecture 2 Sep 2013 6 / 12

Page 25: Lecture 2: ES 102 Linux Commands · logo-Lecture 2: ES 102 Linux Commands Introduction to Computing IIT Gandhinagar, India Sep, 2013 Bireswar, Shivkumar (IIT Gandhinagar) Lecture

logo

Some Other Commands

rm -iv path remove a file.

rm -riv path remove a directory.

locate name locate a file/directory with the name.

bc -l arbitrary precision calculator.

Some useful tricks in terminal:

1 Press Tab to autocomplete.2 Press Up arrow to get previous commands.3 Select to copy, middle click to paste.

Bireswar, Shivkumar (IIT Gandhinagar) Lecture 2 Sep 2013 6 / 12

Page 26: Lecture 2: ES 102 Linux Commands · logo-Lecture 2: ES 102 Linux Commands Introduction to Computing IIT Gandhinagar, India Sep, 2013 Bireswar, Shivkumar (IIT Gandhinagar) Lecture

logo

Some Other Commands

rm -iv path remove a file.

rm -riv path remove a directory.

locate name locate a file/directory with the name.

bc -l arbitrary precision calculator.

Some useful tricks in terminal:

1 Press Tab to autocomplete.2 Press Up arrow to get previous commands.3 Select to copy, middle click to paste.

Bireswar, Shivkumar (IIT Gandhinagar) Lecture 2 Sep 2013 6 / 12

Page 27: Lecture 2: ES 102 Linux Commands · logo-Lecture 2: ES 102 Linux Commands Introduction to Computing IIT Gandhinagar, India Sep, 2013 Bireswar, Shivkumar (IIT Gandhinagar) Lecture

logo

Some Other Commands

rm -iv path remove a file.

rm -riv path remove a directory.

locate name locate a file/directory with the name.

bc -l arbitrary precision calculator.

Some useful tricks in terminal:

1 Press Tab to autocomplete.2 Press Up arrow to get previous commands.3 Select to copy, middle click to paste.

Bireswar, Shivkumar (IIT Gandhinagar) Lecture 2 Sep 2013 6 / 12

Page 28: Lecture 2: ES 102 Linux Commands · logo-Lecture 2: ES 102 Linux Commands Introduction to Computing IIT Gandhinagar, India Sep, 2013 Bireswar, Shivkumar (IIT Gandhinagar) Lecture

logo

Some Other Commands

rm -iv path remove a file.

rm -riv path remove a directory.

locate name locate a file/directory with the name.

bc -l arbitrary precision calculator.

Some useful tricks in terminal:1 Press Tab to autocomplete.

2 Press Up arrow to get previous commands.3 Select to copy, middle click to paste.

Bireswar, Shivkumar (IIT Gandhinagar) Lecture 2 Sep 2013 6 / 12

Page 29: Lecture 2: ES 102 Linux Commands · logo-Lecture 2: ES 102 Linux Commands Introduction to Computing IIT Gandhinagar, India Sep, 2013 Bireswar, Shivkumar (IIT Gandhinagar) Lecture

logo

Some Other Commands

rm -iv path remove a file.

rm -riv path remove a directory.

locate name locate a file/directory with the name.

bc -l arbitrary precision calculator.

Some useful tricks in terminal:1 Press Tab to autocomplete.2 Press Up arrow to get previous commands.

3 Select to copy, middle click to paste.

Bireswar, Shivkumar (IIT Gandhinagar) Lecture 2 Sep 2013 6 / 12

Page 30: Lecture 2: ES 102 Linux Commands · logo-Lecture 2: ES 102 Linux Commands Introduction to Computing IIT Gandhinagar, India Sep, 2013 Bireswar, Shivkumar (IIT Gandhinagar) Lecture

logo

Some Other Commands

rm -iv path remove a file.

rm -riv path remove a directory.

locate name locate a file/directory with the name.

bc -l arbitrary precision calculator.

Some useful tricks in terminal:1 Press Tab to autocomplete.2 Press Up arrow to get previous commands.3 Select to copy, middle click to paste.

Bireswar, Shivkumar (IIT Gandhinagar) Lecture 2 Sep 2013 6 / 12

Page 31: Lecture 2: ES 102 Linux Commands · logo-Lecture 2: ES 102 Linux Commands Introduction to Computing IIT Gandhinagar, India Sep, 2013 Bireswar, Shivkumar (IIT Gandhinagar) Lecture

logo

How to know Everything?

man command: Manual.

Example: man ls

Bireswar, Shivkumar (IIT Gandhinagar) Lecture 2 Sep 2013 7 / 12

Page 32: Lecture 2: ES 102 Linux Commands · logo-Lecture 2: ES 102 Linux Commands Introduction to Computing IIT Gandhinagar, India Sep, 2013 Bireswar, Shivkumar (IIT Gandhinagar) Lecture

logo

How to know Everything?

man command: Manual.

Example: man ls

Bireswar, Shivkumar (IIT Gandhinagar) Lecture 2 Sep 2013 7 / 12

Page 33: Lecture 2: ES 102 Linux Commands · logo-Lecture 2: ES 102 Linux Commands Introduction to Computing IIT Gandhinagar, India Sep, 2013 Bireswar, Shivkumar (IIT Gandhinagar) Lecture

logo

How to know Everything?

man command: Manual.

Example: man ls

Bireswar, Shivkumar (IIT Gandhinagar) Lecture 2 Sep 2013 7 / 12

Page 34: Lecture 2: ES 102 Linux Commands · logo-Lecture 2: ES 102 Linux Commands Introduction to Computing IIT Gandhinagar, India Sep, 2013 Bireswar, Shivkumar (IIT Gandhinagar) Lecture

logo

The * Wildcard

Create empty files test, test123, newtest123, abc, abcfoo, xyzCommand to create file without using editor: touch filename

The star wildcard (*) matches with any string of character.

It also matches with the empty string.

Example ls test, ls *test, ls *test*, ls *abc*

Bireswar, Shivkumar (IIT Gandhinagar) Lecture 2 Sep 2013 8 / 12

Page 35: Lecture 2: ES 102 Linux Commands · logo-Lecture 2: ES 102 Linux Commands Introduction to Computing IIT Gandhinagar, India Sep, 2013 Bireswar, Shivkumar (IIT Gandhinagar) Lecture

logo

The * Wildcard

Create empty files test, test123, newtest123, abc, abcfoo, xyzCommand to create file without using editor: touch filename

The star wildcard (*) matches with any string of character.

It also matches with the empty string.

Example ls test, ls *test, ls *test*, ls *abc*

Bireswar, Shivkumar (IIT Gandhinagar) Lecture 2 Sep 2013 8 / 12

Page 36: Lecture 2: ES 102 Linux Commands · logo-Lecture 2: ES 102 Linux Commands Introduction to Computing IIT Gandhinagar, India Sep, 2013 Bireswar, Shivkumar (IIT Gandhinagar) Lecture

logo

The * Wildcard

Create empty files test, test123, newtest123, abc, abcfoo, xyzCommand to create file without using editor: touch filename

The star wildcard (*) matches with any string of character.

It also matches with the empty string.

Example ls test, ls *test, ls *test*, ls *abc*

Bireswar, Shivkumar (IIT Gandhinagar) Lecture 2 Sep 2013 8 / 12

Page 37: Lecture 2: ES 102 Linux Commands · logo-Lecture 2: ES 102 Linux Commands Introduction to Computing IIT Gandhinagar, India Sep, 2013 Bireswar, Shivkumar (IIT Gandhinagar) Lecture

logo

The * Wildcard

Create empty files test, test123, newtest123, abc, abcfoo, xyzCommand to create file without using editor: touch filename

The star wildcard (*) matches with any string of character.

It also matches with the empty string.

Example ls test, ls *test, ls *test*, ls *abc*

Bireswar, Shivkumar (IIT Gandhinagar) Lecture 2 Sep 2013 8 / 12

Page 38: Lecture 2: ES 102 Linux Commands · logo-Lecture 2: ES 102 Linux Commands Introduction to Computing IIT Gandhinagar, India Sep, 2013 Bireswar, Shivkumar (IIT Gandhinagar) Lecture

logo

Editors

Vim (or vi) : A command based, rich text editor.. Many people workwith it at lightning speed.

Emacs: A classic editor. Generations of linux geeks love this

gedit: Ubuntu default editor .. Easy to use text editor with thousandsof useful features.

Bireswar, Shivkumar (IIT Gandhinagar) Lecture 2 Sep 2013 9 / 12

Page 39: Lecture 2: ES 102 Linux Commands · logo-Lecture 2: ES 102 Linux Commands Introduction to Computing IIT Gandhinagar, India Sep, 2013 Bireswar, Shivkumar (IIT Gandhinagar) Lecture

logo

Finding a File

locate cannot find newly created files/directories.

Command find FromwhereToStart -name “filename” -print

Example find ∼ -name “test” -print, find ∼ -name “abc”

filename can be specified with the help of *

Example find /home/ -name “test*” -print, find ../ -name “*test*”-print

Bireswar, Shivkumar (IIT Gandhinagar) Lecture 2 Sep 2013 10 / 12

Page 40: Lecture 2: ES 102 Linux Commands · logo-Lecture 2: ES 102 Linux Commands Introduction to Computing IIT Gandhinagar, India Sep, 2013 Bireswar, Shivkumar (IIT Gandhinagar) Lecture

logo

Finding a File

locate cannot find newly created files/directories.

Command find FromwhereToStart -name “filename” -print

Example find ∼ -name “test” -print, find ∼ -name “abc”

filename can be specified with the help of *

Example find /home/ -name “test*” -print, find ../ -name “*test*”-print

Bireswar, Shivkumar (IIT Gandhinagar) Lecture 2 Sep 2013 10 / 12

Page 41: Lecture 2: ES 102 Linux Commands · logo-Lecture 2: ES 102 Linux Commands Introduction to Computing IIT Gandhinagar, India Sep, 2013 Bireswar, Shivkumar (IIT Gandhinagar) Lecture

logo

Finding a File

locate cannot find newly created files/directories.

Command find FromwhereToStart -name “filename” -print

Example find ∼ -name “test” -print, find ∼ -name “abc”

filename can be specified with the help of *

Example find /home/ -name “test*” -print, find ../ -name “*test*”-print

Bireswar, Shivkumar (IIT Gandhinagar) Lecture 2 Sep 2013 10 / 12

Page 42: Lecture 2: ES 102 Linux Commands · logo-Lecture 2: ES 102 Linux Commands Introduction to Computing IIT Gandhinagar, India Sep, 2013 Bireswar, Shivkumar (IIT Gandhinagar) Lecture

logo

Finding a File

locate cannot find newly created files/directories.

Command find FromwhereToStart -name “filename” -print

Example find ∼ -name “test” -print, find ∼ -name “abc”

filename can be specified with the help of *

Example find /home/ -name “test*” -print, find ../ -name “*test*”-print

Bireswar, Shivkumar (IIT Gandhinagar) Lecture 2 Sep 2013 10 / 12

Page 43: Lecture 2: ES 102 Linux Commands · logo-Lecture 2: ES 102 Linux Commands Introduction to Computing IIT Gandhinagar, India Sep, 2013 Bireswar, Shivkumar (IIT Gandhinagar) Lecture

logo

Finding a File

locate cannot find newly created files/directories.

Command find FromwhereToStart -name “filename” -print

Example find ∼ -name “test” -print, find ∼ -name “abc”

filename can be specified with the help of *

Example find /home/ -name “test*” -print, find ../ -name “*test*”-print

Bireswar, Shivkumar (IIT Gandhinagar) Lecture 2 Sep 2013 10 / 12

Page 44: Lecture 2: ES 102 Linux Commands · logo-Lecture 2: ES 102 Linux Commands Introduction to Computing IIT Gandhinagar, India Sep, 2013 Bireswar, Shivkumar (IIT Gandhinagar) Lecture

logo

Some more commands

Listing detailed information ls -la

Listing the running tasks top

Listing the running tasks top

To find time taken by a command/program time command

Bireswar, Shivkumar (IIT Gandhinagar) Lecture 2 Sep 2013 11 / 12

Page 45: Lecture 2: ES 102 Linux Commands · logo-Lecture 2: ES 102 Linux Commands Introduction to Computing IIT Gandhinagar, India Sep, 2013 Bireswar, Shivkumar (IIT Gandhinagar) Lecture

logo

Some more commands

Listing detailed information ls -la

Listing the running tasks top

Listing the running tasks top

To find time taken by a command/program time command

Bireswar, Shivkumar (IIT Gandhinagar) Lecture 2 Sep 2013 11 / 12

Page 46: Lecture 2: ES 102 Linux Commands · logo-Lecture 2: ES 102 Linux Commands Introduction to Computing IIT Gandhinagar, India Sep, 2013 Bireswar, Shivkumar (IIT Gandhinagar) Lecture

logo

Some more commands

Listing detailed information ls -la

Listing the running tasks top

Listing the running tasks top

To find time taken by a command/program time command

Bireswar, Shivkumar (IIT Gandhinagar) Lecture 2 Sep 2013 11 / 12

Page 47: Lecture 2: ES 102 Linux Commands · logo-Lecture 2: ES 102 Linux Commands Introduction to Computing IIT Gandhinagar, India Sep, 2013 Bireswar, Shivkumar (IIT Gandhinagar) Lecture

logo

Some more commands

Listing detailed information ls -la

Listing the running tasks top

Listing the running tasks top

To find time taken by a command/program time command

Bireswar, Shivkumar (IIT Gandhinagar) Lecture 2 Sep 2013 11 / 12

Page 48: Lecture 2: ES 102 Linux Commands · logo-Lecture 2: ES 102 Linux Commands Introduction to Computing IIT Gandhinagar, India Sep, 2013 Bireswar, Shivkumar (IIT Gandhinagar) Lecture

logo

Thousands of Free Applications

Open office or Libre office :Reading all document files ( Word,Excel,Powerpoint equivalent)

Hundreds of editors: Kile (Latex), Spyder (Python) etc..

Mathtools : octave (matlab), Scilab, geogebra,

Plotting: Gnuplot, Xmgrace, ..

Photo editing gimp , video editing , sound editing ..

Installing applications in Ubuntu: sudo apt-get install APPLICATIONNAME

Bireswar, Shivkumar (IIT Gandhinagar) Lecture 2 Sep 2013 12 / 12

Page 49: Lecture 2: ES 102 Linux Commands · logo-Lecture 2: ES 102 Linux Commands Introduction to Computing IIT Gandhinagar, India Sep, 2013 Bireswar, Shivkumar (IIT Gandhinagar) Lecture

logo

Thousands of Free Applications

Open office or Libre office :Reading all document files ( Word,Excel,Powerpoint equivalent)

Hundreds of editors: Kile (Latex), Spyder (Python) etc..

Mathtools : octave (matlab), Scilab, geogebra,

Plotting: Gnuplot, Xmgrace, ..

Photo editing gimp , video editing , sound editing ..

Installing applications in Ubuntu: sudo apt-get install APPLICATIONNAME

Bireswar, Shivkumar (IIT Gandhinagar) Lecture 2 Sep 2013 12 / 12

Page 50: Lecture 2: ES 102 Linux Commands · logo-Lecture 2: ES 102 Linux Commands Introduction to Computing IIT Gandhinagar, India Sep, 2013 Bireswar, Shivkumar (IIT Gandhinagar) Lecture

logo

Thousands of Free Applications

Open office or Libre office :Reading all document files ( Word,Excel,Powerpoint equivalent)

Hundreds of editors: Kile (Latex), Spyder (Python) etc..

Mathtools : octave (matlab), Scilab, geogebra,

Plotting: Gnuplot, Xmgrace, ..

Photo editing gimp , video editing , sound editing ..

Installing applications in Ubuntu: sudo apt-get install APPLICATIONNAME

Bireswar, Shivkumar (IIT Gandhinagar) Lecture 2 Sep 2013 12 / 12

Page 51: Lecture 2: ES 102 Linux Commands · logo-Lecture 2: ES 102 Linux Commands Introduction to Computing IIT Gandhinagar, India Sep, 2013 Bireswar, Shivkumar (IIT Gandhinagar) Lecture

logo

Thousands of Free Applications

Open office or Libre office :Reading all document files ( Word,Excel,Powerpoint equivalent)

Hundreds of editors: Kile (Latex), Spyder (Python) etc..

Mathtools : octave (matlab), Scilab, geogebra,

Plotting: Gnuplot, Xmgrace, ..

Photo editing gimp , video editing , sound editing ..

Installing applications in Ubuntu: sudo apt-get install APPLICATIONNAME

Bireswar, Shivkumar (IIT Gandhinagar) Lecture 2 Sep 2013 12 / 12

Page 52: Lecture 2: ES 102 Linux Commands · logo-Lecture 2: ES 102 Linux Commands Introduction to Computing IIT Gandhinagar, India Sep, 2013 Bireswar, Shivkumar (IIT Gandhinagar) Lecture

logo

Thousands of Free Applications

Open office or Libre office :Reading all document files ( Word,Excel,Powerpoint equivalent)

Hundreds of editors: Kile (Latex), Spyder (Python) etc..

Mathtools : octave (matlab), Scilab, geogebra,

Plotting: Gnuplot, Xmgrace, ..

Photo editing gimp , video editing , sound editing ..

Installing applications in Ubuntu: sudo apt-get install APPLICATIONNAME

Bireswar, Shivkumar (IIT Gandhinagar) Lecture 2 Sep 2013 12 / 12