Answered step by step
Verified Expert Solution
Link Copied!

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 three-letter 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
(0-9) in their name.
Brace Expansion:
Use brace expansion to generate a sequence of filenames for files numbered 1 through 5. 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 three-letter extension.
Advanced Square Brackets:
Write a command using square brackets and a range to list all files in the current directory that have a
single-digit number in their name (e.g., file1.txt).
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
"important1.txt" and "important2.txt."
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
123
banana
42
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 sorted_alphanumeric.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 sorted_reverse.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 sorted_numeric.txt.
Sort Based on Specific Fields:
Use the sort command to sort the lines in unsorted.txt based on the second field (space-separated).
Save the sorted result to a new file named sorted_field.txt.
Remove Duplicate Lines:
Use the sort command to remove duplicate lines from unsorted.txt.
Save the result to a new file named unique_lines.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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database And Transaction Processing

Authors: Philip M. Lewis, Arthur Bernstein, Michael Kifer

1st Edition

0201708728, 978-0201708721

More Books

Students also viewed these Databases questions