Use and complete the template provided. The entire template must be completed. If you don't, your post may be deleted!
1. The problem statement, all variables and given/known data:
The program should search all files in current directory and it's subdirectories and list out the newest file by the date(last changed). Argument is a directory!
the input is: newest /usr/etc
and the output should look like this(with the subdirectories included):
/usr/etc/httpd/httpd Oct 25 12:16
This task is giving me a headache, please help
!
2. Relevant commands, code, scripts, algorithms:
ls -lt, cut, grep,...
3. The attempts at a solution (include all code and scripts):
i'm not sure in which direction to go with this one, but i think
i should list all files by time and then cut out the date and time and then
grep the first one
#!/bin/bash
newest()
{
ls -lt (R?) | cut -d" " -f6,7 | grep...
}
newest /usr/etc
exit
4. Complete Name of School (University), City (State), Country, Name of Professor, and Course Number (Link to Course):
University of Ljubljana, Ljubljana, Slovenia, Janez Novak, ID63709
Note: Without school/professor/course information, you will be banned if you post here! You must complete the entire template (not just parts of it).