Griff
April 14th, 2008, 01:52 AM
1)
For debugging purposes I have a cron job that I run want to run every 10 minutes. Is there a shorter way to do that than
0,10,20,30,40,50 * * * * command
2)
I have a directory with tons of junk and want to remove all of the files except my .jpg files. Is there a way to do this?
3)
I've looked online on bash scripts accepting arguments but they're all the same and kind of confusing. How do you do this? Along the same lines, how do you print a message to the prompt if no argument is passed to the script?
4)
I want to list all of the currently running processes, but exclude root. Can this be done? It's not just one user I want but all the ones logged on right now otherwise I'd use something like ps -u bob -U bob u.
Sorry I know it's a lot, but I tried to gather my thoughts all at once so I wouldn't have to make more than this one thread. Thanks for all the help. It's really fun for me learning this right now.
For debugging purposes I have a cron job that I run want to run every 10 minutes. Is there a shorter way to do that than
0,10,20,30,40,50 * * * * command
2)
I have a directory with tons of junk and want to remove all of the files except my .jpg files. Is there a way to do this?
3)
I've looked online on bash scripts accepting arguments but they're all the same and kind of confusing. How do you do this? Along the same lines, how do you print a message to the prompt if no argument is passed to the script?
4)
I want to list all of the currently running processes, but exclude root. Can this be done? It's not just one user I want but all the ones logged on right now otherwise I'd use something like ps -u bob -U bob u.
Sorry I know it's a lot, but I tried to gather my thoughts all at once so I wouldn't have to make more than this one thread. Thanks for all the help. It's really fun for me learning this right now.