...

/

Exercise: Writing a Bash Script

Exercise: Writing a Bash Script

Practice using variables in Bash scripts.

We'll cover the following...

Exercise

Write a script that searches for files with the TXT extension in the current directory. The script ignores subdirectories. Copy or move all found files to the home directory.

When you call the script, you can choose whether to copy or move the files. If you do not specify the action, the script copies the files.

# Write your script here

Solution

The find utility searches for files recursively. It starts from the specified path and passes through all ...