SlideShare a Scribd company logo
Lesson 11-Locating, Printing, and Archiving User Files
Overview  Creating a long file. Splitting long files. Locating files with find. Printing a file. Archiving files.
Creating a Long File  The “ls –R ~” command is used to list all the files contained in the user’s home directory. The “cut –c range of characters ~/file name” command is used to read a particular number of characters from each line in a file. The “cat –n file name” command is used to add numbers to the left of all lines in a copy of the file.
Splitting Long Files  The “split” utility is used to read a long file and break up the contents into a series of small files of specified size. Each small file has an extension starting with “aa” and going through the alphabet as far as needed to hold a copy of the whole file.
Splitting Long Files  Splitting Long Files into Pieces
Splitting Long Files  Reassembling the files: The “cat filename*” command is used to read all the small files and output data that matches the original long file. The last part of the file names, such as “aa”, “ab”, etc., is in ASCII order. The ASCII order is used by the shell for the filenames when it replaces the * in the command line.
Locating File with Find  The “find” utility is used to locate a particular file in several directories. The find utility displays the output and any error message that is appropriate. The pathnames of files and information about directories that cannot be examined because of their assigned permissions are also displayed by the find utility.
Locating File with Find  The command to be given is “find ~ -name filename –print”. The “~” specifies the target starting point directory. The “–print” specifies that the full pathname of each occurrence of the file(s) matching the selection criterion should be output to the screen.
Locating File with Find  Locating files by owner. Locating and acting on files by owner. Locating additional options. Acting on all files in a directory tree.
Locating Files by Owner  The “ls –ld /directory name/$USER” command is used to determine if the user has a directory with the same name as the login name in a particular directory. The “find” utility can also be used to identify files owned by a particular user. The output of the find utility can be redirected to a file or a printer.
Locating Files by Owner  Command Line Interpretation find Utility
Locating and Acting on Files by  Owner  The find utility can also be used to remove located files, change file permissions, or employ any shell file-manipulation command. The “-exec” option is used with the utility to execute any command utilizing the file names that are selected.
Locating and Acting on Files by  Owner  Using the find Utility to Locate Files by Owner
Locating Additional Options  Additional Options
Acting on all Files in a Directory  Tree  The find utility can be used as an agent to go through the directory tree recursively and execute another utility on all files. The utility shows a user to search through the specified directory trees, based on a variety of criteria, and perform actions on the located files.
Printing a File  Printing the output of a pipeline. Printing multiple copies. Adding a title line to the banner page. Checking the status of print jobs. Canceling a print request.
Printing the Output of a Pipeline  A pipe can be used to connect the output of a utility as an input to the print utility. The “col –bx” and the “colcrt” utilities are used to remove control characters that are of value to the terminal.
Printing Multiple Copies  Any of the following commands can be used to print multiple copies of a file: lp –n (number of copies to be printed in numeric value) file name. lpr -# (number of copies to be printed in numeric value) file name.
Adding a Title Line to the Banner  Page  A banner page, also called the burst page, contains information about the printer and the user issuing the print request. The “lp –t‘numbers file’ file name” or the “lpr –Pprinter –J’numbers file’ file name” command can be used to add a title and print the file.
Adding a Title Line to the Banner  Page  The “lp –dprinter –ttitle filename” or the “lpr –Pprinter –J’title’ filename” are the two formats of the print commands.
Checking the Status of Print Jobs  All print requests are administered by a spooler. A spooler is a program that receives print requests from multiple users and sends jobs one at a time to the printer. The spooler makes it possible for the system to process simultaneous print job requests for several users. The “lpstat” or the “lpq –Pprinter username” command can be use to examine the queue.
Canceling a Print Request  The “cancel” or the “lprm” command can be used to remove jobs from the queue. On a Linux system, all printing jobs owned by the user are removed from the queue. On a UNIX system, the “–u” option is used to indicate jobs owned by the user.
Archiving Files  Archiving files on floppy disks. Creating archives with tar.
Archiving Files on Floppy Disks  Copying a file to and from a floppy: Mtools is a set of programs that facilitate the copying of files to a floppy drive without going through the process of mounting the drive. The “mcopy” command is used to copy a file to and from a floppy. The command requires two arguments the file name from the current directory, and a:, which is an agreed name for the floppy.
Archiving Files on Floppy Disks  Copying a file to and from a floppy (continued): Multiple files can be copied by using the * sign in place of a particular filename. Attributes such as permissions are not included in the copy. When a file is copied from a floppy, the permissions for the newly copied file may not match its original permissions. When the mcopy command creates a new file on the system, the default permissions for the new file are applied.
Archiving Files on Floppy Disks  Removing files and directories from a floppy: The “mdel” command is used to delete files. The mdel command requires an argument, the name of the file(s) to be deleted. The “mdeltree” command is used to delete directories. This command requires one argument, the name of the directory to be deleted.
Archiving Files on Floppy Disks  Formatting a floppy disk: The “mformat” command is used to format a floppy. The floppy is formatted in the DOS format.
Creating Archives with tar  The “tar” (tape archiving) utility is used extensively for making archive files on most systems. The utility can be used to create a single file, called archive, which contains the files in a directory tree and all information about each file.
Creating Archives with tar  The command used to create a tar archive is “tar –cvf filename.tar”. The command instructs tar to create an archive in verbose mode and use a file to hold the archive. The dot (.) is the source directory, from which all files are archived. The “tar –tf filename” can be used to list the contents of the tar archive.
Creating Archives with tar  Extracting files from an archive: The extension “.tar” is called a “tarball”. A tarball can be moved, mailed, or placed on portable media. The “tar –xvf filename.tar” is used to extract the directory tree from the archive. The command provides instructions to extract the structure from the archive in verbose mode, from a file.
Summary  The split utility is used to break the contents of a long file into a series of small files. The lp and the lpr utilities manage files directed to the printer. The find utility searches through a directory tree for files based on specific criteria, and then takes action on each identified file.
Summary  The mtools utility facilitates the copying of files to and from a floppy drive using a DOS-formatted floppy. The tar utility is used to make an archive of a directory tree or a file. The archive can be stored on permanent media, sent to a remote machine, or just used to move a structure from one location in a system to another.
Ad

Recommended

intro unix/linux 07
intro unix/linux 07
duquoi
 
intro unix/linux 09
intro unix/linux 09
duquoi
 
intro unix/linux 08
intro unix/linux 08
duquoi
 
intro unix/linux 02
intro unix/linux 02
duquoi
 
intro unix/linux 06
intro unix/linux 06
duquoi
 
intro unix/linux 05
intro unix/linux 05
duquoi
 
intro unix/linux 10
intro unix/linux 10
duquoi
 
intro unix/linux 04
intro unix/linux 04
duquoi
 
Unix command line concepts
Unix command line concepts
Artem Nagornyi
 
intro unix/linux 03
intro unix/linux 03
duquoi
 
Linux ppt
Linux ppt
Sanmuga Nathan
 
VTU 3RD SEM UNIX AND SHELL PROGRAMMING SOLVED PAPERS
VTU 3RD SEM UNIX AND SHELL PROGRAMMING SOLVED PAPERS
vtunotesbysree
 
Karkha unix shell scritping
Karkha unix shell scritping
chockit88
 
Command
Command
somoloye
 
Unix
Unix
Thesis Scientist Private Limited
 
Unix commands in etl testing
Unix commands in etl testing
Garuda Trainings
 
Files nts
Files nts
kalyani66
 
Windows command prompt a to z
Windows command prompt a to z
Subuh Kurniawan
 
An a z index of the bash commands
An a z index of the bash commands
Ben Pope
 
Lession1 Linux Preview
Lession1 Linux Preview
leminhvuong
 
Unix Basics For Testers
Unix Basics For Testers
nitin lakhanpal
 
Tool Development 08 - Windows Command Prompt
Tool Development 08 - Windows Command Prompt
Nick Pruehs
 
101 2.3 manage shared libraries
101 2.3 manage shared libraries
Acácio Oliveira
 
Course 102: Lecture 12: Basic Text Handling
Course 102: Lecture 12: Basic Text Handling
Ahmed El-Arabawy
 
Basic unix commands_1
Basic unix commands_1
thakor bharati
 
Course 102: Lecture 3: Basic Concepts And Commands
Course 102: Lecture 3: Basic Concepts And Commands
Ahmed El-Arabawy
 
Linux Introduction (Commands)
Linux Introduction (Commands)
anandvaidya
 
Directories description
Directories description
Dr.M.Karthika parthasarathy
 
MCLS 45 Lab Manual
MCLS 45 Lab Manual
Lokesh Singrol
 
Linux Cheat Sheet.pdf
Linux Cheat Sheet.pdf
roschahacker
 

More Related Content

What's hot (19)

Unix command line concepts
Unix command line concepts
Artem Nagornyi
 
intro unix/linux 03
intro unix/linux 03
duquoi
 
Linux ppt
Linux ppt
Sanmuga Nathan
 
VTU 3RD SEM UNIX AND SHELL PROGRAMMING SOLVED PAPERS
VTU 3RD SEM UNIX AND SHELL PROGRAMMING SOLVED PAPERS
vtunotesbysree
 
Karkha unix shell scritping
Karkha unix shell scritping
chockit88
 
Command
Command
somoloye
 
Unix
Unix
Thesis Scientist Private Limited
 
Unix commands in etl testing
Unix commands in etl testing
Garuda Trainings
 
Files nts
Files nts
kalyani66
 
Windows command prompt a to z
Windows command prompt a to z
Subuh Kurniawan
 
An a z index of the bash commands
An a z index of the bash commands
Ben Pope
 
Lession1 Linux Preview
Lession1 Linux Preview
leminhvuong
 
Unix Basics For Testers
Unix Basics For Testers
nitin lakhanpal
 
Tool Development 08 - Windows Command Prompt
Tool Development 08 - Windows Command Prompt
Nick Pruehs
 
101 2.3 manage shared libraries
101 2.3 manage shared libraries
Acácio Oliveira
 
Course 102: Lecture 12: Basic Text Handling
Course 102: Lecture 12: Basic Text Handling
Ahmed El-Arabawy
 
Basic unix commands_1
Basic unix commands_1
thakor bharati
 
Course 102: Lecture 3: Basic Concepts And Commands
Course 102: Lecture 3: Basic Concepts And Commands
Ahmed El-Arabawy
 
Linux Introduction (Commands)
Linux Introduction (Commands)
anandvaidya
 
Unix command line concepts
Unix command line concepts
Artem Nagornyi
 
intro unix/linux 03
intro unix/linux 03
duquoi
 
VTU 3RD SEM UNIX AND SHELL PROGRAMMING SOLVED PAPERS
VTU 3RD SEM UNIX AND SHELL PROGRAMMING SOLVED PAPERS
vtunotesbysree
 
Karkha unix shell scritping
Karkha unix shell scritping
chockit88
 
Unix commands in etl testing
Unix commands in etl testing
Garuda Trainings
 
Windows command prompt a to z
Windows command prompt a to z
Subuh Kurniawan
 
An a z index of the bash commands
An a z index of the bash commands
Ben Pope
 
Lession1 Linux Preview
Lession1 Linux Preview
leminhvuong
 
Tool Development 08 - Windows Command Prompt
Tool Development 08 - Windows Command Prompt
Nick Pruehs
 
101 2.3 manage shared libraries
101 2.3 manage shared libraries
Acácio Oliveira
 
Course 102: Lecture 12: Basic Text Handling
Course 102: Lecture 12: Basic Text Handling
Ahmed El-Arabawy
 
Course 102: Lecture 3: Basic Concepts And Commands
Course 102: Lecture 3: Basic Concepts And Commands
Ahmed El-Arabawy
 
Linux Introduction (Commands)
Linux Introduction (Commands)
anandvaidya
 

Similar to intro unix/linux 11 (20)

Directories description
Directories description
Dr.M.Karthika parthasarathy
 
MCLS 45 Lab Manual
MCLS 45 Lab Manual
Lokesh Singrol
 
Linux Cheat Sheet.pdf
Linux Cheat Sheet.pdf
roschahacker
 
Linux presentation
Linux presentation
Nikhil Jain
 
commands and_ in _shell presentation.ppt
commands and_ in _shell presentation.ppt
Serah48
 
Linux file commands and shell scripts
Linux file commands and shell scripts
PrashantTechment
 
Linux 4 you
Linux 4 you
Shashwat Shriparv
 
linux-lecture4.ppt
linux-lecture4.ppt
LuigysToro
 
8.1.intro unix
8.1.intro unix
southees
 
Linux commands and file structure
Linux commands and file structure
Sreenatha Reddy K R
 
Linux System commands Essentialsand Basics.pptx
Linux System commands Essentialsand Basics.pptx
mba1130feb2024
 
Unix/Linux Basic Commands and Shell Script
Unix/Linux Basic Commands and Shell Script
sbmguys
 
Rishav Mishra final presentation on UNIX Final.pptx
Rishav Mishra final presentation on UNIX Final.pptx
rishavmishra041
 
linux-lecture4.pptuyhbjhbiibihbiuhbbihbi
linux-lecture4.pptuyhbjhbiibihbiuhbbihbi
YajnadattaPattanayak
 
Assignment OS LAB 2022
Assignment OS LAB 2022
INFOTAINMENTCHANNEL1
 
Unix Linux Commands Presentation 2013
Unix Linux Commands Presentation 2013
Wave Digitech
 
2ab. UNIX files.ppt JSS science and technology university
2ab. UNIX files.ppt JSS science and technology university
tempemailtemp19
 
Unix / Linux Operating System introduction.
Unix / Linux Operating System introduction.
poongothai11
 
various shell commands in unix operating system.pptx
various shell commands in unix operating system.pptx
ssuserc26f8f
 
18 LINUX OS.pptx Linux command is basic isma
18 LINUX OS.pptx Linux command is basic isma
perweeng31
 
Linux Cheat Sheet.pdf
Linux Cheat Sheet.pdf
roschahacker
 
Linux presentation
Linux presentation
Nikhil Jain
 
commands and_ in _shell presentation.ppt
commands and_ in _shell presentation.ppt
Serah48
 
Linux file commands and shell scripts
Linux file commands and shell scripts
PrashantTechment
 
linux-lecture4.ppt
linux-lecture4.ppt
LuigysToro
 
8.1.intro unix
8.1.intro unix
southees
 
Linux commands and file structure
Linux commands and file structure
Sreenatha Reddy K R
 
Linux System commands Essentialsand Basics.pptx
Linux System commands Essentialsand Basics.pptx
mba1130feb2024
 
Unix/Linux Basic Commands and Shell Script
Unix/Linux Basic Commands and Shell Script
sbmguys
 
Rishav Mishra final presentation on UNIX Final.pptx
Rishav Mishra final presentation on UNIX Final.pptx
rishavmishra041
 
linux-lecture4.pptuyhbjhbiibihbiuhbbihbi
linux-lecture4.pptuyhbjhbiibihbiuhbbihbi
YajnadattaPattanayak
 
Unix Linux Commands Presentation 2013
Unix Linux Commands Presentation 2013
Wave Digitech
 
2ab. UNIX files.ppt JSS science and technology university
2ab. UNIX files.ppt JSS science and technology university
tempemailtemp19
 
Unix / Linux Operating System introduction.
Unix / Linux Operating System introduction.
poongothai11
 
various shell commands in unix operating system.pptx
various shell commands in unix operating system.pptx
ssuserc26f8f
 
18 LINUX OS.pptx Linux command is basic isma
18 LINUX OS.pptx Linux command is basic isma
perweeng31
 
Ad

More from duquoi (9)

Troubleshooting CD Burning
Troubleshooting CD Burning
duquoi
 
Advanced Bash Scripting Guide 2002
Advanced Bash Scripting Guide 2002
duquoi
 
Astrolog: Switches
Astrolog: Switches
duquoi
 
Cinelerra Video Editing Manual
Cinelerra Video Editing Manual
duquoi
 
Iptables
Iptables
duquoi
 
Ffmpeg
Ffmpeg
duquoi
 
rosegarden
rosegarden
duquoi
 
intro unix/linux 12
intro unix/linux 12
duquoi
 
intro unix/linux 01
intro unix/linux 01
duquoi
 
Troubleshooting CD Burning
Troubleshooting CD Burning
duquoi
 
Advanced Bash Scripting Guide 2002
Advanced Bash Scripting Guide 2002
duquoi
 
Astrolog: Switches
Astrolog: Switches
duquoi
 
Cinelerra Video Editing Manual
Cinelerra Video Editing Manual
duquoi
 
Iptables
Iptables
duquoi
 
Ffmpeg
Ffmpeg
duquoi
 
rosegarden
rosegarden
duquoi
 
intro unix/linux 12
intro unix/linux 12
duquoi
 
intro unix/linux 01
intro unix/linux 01
duquoi
 
Ad

Recently uploaded (20)

FIDO Seminar: Evolving Landscape of Post-Quantum Cryptography.pptx
FIDO Seminar: Evolving Landscape of Post-Quantum Cryptography.pptx
FIDO Alliance
 
The State of Web3 Industry- Industry Report
The State of Web3 Industry- Industry Report
Liveplex
 
OWASP Barcelona 2025 Threat Model Library
OWASP Barcelona 2025 Threat Model Library
PetraVukmirovic
 
Providing an OGC API Processes REST Interface for FME Flow
Providing an OGC API Processes REST Interface for FME Flow
Safe Software
 
Reducing Conflicts and Increasing Safety Along the Cycling Networks of East-F...
Reducing Conflicts and Increasing Safety Along the Cycling Networks of East-F...
Safe Software
 
Security Tips for Enterprise Azure Solutions
Security Tips for Enterprise Azure Solutions
Michele Leroux Bustamante
 
Artificial Intelligence in the Nonprofit Boardroom.pdf
Artificial Intelligence in the Nonprofit Boardroom.pdf
OnBoard
 
vertical-cnc-processing-centers-drillteq-v-200-en.pdf
vertical-cnc-processing-centers-drillteq-v-200-en.pdf
AmirStern2
 
ENERGY CONSUMPTION CALCULATION IN ENERGY-EFFICIENT AIR CONDITIONER.pdf
ENERGY CONSUMPTION CALCULATION IN ENERGY-EFFICIENT AIR CONDITIONER.pdf
Muhammad Rizwan Akram
 
“From Enterprise to Makers: Driving Vision AI Innovation at the Extreme Edge,...
“From Enterprise to Makers: Driving Vision AI Innovation at the Extreme Edge,...
Edge AI and Vision Alliance
 
Data Validation and System Interoperability
Data Validation and System Interoperability
Safe Software
 
Integration of Utility Data into 3D BIM Models Using a 3D Solids Modeling Wor...
Integration of Utility Data into 3D BIM Models Using a 3D Solids Modeling Wor...
Safe Software
 
High Availability On-Premises FME Flow.pdf
High Availability On-Premises FME Flow.pdf
Safe Software
 
Can We Use Rust to Develop Extensions for PostgreSQL? (POSETTE: An Event for ...
Can We Use Rust to Develop Extensions for PostgreSQL? (POSETTE: An Event for ...
NTT DATA Technology & Innovation
 
Kubernetes Security Act Now Before It’s Too Late
Kubernetes Security Act Now Before It’s Too Late
Michael Furman
 
AI vs Human Writing: Can You Tell the Difference?
AI vs Human Writing: Can You Tell the Difference?
Shashi Sathyanarayana, Ph.D
 
FME for Good: Integrating Multiple Data Sources with APIs to Support Local Ch...
FME for Good: Integrating Multiple Data Sources with APIs to Support Local Ch...
Safe Software
 
FIDO Seminar: Perspectives on Passkeys & Consumer Adoption.pptx
FIDO Seminar: Perspectives on Passkeys & Consumer Adoption.pptx
FIDO Alliance
 
Crypto Super 500 - 14th Report - June2025.pdf
Crypto Super 500 - 14th Report - June2025.pdf
Stephen Perrenod
 
FIDO Seminar: New Data: Passkey Adoption in the Workforce.pptx
FIDO Seminar: New Data: Passkey Adoption in the Workforce.pptx
FIDO Alliance
 
FIDO Seminar: Evolving Landscape of Post-Quantum Cryptography.pptx
FIDO Seminar: Evolving Landscape of Post-Quantum Cryptography.pptx
FIDO Alliance
 
The State of Web3 Industry- Industry Report
The State of Web3 Industry- Industry Report
Liveplex
 
OWASP Barcelona 2025 Threat Model Library
OWASP Barcelona 2025 Threat Model Library
PetraVukmirovic
 
Providing an OGC API Processes REST Interface for FME Flow
Providing an OGC API Processes REST Interface for FME Flow
Safe Software
 
Reducing Conflicts and Increasing Safety Along the Cycling Networks of East-F...
Reducing Conflicts and Increasing Safety Along the Cycling Networks of East-F...
Safe Software
 
Security Tips for Enterprise Azure Solutions
Security Tips for Enterprise Azure Solutions
Michele Leroux Bustamante
 
Artificial Intelligence in the Nonprofit Boardroom.pdf
Artificial Intelligence in the Nonprofit Boardroom.pdf
OnBoard
 
vertical-cnc-processing-centers-drillteq-v-200-en.pdf
vertical-cnc-processing-centers-drillteq-v-200-en.pdf
AmirStern2
 
ENERGY CONSUMPTION CALCULATION IN ENERGY-EFFICIENT AIR CONDITIONER.pdf
ENERGY CONSUMPTION CALCULATION IN ENERGY-EFFICIENT AIR CONDITIONER.pdf
Muhammad Rizwan Akram
 
“From Enterprise to Makers: Driving Vision AI Innovation at the Extreme Edge,...
“From Enterprise to Makers: Driving Vision AI Innovation at the Extreme Edge,...
Edge AI and Vision Alliance
 
Data Validation and System Interoperability
Data Validation and System Interoperability
Safe Software
 
Integration of Utility Data into 3D BIM Models Using a 3D Solids Modeling Wor...
Integration of Utility Data into 3D BIM Models Using a 3D Solids Modeling Wor...
Safe Software
 
High Availability On-Premises FME Flow.pdf
High Availability On-Premises FME Flow.pdf
Safe Software
 
Can We Use Rust to Develop Extensions for PostgreSQL? (POSETTE: An Event for ...
Can We Use Rust to Develop Extensions for PostgreSQL? (POSETTE: An Event for ...
NTT DATA Technology & Innovation
 
Kubernetes Security Act Now Before It’s Too Late
Kubernetes Security Act Now Before It’s Too Late
Michael Furman
 
AI vs Human Writing: Can You Tell the Difference?
AI vs Human Writing: Can You Tell the Difference?
Shashi Sathyanarayana, Ph.D
 
FME for Good: Integrating Multiple Data Sources with APIs to Support Local Ch...
FME for Good: Integrating Multiple Data Sources with APIs to Support Local Ch...
Safe Software
 
FIDO Seminar: Perspectives on Passkeys & Consumer Adoption.pptx
FIDO Seminar: Perspectives on Passkeys & Consumer Adoption.pptx
FIDO Alliance
 
Crypto Super 500 - 14th Report - June2025.pdf
Crypto Super 500 - 14th Report - June2025.pdf
Stephen Perrenod
 
FIDO Seminar: New Data: Passkey Adoption in the Workforce.pptx
FIDO Seminar: New Data: Passkey Adoption in the Workforce.pptx
FIDO Alliance
 

intro unix/linux 11

  • 1. Lesson 11-Locating, Printing, and Archiving User Files
  • 2. Overview Creating a long file. Splitting long files. Locating files with find. Printing a file. Archiving files.
  • 3. Creating a Long File The “ls –R ~” command is used to list all the files contained in the user’s home directory. The “cut –c range of characters ~/file name” command is used to read a particular number of characters from each line in a file. The “cat –n file name” command is used to add numbers to the left of all lines in a copy of the file.
  • 4. Splitting Long Files The “split” utility is used to read a long file and break up the contents into a series of small files of specified size. Each small file has an extension starting with “aa” and going through the alphabet as far as needed to hold a copy of the whole file.
  • 5. Splitting Long Files Splitting Long Files into Pieces
  • 6. Splitting Long Files Reassembling the files: The “cat filename*” command is used to read all the small files and output data that matches the original long file. The last part of the file names, such as “aa”, “ab”, etc., is in ASCII order. The ASCII order is used by the shell for the filenames when it replaces the * in the command line.
  • 7. Locating File with Find The “find” utility is used to locate a particular file in several directories. The find utility displays the output and any error message that is appropriate. The pathnames of files and information about directories that cannot be examined because of their assigned permissions are also displayed by the find utility.
  • 8. Locating File with Find The command to be given is “find ~ -name filename –print”. The “~” specifies the target starting point directory. The “–print” specifies that the full pathname of each occurrence of the file(s) matching the selection criterion should be output to the screen.
  • 9. Locating File with Find Locating files by owner. Locating and acting on files by owner. Locating additional options. Acting on all files in a directory tree.
  • 10. Locating Files by Owner The “ls –ld /directory name/$USER” command is used to determine if the user has a directory with the same name as the login name in a particular directory. The “find” utility can also be used to identify files owned by a particular user. The output of the find utility can be redirected to a file or a printer.
  • 11. Locating Files by Owner Command Line Interpretation find Utility
  • 12. Locating and Acting on Files by Owner The find utility can also be used to remove located files, change file permissions, or employ any shell file-manipulation command. The “-exec” option is used with the utility to execute any command utilizing the file names that are selected.
  • 13. Locating and Acting on Files by Owner Using the find Utility to Locate Files by Owner
  • 14. Locating Additional Options Additional Options
  • 15. Acting on all Files in a Directory Tree The find utility can be used as an agent to go through the directory tree recursively and execute another utility on all files. The utility shows a user to search through the specified directory trees, based on a variety of criteria, and perform actions on the located files.
  • 16. Printing a File Printing the output of a pipeline. Printing multiple copies. Adding a title line to the banner page. Checking the status of print jobs. Canceling a print request.
  • 17. Printing the Output of a Pipeline A pipe can be used to connect the output of a utility as an input to the print utility. The “col –bx” and the “colcrt” utilities are used to remove control characters that are of value to the terminal.
  • 18. Printing Multiple Copies Any of the following commands can be used to print multiple copies of a file: lp –n (number of copies to be printed in numeric value) file name. lpr -# (number of copies to be printed in numeric value) file name.
  • 19. Adding a Title Line to the Banner Page A banner page, also called the burst page, contains information about the printer and the user issuing the print request. The “lp –t‘numbers file’ file name” or the “lpr –Pprinter –J’numbers file’ file name” command can be used to add a title and print the file.
  • 20. Adding a Title Line to the Banner Page The “lp –dprinter –ttitle filename” or the “lpr –Pprinter –J’title’ filename” are the two formats of the print commands.
  • 21. Checking the Status of Print Jobs All print requests are administered by a spooler. A spooler is a program that receives print requests from multiple users and sends jobs one at a time to the printer. The spooler makes it possible for the system to process simultaneous print job requests for several users. The “lpstat” or the “lpq –Pprinter username” command can be use to examine the queue.
  • 22. Canceling a Print Request The “cancel” or the “lprm” command can be used to remove jobs from the queue. On a Linux system, all printing jobs owned by the user are removed from the queue. On a UNIX system, the “–u” option is used to indicate jobs owned by the user.
  • 23. Archiving Files Archiving files on floppy disks. Creating archives with tar.
  • 24. Archiving Files on Floppy Disks Copying a file to and from a floppy: Mtools is a set of programs that facilitate the copying of files to a floppy drive without going through the process of mounting the drive. The “mcopy” command is used to copy a file to and from a floppy. The command requires two arguments the file name from the current directory, and a:, which is an agreed name for the floppy.
  • 25. Archiving Files on Floppy Disks Copying a file to and from a floppy (continued): Multiple files can be copied by using the * sign in place of a particular filename. Attributes such as permissions are not included in the copy. When a file is copied from a floppy, the permissions for the newly copied file may not match its original permissions. When the mcopy command creates a new file on the system, the default permissions for the new file are applied.
  • 26. Archiving Files on Floppy Disks Removing files and directories from a floppy: The “mdel” command is used to delete files. The mdel command requires an argument, the name of the file(s) to be deleted. The “mdeltree” command is used to delete directories. This command requires one argument, the name of the directory to be deleted.
  • 27. Archiving Files on Floppy Disks Formatting a floppy disk: The “mformat” command is used to format a floppy. The floppy is formatted in the DOS format.
  • 28. Creating Archives with tar The “tar” (tape archiving) utility is used extensively for making archive files on most systems. The utility can be used to create a single file, called archive, which contains the files in a directory tree and all information about each file.
  • 29. Creating Archives with tar The command used to create a tar archive is “tar –cvf filename.tar”. The command instructs tar to create an archive in verbose mode and use a file to hold the archive. The dot (.) is the source directory, from which all files are archived. The “tar –tf filename” can be used to list the contents of the tar archive.
  • 30. Creating Archives with tar Extracting files from an archive: The extension “.tar” is called a “tarball”. A tarball can be moved, mailed, or placed on portable media. The “tar –xvf filename.tar” is used to extract the directory tree from the archive. The command provides instructions to extract the structure from the archive in verbose mode, from a file.
  • 31. Summary The split utility is used to break the contents of a long file into a series of small files. The lp and the lpr utilities manage files directed to the printer. The find utility searches through a directory tree for files based on specific criteria, and then takes action on each identified file.
  • 32. Summary The mtools utility facilitates the copying of files to and from a floppy drive using a DOS-formatted floppy. The tar utility is used to make an archive of a directory tree or a file. The archive can be stored on permanent media, sent to a remote machine, or just used to move a structure from one location in a system to another.