"함수 filesize"의 두 판 사이의 차이

 
(사용자 3명의 중간 판 6개는 보이지 않습니다)
1번째 줄: 1번째 줄:
[[category: File]]
[[category: File]]
;filesize
;os.path.getsize


==Bash==
==Bash==
[[category: Bash]]
[[category: Bash]]
<source lang='Bash'>
<syntaxhighlight lang='Bash'>
stat -c%s /etc/hosts
stat -c%s /etc/hosts
</source>
</syntaxhighlight>
<source lang='Bash'>
<syntaxhighlight lang='Bash'>
ls -l /etc/hosts | awk '{print $5}'
ls -l /etc/hosts | awk '{print $5}'
</source>
</syntaxhighlight>
<syntaxhighlight lang='Bash'>
du -b /etc/hosts | awk '{print $1}'
</syntaxhighlight>


==PHP==
==PHP==
[[category: PHP]]
[[category: PHP]]
<source lang='PHP'>
{{참고|PHP filesize()}}
<syntaxhighlight lang='PHP'>
echo filesize('/etc/hosts');
echo filesize('/etc/hosts');
</source>
</syntaxhighlight>


==Python==
==Python==
[[category: Python]]
[[category: Python]]
<source lang='Python'>
<syntaxhighlight lang='Python'>
import os
import os
print( os.path.getsize('/etc/hosts') )
print( os.path.getsize('/etc/hosts') )
</source>
</syntaxhighlight>
 
==Perl==
[[category: Perl]]
<syntaxhighlight lang='Perl'>
print -s '/etc/hosts';
</syntaxhighlight>


==같이 보기==
==같이 보기==
*[[함수 filemtime]]
*[[리눅스 stat]]
*[[리눅스 stat]]
*[[리눅스 ls]]

2023년 2월 28일 (화) 12:02 기준 최신판

filesize
os.path.getsize

1 Bash[ | ]

stat -c%s /etc/hosts
ls -l /etc/hosts | awk '{print $5}'
du -b /etc/hosts | awk '{print $1}'

2 PHP[ | ]

echo filesize('/etc/hosts');

3 Python[ | ]

import os
print( os.path.getsize('/etc/hosts') )

4 Perl[ | ]

print -s '/etc/hosts';

5 같이 보기[ | ]

문서 댓글 ({{ doc_comments.length }})
{{ comment.name }} {{ comment.created | snstime }}