I am really struggling with a homework.I have to make a shell script that will copy to a separate path the files in which the user modified more than 20 lines on a specific date.The files should also be archived and them deleted.
What I know right now:
To copy a file somewhere else i use this:
$ ls dir1/
dir2/
$ cp -r dir1/ dir1.copy
$ ls dir1.copy
dir2/
To show number of lines in a file and modified files in the last days:
wc -l file1
mtime or find ~/Desktop -type f -newermt 2020-05-22 -ls for example
I use tar for archives and rm to remove.The problem is I have very little experience with linux and I don’t know how to form the final shell script.
What I know right now:
To copy a file somewhere else i use this:
$ ls dir1/
dir2/
$ cp -r dir1/ dir1.copy
$ ls dir1.copy
dir2/
To show number of lines in a file and modified files in the last days:
wc -l file1
mtime or find ~/Desktop -type f -newermt 2020-05-22 -ls for example
I use tar for archives and rm to remove.The problem is I have very little experience with linux and I don’t know how to form the final shell script.