Reload menu bar from terminal (not SystemUIServer)
So I finally found a solution to this. 

I compiled the following Objective-c code and call it through the terminal. 

#import &lt;Foundation/Foundation.h&gt;

int main(int argc, const char * argv[])
{

  @autoreleasepool {
    LSSharedFileListRef recentDocsList = LSSharedFileListCreate(NULL, kLSSharedFileListRecentDocumentItems, NULL);
    LSSharedFileListRemoveAllItems(recentDocsList);
    NSLog(@"Cleared files!");
  }
   return 0;
}