Question: THE CODE NEEDS TO BE WRITTEN IN BASH We have a directory containing: music, videos, images, logs and perhaps other files. Your task is to

THE CODE NEEDS TO BE WRITTEN IN BASH THE CODE NEEDS TO BE WRITTEN IN BASH We have a

We have a directory containing: music, videos, images, logs and perhaps other files. Your task is to organize files into categories and get rid of some of them. Specifically, after your script has made changes, the directory should appear as follows: " . a new directory, "music", should contain all files with ".mp3" and ".flac" extensions; a new directory, "images", should contain all files with ".jpg" and ".png" extensions; a new directory, "videos", should contain all files with ".avi" and ".moy" extensions; all files with the ".log" extension should be removed; other files not already mentioned in this list must not be changed. For example, given the following directory contents: bike.png car.jpg comedy.mov error.log horror.avi info.txt interview.mp3 song.flac tree-small.jpeg 11.10.2017_y some-directory/ nested-file.log the script should leave the directory in the following state: images/ bike.png car.jpg music/ interview.mp3 song.flac videos/ comedy.mov horror.avi info.txt tree-small.jpeg 11.10.2017_y some-directory/ nested-file.log Assume that: there are between 7 and 1000 files in the given current directory; every filename consists only of lower-case English letters (a-z), digits (0-9) and special characters " (without quotes); the filename is not longer than 20 characters; there are no files named "images","music", "videos" at the initial state; there exists at least one file for each of the following extensions: "jpg", "png", "avi", "mov", "mp3", "flac" and "log": the machine is running Ubuntu 16.04

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!