Skip to main content
deleted 31 characters in body
Source Link
Rui F Ribeiro
  • 58k
  • 28
  • 156
  • 237

I need to get the list of files(.log/.lst) present in a directory($logfolder) whose creation date is in a specific $year and $month

stat  --format='%y %n'  $logfolder/* |
  grep "$year-$month-"|
  awk -F' ' '{print $4}'|
  grep 'log$\|lst$' > $archivepath/filesToArchive
            

This doesn't work when I query the command to a folder where there are too many files. I get the following error:

-bash: /usr/bin/stat: Argument list too long

Could anybody please help me?

I need to get the list of files(.log/.lst) present in a directory($logfolder) whose creation date is in a specific $year and $month

stat  --format='%y %n'  $logfolder/* |
  grep "$year-$month-"|
  awk -F' ' '{print $4}'|
  grep 'log$\|lst$' > $archivepath/filesToArchive
            

This doesn't work when I query the command to a folder where there are too many files. I get the following error:

-bash: /usr/bin/stat: Argument list too long

Could anybody please help me?

I need to get the list of files(.log/.lst) present in a directory($logfolder) whose creation date is in a specific $year and $month

stat  --format='%y %n'  $logfolder/* |
  grep "$year-$month-"|
  awk -F' ' '{print $4}'|
  grep 'log$\|lst$' > $archivepath/filesToArchive
            

This doesn't work when I query the command to a folder where there are too many files. I get the following error:

-bash: /usr/bin/stat: Argument list too long
edited title
Link
Rui F Ribeiro
  • 58k
  • 28
  • 156
  • 237

Help with "/usr/bin/stat: Argument list too long" error

added 1 character in body
Source Link
Jeff Schaller
  • 68.8k
  • 35
  • 122
  • 264

I need to get the list of files(.log/.lst) present in a directory($logfolder) whose creation date is in a specific $year and $month

stat  --format='%y %n'  $logfolder/* |
  grep "$year-$month-"|
  awk -F' ' '{print $4}'|
  grep 'log$\|lst$' > $archivepath/filesToArchive
            

This doesntdoesn't work when I query the command to a folder where there are too many files. I get the following error:

-bash: /usr/bin/stat: Argument list too long

Could anybody please help me?

I need to get the list of files(.log/.lst) present in a directory($logfolder) whose creation date is in a specific $year and $month

stat  --format='%y %n'  $logfolder/* |
  grep "$year-$month-"|
  awk -F' ' '{print $4}'|
  grep 'log$\|lst$' > $archivepath/filesToArchive
            

This doesnt work when I query the command to a folder where there are too many files. I get the following error:

-bash: /usr/bin/stat: Argument list too long

Could anybody please help me?

I need to get the list of files(.log/.lst) present in a directory($logfolder) whose creation date is in a specific $year and $month

stat  --format='%y %n'  $logfolder/* |
  grep "$year-$month-"|
  awk -F' ' '{print $4}'|
  grep 'log$\|lst$' > $archivepath/filesToArchive
            

This doesn't work when I query the command to a folder where there are too many files. I get the following error:

-bash: /usr/bin/stat: Argument list too long

Could anybody please help me?

Loading
added 21 characters in body
Source Link
cuonglm
  • 158.1k
  • 41
  • 342
  • 420
Loading
Source Link
DCL
  • 51
  • 2
Loading