16
EMT 2390L Lecture 3 Dr. Reyes Reference: The Linux Command Line, W.E. Shotts

EMT 2390L Lecture 3 Dr. Reyes Reference: The Linux Command Line, W.E. Shotts

Embed Size (px)

DESCRIPTION

Wildcards Wildcards - allows you to select filenames based on patterns of characters.

Citation preview

Page 1: EMT 2390L Lecture 3 Dr. Reyes Reference: The Linux Command Line, W.E. Shotts

EMT 2390LLecture 3

Dr. ReyesReference: The Linux Command Line, W.E. Shotts

Page 2: EMT 2390L Lecture 3 Dr. Reyes Reference: The Linux Command Line, W.E. Shotts

Outline• Wildcards• Commands• Aliases

Page 3: EMT 2390L Lecture 3 Dr. Reyes Reference: The Linux Command Line, W.E. Shotts

Wildcards• Wildcards - allows you to select filenames based

on patterns of characters.

Page 4: EMT 2390L Lecture 3 Dr. Reyes Reference: The Linux Command Line, W.E. Shotts

Character Classes

Page 5: EMT 2390L Lecture 3 Dr. Reyes Reference: The Linux Command Line, W.E. Shotts

Wildcards examples

Page 6: EMT 2390L Lecture 3 Dr. Reyes Reference: The Linux Command Line, W.E. Shotts

mkdir Command• mkdir – creates a directory

o mkdir dir_nameo mkdir dir1, dir2, … , dirN

Page 7: EMT 2390L Lecture 3 Dr. Reyes Reference: The Linux Command Line, W.E. Shotts

cp Command• cp – copies a file or directory

Page 8: EMT 2390L Lecture 3 Dr. Reyes Reference: The Linux Command Line, W.E. Shotts

cp examples

Page 9: EMT 2390L Lecture 3 Dr. Reyes Reference: The Linux Command Line, W.E. Shotts

mv Command• mv - performs file moving or file renaming

Page 10: EMT 2390L Lecture 3 Dr. Reyes Reference: The Linux Command Line, W.E. Shotts

mv Examples

Page 11: EMT 2390L Lecture 3 Dr. Reyes Reference: The Linux Command Line, W.E. Shotts

rm Command• rm - used to remove files and directories

Page 12: EMT 2390L Lecture 3 Dr. Reyes Reference: The Linux Command Line, W.E. Shotts

rm Examples

Page 13: EMT 2390L Lecture 3 Dr. Reyes Reference: The Linux Command Line, W.E. Shotts

ln Command• ln - used to create either hard or symbolic links

o Hard Links - ln file linko Symbolic Link - ln -s item link

• Hard Links - The original Unix way of creating links. It cannot reference a file outside its own filesystem and cannot reference a directory.

• Symbolic Links - creates a special file with a pointer to the referenced file or directory, similar to a shortcut in Windows.

Page 14: EMT 2390L Lecture 3 Dr. Reyes Reference: The Linux Command Line, W.E. Shotts

More commands• type – given a command name it will display the

command the shell will executeo type cd

• which – to find the location of a particular executableo which cd

• help – display information about a commando help cd

• man – displays the manual of a commando man cd

• apropos – displays appropriate commandso apropos cd

Page 15: EMT 2390L Lecture 3 Dr. Reyes Reference: The Linux Command Line, W.E. Shotts

More Commands• whatis - displays the name and a one-line

description of a man page matching a specified keywordo whatis bash

• info – an alternative to man pageso info cd

• alias – to create your own composite commandso Usage: alias name=‘command1; command2; … ; commandN'o e.g. alias foo='cd /usr; ls; cd -‘

Page 16: EMT 2390L Lecture 3 Dr. Reyes Reference: The Linux Command Line, W.E. Shotts

Assignments• Check the class OpenLab site for new Labs• Check Blackboard for new Quizzes