crp Posted September 29, 2014 Share Posted September 29, 2014 [root@rh5 old]# ls -ltr *[s-U].ps -bash: /bin/ls: Argument list too long [root@rh5 old]# ls -ltr *S.ps ls: *S.ps: No such file or directory [root@rh5 old]# ls -ltr *T.ps ls: *T.ps: No such file or directory [root@rh5 old]# ls -ltr *U.ps ls: *U.ps: No such file or directory [root@rh5 old]# ls -l *[s-U].ps -bash: /bin/ls: Argument list too long ls: *S.ps: No such file or directory You have new mail in /var/spool/mail/root [root@rh5 old]# ls -l *T.ps ls: *T.ps: No such file or directory [root@rh5 old]# ls -l *U.ps ls: *U.ps: No such file or directory Can anyone explain this? provide a work-around? Quote Link to comment Share on other sites More sharing options...
V.T. Eric Layton Posted September 29, 2014 Share Posted September 29, 2014 THIS may answer your question. Quote Link to comment Share on other sites More sharing options...
crp Posted September 29, 2014 Author Share Posted September 29, 2014 (edited) THIS may answer your question. That is what I did after the S-U said too many.hmm, the echo trick worked for some things. How can i use the echo *| to check to see if file is older than 95 days and delete it if so? (basically, how do i replicate functionalaty of find *[s-U].ps -ctime +135 | xargs rm) Edited September 29, 2014 by crp Quote Link to comment Share on other sites More sharing options...
V.T. Eric Layton Posted September 30, 2014 Share Posted September 30, 2014 Sorry, crp. I'm no bash scripting guru. Can't help you beyond basics. Quote Link to comment Share on other sites More sharing options...
securitybreach Posted September 30, 2014 Share Posted September 30, 2014 Check the first solution here: https://unix.stackexchange.com/questions/22674/shell-script-for-moving-oldest-files It explains it better than I could. BTW make sure that you leave the *.ps because you may start removing installation files. Personally I wouldn't run the command as root. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.