윈도우
C:\log>for /l %i in (1001, 1, 1023) do (mkdir %i && echo %i > %i\%i.log)C:\log>dir /s/b *.logC:\log\1001\1001.logC:\log\1002\1002.logC:\log\1003\1003.logC:\log\1004\1004.logC:\log\1005\1005.logC:\log\1006\1006.logC:\log\1007\1007.logC:\log\1008\1008.logC:\log\1009\1009.logC:\log\1010\1010.logC:\log\1012\1012.logC:\log\1013\1013.logC:\log\1014\1014.logC:\log\1015\1015.logC:\log\1016\1016.logC:\log\1017\1017.logC:\log\1018\1018.logC:\log\1019\1019.logC:\log\1020\1020.logC:\log\1021\1021.logC:\log\1022\1022.logC:\log\1023\1023.log
리눅스
root@MHKANG:/mnt/c/log# for((i=1001;i<1024;i++))> do mkdir $i && echo $i > $i/$i.log> doneroot@MHKANG:/mnt/c/log# ll ./*/*.log-rwxrwxrwx 1 root root 7 Oct 24 14:10 ./1001/1001.log*-rwxrwxrwx 1 root root 7 Oct 24 14:10 ./1002/1002.log*-rwxrwxrwx 1 root root 7 Oct 24 14:10 ./1003/1003.log*-rwxrwxrwx 1 root root 7 Oct 24 14:10 ./1004/1004.log*-rwxrwxrwx 1 root root 7 Oct 24 14:10 ./1005/1005.log*-rwxrwxrwx 1 root root 7 Oct 24 14:10 ./1006/1006.log*-rwxrwxrwx 1 root root 7 Oct 24 14:10 ./1007/1007.log*-rwxrwxrwx 1 root root 7 Oct 24 14:10 ./1008/1008.log*-rwxrwxrwx 1 root root 7 Oct 24 14:10 ./1009/1009.log*-rwxrwxrwx 1 root root 7 Oct 24 14:10 ./1010/1010.log*-rwxrwxrwx 1 root root 7 Oct 24 14:10 ./1011/1011.log*-rwxrwxrwx 1 root root 7 Oct 24 14:10 ./1012/1012.log*-rwxrwxrwx 1 root root 7 Oct 24 14:10 ./1013/1013.log*-rwxrwxrwx 1 root root 7 Oct 24 14:10 ./1014/1014.log*-rwxrwxrwx 1 root root 7 Oct 24 14:10 ./1015/1015.log*-rwxrwxrwx 1 root root 7 Oct 24 14:10 ./1016/1016.log*-rwxrwxrwx 1 root root 7 Oct 24 14:10 ./1017/1017.log*-rwxrwxrwx 1 root root 7 Oct 24 14:10 ./1018/1018.log*-rwxrwxrwx 1 root root 7 Oct 24 14:10 ./1019/1019.log*-rwxrwxrwx 1 root root 7 Oct 24 14:10 ./1020/1020.log*-rwxrwxrwx 1 root root 7 Oct 24 14:10 ./1021/1021.log*-rwxrwxrwx 1 root root 7 Oct 24 14:10 ./1022/1022.log*-rwxrwxrwx 1 root root 7 Oct 24 14:10 ./1023/1023.log*
하위 디렉토리 로그 취합
윈도우
C:\log>for /f %i in ('dir /b/s ^| find ".log"') do (type %i >> all.log)C:\log>type all.log10011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023
리눅스
root@MHKANG:/mnt/c/log# for i in `find . -name *.log`> do cat $i >> all.log> doneroot@MHKANG:/mnt/c/log# cat all.log10011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023
안 쓰니 다 까먹네.
관련 글
댓글 없음:
댓글 쓰기