adb shell 로 ls 와 du 명령어를 사용하면 어떤 파일들이 존재하는지 쉽게 알 수 있고 차지하고 있는 용량 정보도 알 수 있습니다.
du와 ls를 이용한 사용 예제를 정리하였습니다.
ls ( 용량 정보 포함 파일 목록 보기 ) list files
사용옵션들what to show:
-a all files including .hidden -c use ctime for timestamps
-d directory, not contents -i inode number
-k block sizes in kilobytes -p put a '/' after dir names
-q unprintable chars as '?' -s size (in blocks)
-u use access time for timestamps -A list all files but . and ..
-H follow command line symlinks -L follow symlinks
-R recursively list files in subdirs -F append /dir *exe @sym |FIFO
-Z security context
output formats:
-1 list one file per line -C columns (sorted vertically)
-g like -l but no owner -h human readable sizes
-l long (show full details) -m comma separated
-n like -l but numeric uid/gid -o like -l but no group
-x columns (horizontal sort)
sorting (default is alphabetical):
-f unsorted -r reverse -t timestamp -S size
--color device=yellow symlink=turquoise/red dir=blue socket=purple
files: exe=green suid=red suidfile=redback stickydir=greenback
=auto means detect if output is a tty.
이중 파일이 어떤 내용이 있는지 확인하려면 -R(서브폴더 포함),-l(long) 옵션을 사용합니다.
예) ls -lR
du (폴더 용량 계산하기) Show disk usage, space consumed by files and directories.
아래 내용은 system에 따라 달라질 수 있습니다.usage: du [-d N] [-askxHLlmc] [file...]
Size in:
-k 1024 byte blocks (default)
-K 512 byte blocks (posix)
-m megabytes
-h human readable format (e.g., 1K 243M 2G )
What to show:
-a all files, not just directories
-H follow symlinks on cmdline
-L follow all symlinks
-s only total size of each argument
-x don't leave this filesystem
-c cumulative total
-d N only depth < N
-l disable hardlink filter
중요 옵션
-d : 폴더의 depth예) du -d 1
-k : 블록의 수를 1024배수로 나타냅니다. (Kbyte)
adb 를 이용한 script 예제
* system 폴더의 용량 정보 확인하기adb shell "cd system ; du -k -d 1 " > 파일이름
ls 예제
C:\>adb shell "cd system; cd usr; ls -lR" .: total 56 drwxr-xr-x 2 root root 4096 2017-03-11 09:07 hyphen-data drwxr-xr-x 2 root root 4096 2018-01-23 08:45 icu drwxr-xr-x 2 root root 4096 2017-03-11 09:02 idc drwxr-xr-x 2 root root 4096 2017-03-11 09:02 keychars drwxr-xr-x 2 root root 4096 2017-03-11 09:02 keylayout drwxr-xr-x 5 root root 4096 2009-01-01 00:00 share drwxr-xr-x 3 root root 4096 2009-01-01 00:00 srec ./hyphen-data: total 2696 -rw-r--r-- 1 root root 703 2008-08-01 21:00 hyph-as.hyb ...생략... ./icu: total 43504 -rw-r--r-- 1 root root 22267072 2018-01-23 08:45 icudt56l.dat ./idc: total 32 -rw-r--r-- 1 root root 634 2009-01-01 00:00 AVRCP.idc -rw-r--r-- 1 root root 948 2009-01-01 00:00 ft5x06_ts.idc -rw-r--r-- 1 root root 869 2009-01-01 00:00 qwerty.idc -rw-r--r-- 1 root root 870 2009-01-01 00:00 qwerty2.idc ./keychars: total 152 ...생략... ./keylayout: total 608 -rw-r--r-- 1 root root 811 2009-01-01 00:00 AVRCP.kl -rw-r--r-- 1 root root 10568 2017-03-11 09:02 Generic.kl ...생략... ./share: total 24 drwxr-xr-x 2 root root 4096 2009-01-01 00:00 alsa drwxr-xr-x 2 root root 4096 2009-01-01 00:00 bmd drwxr-xr-x 2 root root 4096 2018-01-23 08:45 zoneinfo ./share/alsa: total 24 -rw-r--r-- 1 root root 9030 2009-01-01 00:00 alsa.conf ./share/bmd: total 72 -rw-r--r-- 1 root root 12862 2009-01-01 00:00 RFFspeed_501.bmd -rw-r--r-- 1 root root 19586 2009-01-01 00:00 RFFstd_501.bmd ./share/zoneinfo: total 984 -rw-r--r-- 1 root root 500568 2018-01-23 08:45 tzdata ./srec: total 8 drwxr-xr-x 2 root root 4096 2018-01-23 08:49 en-US ./srec/en-US: total 78272 -rw-r--r-- 1 root root 208 2018-01-23 08:45 APP_NAME.fst -rw-r--r-- 1 root root 58 2008-08-01 21:00 APP_NAME.syms -rw-r--r-- 1 root root 3645040 2018-01-23 08:43 CLG.prewalk.fst -rw-r--r-- 1 root root 208 2018-01-23 08:45 CONTACT_NAME.fst -rw-r--r-- 1 root root 58 2008-08-01 21:00 CONTACT_NAME.syms -rw-r--r-- 1 root root 208 2018-01-23 08:45 SONG_NAME.fst -rw-r--r-- 1 root root 58 2008-08-01 21:00 SONG_NAME.syms -rw-r--r-- 1 root root 615 2008-08-01 21:00 am_phonemes.syms -rw-r--r-- 1 root root 354 2008-08-01 21:00 app_bias.fst -rw-r--r-- 1 root root 411730 2009-01-01 00:00 c_fst -rw-r--r-- 1 root root 1881 2009-01-01 00:00 commands.abnf ...생략...
du 예제
C:>adb shell "cd system; du -d 1" 4 ./lost+found 1302612 ./app du: ./bin/uncrypt: Permission denied 27044 ./bin 8836 ./cameradata 10884 ./container 26092 ./etc 66288 ./fonts 366844 ./framework 203916 ./lib 244352 ./lib64 20 ./fake-libs 15804 ./media 28768 ./preload 8 ./HWRDB 1327064 ./priv-app 54204 ./saiv 17356 ./T9DB 12 ./fake-libs64 29160 ./tts 63220 ./usr 112944 ./vendor 2276 ./voicebargeindata 20244 ./wakeupdata 156 ./xbin 144 ./csc 1568 ./stub_archive 3941808 .
du 예제
C:\>adb shell "cd system; cd usr; du -d 1" 1352 ./hyphen-data 21756 ./icu 20 ./idc 80 ./keychars 308 ./keylayout 556 ./share 39144 ./srec 63220 . C:\>adb shell "cd system; cd usr; du -d 2" 1352 ./hyphen-data 21756 ./icu 20 ./idc 80 ./keychars 308 ./keylayout 16 ./share/alsa 40 ./share/bmd 496 ./share/zoneinfo 556 ./share 39140 ./srec/en-US 39144 ./srec 63220 .
댓글 없음:
댓글 쓰기