I expect that this is wishful thinking but my work (Linux) server contains a lot of scripts not particularly well organised. I am new to Linux, would there be a historical list of scripts that have recently ran?
Not sure why hardillb got voted down, he's correct. Check the .bash_history, or history command. If you have root, check other users history. You can use
last to see which user has logged in, when, and check that user's history. It won't help with system cron commands.
To his response I will add:
find ./ type -f -atime -7 -iname "*.sh"(or *.pl, or any other script extensions you can think of.). This will tell you files that were accessed in the last 7 days according to the FS access time value. It won't work if the filesystem has been mounted with noatime.
- Check /var/log/cronlog or syslog if it isn't logging cron events.
- If you add
-executableto that find command above, instead of looking for ".sh" or ".pl", then it should find files with an executable bit that have been accessed in 7 days. Not all scripts are executable, so the -iname option is useful too.
The list provided by "find" won't be access time sorted, but you can pseudo-accomplish it by testing with -1, then -2, then -3 ... -7 days, at least they'll be grouped by day.