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.

Get hands-on with 1200+ tech skills courses.