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

잔글 (봇: 자동으로 텍스트 교체 (-source +syntaxhighlight))
5번째 줄: 5번째 줄:
==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>
<source lang='Bash'>
<syntaxhighlight lang='Bash'>
du -b /etc/hosts | awk '{print $1}'
du -b /etc/hosts | awk '{print $1}'
</source>
</syntaxhighlight>


==PHP==
==PHP==
[[category: PHP]]
[[category: PHP]]
<source lang='PHP'>
<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==
==Perl==
[[category: Perl]]
[[category: Perl]]
<source lang='Perl'>
<syntaxhighlight lang='Perl'>
print -s '/etc/hosts';
print -s '/etc/hosts';
</source>
</syntaxhighlight>


==같이 보기==
==같이 보기==

2020년 11월 2일 (월) 02:32 판

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 }}