EDIT: Some parts of this answer are now obsolete as Find your files - Drive Help was updated recently. This was noted thanks to the answer by Dean Ransevycz
At this time Google Drive doesn't include a view nor a search operator to find only orphaned files. From [1]:
To find an orphaned item, do one of the following:
- Search for the item in the search box at the top of Google Drive on the web.
- If you own the orphaned item, you can get a list of everything you own and look for the item in that list. Click the down arrow in the
Google Drive search box and select Ownership > Owned by me.
- If you've accessed the file recently, click Recent in the left navigation and then browse for the file.
- To browse everything in Google Drive on the web, click More in the left navigation, and then click All Items (Classic Google Drive only).
Once you find the orphaned file, you'll probably want to move it into
My Drive (or another folder), to give it a home and make it easier to
find in the future.
From [2]
... you can extend the capabilities of documents, spreadsheets, and forms
by adding custom menus, dialogs, and sidebars with Google Apps
Script
Assume that you want to automatically move the Orphaned files to a folder in "My Drive" named Orphaned
From: https://stackoverflow.com/a/27957068/1595451
function collectOrphans(findOrphaned) {
var folder = DriveApp.getFoldersByName('Orphaned').next();
var files = DriveApp.getFiles();
var orphanCount = 0;
while(files.hasNext()){
var file = files.next();
if(!file.getParents().hasNext()){
folder.addFile(file);
orphanCount++;
}
}
Logger.log('Moved ' + orphanCount + ' orphans successfully.');
}
Remarks
- The above code could exceed the processing time limit, so could be necessary to call it several times. The Continuous Batch Library ([3]) could be useful for dealing with this.
- Folders also could be orphans, the above code only works for files but could be used as a base for collecting orphan folders.
References
1 Find your files - Drive Help
2 Extend Google Docs, Sheets, and Forms with Apps Script - Docs editors Help
3 Continous Batch Libray UPDATE for Google Apps Script