Search Results

Search: Posts Made By: sandeep.dwivedi
3,577
Posted By ctsgnb
If you want get rid off error message you can...
If you want get rid off error message you can redirect the error standard output (associated to file descriptor 2) to the trash (/dev/null)
ls -t /PROCESSED/* | tail +9 | xargs rm 2>/dev/null
3,577
Posted By vbe
looks more like you have less than 8 files, and...
looks more like you have less than 8 files, and so the command rm does not appreciate to be called for nothing and reminds you its usage...
3,577
Posted By ctsgnb
To be set in the crontab : ls -t /PROCESSED/* |...
To be set in the crontab :
ls -t /PROCESSED/* | tail +9 | xargs rm
3,577
Posted By ctsgnb
which OS are you running ? tail doesn't have...
which OS are you running ?
tail doesn't have the "+" option ?
(i have tested it on my system and it worked : FreeBSD, the + option also exists on Solaris)
(if the tail fails, it is normal that...
3,577
Posted By joeyg
+ option
The + option may not be available in all unix flavors. The + option takes from a line forward. Thus
file1=
a1
b2
c3
d4

command like the following
>tail -n +2 file1

gives
b2
c3
d4

...
3,577
Posted By ctsgnb
Ok then ... ls -t /PROCESSED/* | tail -n +9 |...
Ok then ...
ls -t /PROCESSED/* | tail -n +9 | xargs rm
Showing results 1 to 6 of 6

 
All times are GMT -4. The time now is 11:00 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy