Skip to main content
Question

Script to collect a list of a specific folders contents?


Forum|alt.badge.img+13
  • Valued Contributor
  • 277 replies

I was wondering if there is a script out there I could utilise, to list the file contents of
the users /library/LaunchDaemons /library/LaunchAgents /library/StartupItems

So that I can keep the startup items of users devices to a minimum, I hope to collect a list of plist files that don't need to be set for startup.

2 replies

Forum|alt.badge.img+8
  • Contributor
  • 10 replies
  • August 9, 2016

You could do something as simple as follows:

#!/bin/bash

ls /Library/LaunchDaemons > "Filename/Location" &&
ls /Library/LaunchAgents >> "Filename/Location" &&
ls /Library/StartupItems >> "Filename/Location"

This will collect the data from the command and put it to a text file if you name the file something like "dataoutput.txt" and you can specify save location too such as "/Users/$USER/Desktop/dataoutput.txt".


Forum|alt.badge.img+12
  • Contributor
  • 18 replies
  • August 10, 2016

I have the exact same question, though more specifically, I'd like to create an extension attribute which lists the contents of /Library/LaunchAgents, /Library/LaunchDaemons, /Library/Startupitems AND their counterparts in ~/Library. My intent is to use this data to look for the presence of Malware.


Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings