Script: Collapse the Subdirectory Goals: Write a simple bash script Write a scri
ID: 3885753 • Letter: S
Question
Script: Collapse the Subdirectory Goals: Write a simple bash script Write a script to automate moving all the files to another directory We have been left with a huge dump of text files in a redundant directory. Our goal is to move all of these files into the parent directory. Create a script to move each file from this directory to the parent directory. Name it collapse.sh You may set up the script to take the target and destination directory as parameters. Use CHMOD to make the script executable. After running your script ALL of the archive files should be in the /textarchive/ directory. Use your "Count Files" Script to confirm all the files were moved. Provide a before and after screen shot.Explanation / Answer
prev_dir=/c/Users/Nani/Desktop/New/New_folder
new_dir=/c/Users/Nani/Desktop/New
cd $prev_dir
for i in `cat move_files.txt`
do
mv $prev_dir/$i $new_dir
done
Related Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.