Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Basic Wildcards: Write a command using the * wildcard to list all files in the current directory that have a . pdf extension. Question Mark
Basic Wildcards:
Write a command using the wildcard to list all files in the current directory that have a pdf extension.
Question Mark Wildcard:
Use the wildcard to find all files in the current directory that have a threeletter extension. Provide the
command.
Square Brackets and Ranges:
Write a command using square brackets to list all files in the current directory that have a numeric digit
in their name.
Brace Expansion:
Use brace expansion to generate a sequence of filenames for files numbered through Provide the
command.
Combining Wildcards:
Create a command that uses both the and wildcards to list all files in the current directory with
names starting with "file" and having a threeletter extension.
Advanced Square Brackets:
Write a command using square brackets and a range to list all files in the current directory that have a
singledigit number in their name eg filetxt
Excluding Files with Extended Globbing:
Use the extended globbing pattern to list all files in the current directory that do not have a txt
extension.
Copying Files with Wildcards:
Create a command that copies all files in the current directory with names starting with "image" and
having a jpg extension to a destination directory.
Removing Files with Wildcards:
Write a command that removes all files in the current directory except those with names
"importanttxt and "importanttxt
Wildcard Error Handling:
What happens if you use a wildcard pattern that doesn't match any files in the current directory? Provide
an example and explain the result.
Sorting
Instructions:
Create a Text File:
Open a text editor and create a file named unsorted.txt
Populate it with the following lines:
dog
apple
banana
cat
dog
View the Contents of unsorted.txt:
Open a terminal and use the cat command to view the contents of the unsorted.txt file.
Identify the current order of the lines in the file.
Sort the Lines Alphanumerically:
Use the sort command to sort the lines in unsorted.txt in alphanumerical order.
Save the sorted result to a new file named sortedalphanumeric.txt
Sort the Lines in Reverse Order:
Use the sort command to sort the lines in unsorted.txt in reverse order.
Save the sorted result to a new file named sortedreverse.txt
Sort the Lines Numerically:
Use the sort command to sort the lines in unsorted.txt in numerical order.
Save the sorted result to a new file named sortednumeric.txt
Sort Based on Specific Fields:
Use the sort command to sort the lines in unsorted.txt based on the second field spaceseparated
Save the sorted result to a new file named sortedfield.txt
Remove Duplicate Lines:
Use the sort command to remove duplicate lines from unsorted.txt
Save the result to a new file named uniquelines.txt
Submission:
Provide the commands used to accomplish each task.
Include screenshots or text output showing the content of each sorted file.
Tips:
Use the man sort command to explore additional options and details about the sort comman
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started