Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

You have created a file project.txt, containing a list of file names for a proje

ID: 3769308 • Letter: Y

Question

You have created a file project.txt, containing a list of file names for a project, one file name per line, for example:

You would like to obtain a listing of just the base names of those files, with the final extension stripped away, for example:

What sed command would do the job?

sed -e 's/[.][^.]*$/./' project.txt

sed -e 's/.[^.]*$/./' < project.txt

sed -e 's/.*.[^.]*$/./' < project.txt

sed -e 's/^.[^.]*$/./' < project.txt

sed -e 's/.[a-z]*/./' < project.txt

sed -e 's/[.][^.]*$/./' project.txt

sed -e 's/.[^.]*$/./' < project.txt

sed -e 's/.*.[^.]*$/./' < project.txt

sed -e 's/^.[^.]*$/./' < project.txt

sed -e 's/.[a-z]*/./' < project.txt

Explanation / Answer

using shell we cann add the sed script to the commandline

This corresponds to the fourth element of the table

sed -e 's/^.[^.]*$/./' <project .txt

this will show the names of all the files whether they are hidden or not without their extensions/-> beginning

-> for ending

^- shows only the first names of the file.

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote