Advanced Directory and File Management - PowerPoint PPT Presentation

1 / 13
About This Presentation
Title:

Advanced Directory and File Management

Description:

as with rm command, -i option prompts you to overwrite an existing file ... i option prompts you if you are about to overwrite an existing file ... – PowerPoint PPT presentation

Number of Views:13
Avg rating:3.0/5.0
Slides: 14
Provided by: mgie
Learn more at: http://faculty.ccri.edu
Category:

less

Transcript and Presenter's Notes

Title: Advanced Directory and File Management


1
Chapter 7 Advanced Directory and File Management
2
Copying Files
cp (copy) - copies files and directories new file
created with a different name in the same
directory files copied to a different directory
location (local or remote) or disk as with rm
command, -i option prompts you to overwrite an
existing file can be used with metacharacters (
?) to copy multiple files at once
3
Copying Directories
cp r (recursive) - copies a directory and all of
its contents must use -r option to copy a
directory example 1 - new directory created with
a different name in the same directory example 2
- directory copied to a different directory
location
4
Multipurpose mv Command
mv (move) - moves or renames files and
directories move a file to a directory if the
last argument is a directory if not, will rename
the file (cp command copies a file and gives it a
new name leaving the original file intact) -i
option prompts you if you are about to overwrite
an existing file mv a file within the same
directory renames it lsbeans nuts mv nuts
brands lsbeans brands mv a file to another
directory moves it and renames it if specified
mv brands /testdir/newname ls /testdirnewname
5
Input / Output Redirection Commands
right angle bracket (gt) output redirection -
creates a new file or overwrites existing Two
right angle brackets (gtgt) appends the output to
the specified file left angle bracket (lt) input
redirection right angle bracket preceded by the
number two (2gt) error redirection file can be a
text file or a device file Command Redirection
Symbol File (text file or device file)
6
Command Piping
One of the most powerful metacharacters is the
pipe () standard output of one command and
passes it as standard input into a following
command must always have a command on each side
of a pipe redirect takes a command to a file
pipe takes a command to a command for an
administrator to see the users in his system, he
would type cat /etc/password more
7
CDE File Manager
advanced capabilities for manipulating files and
folders moving (select drag drop) and
copying (control select drag drop) Selected
menu files and folders pre-selected to be
copied, moved, renamed or put in Trash change
file and directory permissions using properties
option View menu can customize file and folder
displays, including file system as a tree
8
Labs/Assessment
Lab 7.1.2 - Copying Files and Directories Lab
7.1.4 Renaming and Moving Files and
Directories Lab 7.1.6 - Redirection and Command
Piping Lab 7.2.3 Advanced CDE File
Manager chapter 7 assessment
9
mv Exercise
mv ??abc ../..
10
mv Exercise
mv ??abc ../.. move any file with only
three characters in the name, anything in the
first two character positions, a or b or c in the
third position, up two directory levels
11
Piping Redirection Exercise
ls -al head gt myfiles
12
Piping Redirection Exercise
ls -al head gt myfiles take the top ten
files listed and put it in a file called myfiles
13
(No Transcript)
Write a Comment
User Comments (0)
About PowerShow.com