Код: Выделить всё
1. touch 1 - create a file with name 1
[root@pgsql1 iotest]# touch 1
character set and file encoding:
[root@pgsql1 iotest]# file -bi 1
text/plain; charset=us-ascii
[root@pgsql1 iotest]# enca -L none 1
7bit ASCII characters
[root@pgsql1 iotest]# echo $LANG
en_US.UTF-8
-----------
2. stat 1 - output below
[root@pgsql1 iotest]# stat 1
File: ‘1’
Size: 0 Blocks: 0 IO Block: 4096 regular empty file
Device: 831h/2097d Inode: 12 Links: 1
Access: (0644/-rw-r--r--) Uid: ( 0/ root) Gid: ( 0/ root)
Access: 2024-09-29 19:18:55.257153854 +0530
Modify: 2024-09-29 19:18:55.257153854 +0530
Change: 2024-09-29 19:18:55.257153854 +0530
Birth: -
[root@pgsql1 iotest]#
3. echo "1" > 1
[root@pgsql1 iotest]# echo "1" > 1
4. stat 1 - output below
[root@pgsql1 iotest]# stat 1
File: ‘1’
Size: 2 Blocks: 8 IO Block: 4096 regular file
Device: 831h/2097d Inode: 12 Links: 1
Access: (0644/-rw-r--r--) Uid: ( 0/ root) Gid: ( 0/ root)
Access: 2024-09-29 19:18:55.257153854 +0530
Modify: 2024-09-29 19:20:02.806425277 +0530
Change: 2024-09-29 19:20:02.806425277 +0530
Birth: -
5. echo "1" >> 1
[root@pgsql1 iotest]# echo "1" >> 1
6. stat 1
[root@pgsql1 iotest]# stat 1
File: ‘1’
Size: 4 Blocks: 8 IO Block: 4096 regular file
Device: 831h/2097d Inode: 12 Links: 1
Access: (0644/-rw-r--r--) Uid: ( 0/ root) Gid: ( 0/ root)
Access: 2024-09-29 19:18:55.257153854 +0530
Modify: 2024-09-29 19:21:03.907575276 +0530
Change: 2024-09-29 19:21:03.907575276 +0530
Birth: -
Подробнее здесь: https://stackoverflow.com/questions/790 ... for-a-file
Мобильная версия