Find backup files

Report a typo

You are organizing your personal workspace and need to identify all backup files that exist in the current working directory (CWD). By convention, you name backup files with the word "backup" in the filename. Write a command to list only these files, ensuring that the search is restricted to the current directory and does not include backup files located in subdirectories.

Sample Input 1:

butter.mp3 6000
file.txt 1000
backup_21.bkp 25000
app_backup.bkp 20000
./backup/anotherbackup_21.bkp 25000
./data/nested/file1.txt 5000

Sample Output 1:

./app_backup.bkp
./backup_21.bkp
Write a program in Shell
#!/usr/bin/env bash

solve() {
# add your solution here

}
___

Create a free account to access the full topic