Wednesday, 27 November 2013

Adb shell - opening/copying files by selecting as wildcard

Let's say we have very long app and we do not want rewrite it because it takes too much time or we sense that the percentage of wrong misspelling will be occured.. here is the solution

We know that:
ls - list files
| - is a pipe for i.e. grep
grep <text> - filters text and returns text which is accepted with our filter

Problem: we need to open directory which is too long, we need use example wildcard:
cd $(ls|grep App_Back) - we need just few letters of directory which we want to open

Example:
shell@mako:/storage/emulated/legacy $ ls
ls
Alarms
Android
App_Backup_Restore
DCIM
Download
EditedOnlinePhotos
FREEdiYouTubePlayer
Movies
Music
NoobRoomLatestAdditionsCache
Notifications
Pictures
Podcasts
Ringtones
aquery
shell@mako:/storage/emulated/legacy $ cd $(ls|grep App_Backup)
cd $(ls|grep App_Backup)
shell@mako:/storage/emulated/legacy/App_Backup_Restore $