In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-13 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/01 Report--
This article mainly shows you "Linux how to check file size", the content is easy to understand, clear, hope to help you solve doubts, the following let the editor lead you to study and learn "Linux how to check file size" this article.
1. Preface
The Linux system has very useful commands and rich functions. If you are familiar with command-line tools, you can complete maintenance tools very efficiently.
two。 Use the stat command to view
The stat command is generally used to view the status information of a file. The output of the stat command is more detailed than the output of the ls command.
Oucanrong@zcwyou:~/iso$ stat ~ / iso/CentOS-6.10-x86_64-minimal.iso
File: / home/oucanrong/iso/CentOS-6.10-x86_64-minimal.iso
Size: 425721856 blocks: 831504 IO blocks: 4096 ordinary files
Device: 802h/2050d Inode:4471899 hard link: 1
Permission: (0664) Uid: (1000/oucanrong) Gid: (1000/oucanrong)
Last visit: 2018-12-23 21 purl 51purl 07.778850541 + 0800
Last modified: 2018-12-21 15 2414. 446276453 + 0800
Last modified: 2018-12-21 16 19 Vera 33.764230839 + 0800
Creation time:-
You can see that the file size is 425721856 bytes.
Linux uses the stat command to see the file size
3. Use the wc command
The wc command is generally used to count the information of a file, such as the number of lines of text and the number of bytes occupied by the file.
Oucanrong@zcwyou:~/iso$ wc-c ~ / iso/CentOS-6.10-x86_64-minimal.iso
425721856 / home/oucanrong/iso/CentOS-6.10-x86_64-minimal.iso
4. Use the du command
The du command is generally used to count the amount of space used by files and directories.
Oucanrong@zcwyou:~/iso$ du-h ~ / iso/CentOS-6.10-x86_64-minimal.iso
407M / home/oucanrong/iso/CentOS-6.10-x86_64-minimal.iso
5. Use the ls command
The ls command is generally used to view information about files and directories, including file and directory permissions, owners, corresponding groups, file size, modification time, path corresponding to files, and so on.
Oucanrong@zcwyou:~/iso$ ls-lh ~ / iso/ubuntu-18.04.1-live-server-amd64.iso
-rw-rw-r-- 1 oucanrong oucanrong 812m December 21 15:23 / home/oucanrong/iso/ubuntu-18.04.1-live-server-amd64.iso
You can see that the size of ubuntu-18.04.1-live-server-amd64.iso is 812m.
6. Use the ll command (which is actually an alias for ls-l)
In most Linux systems, the alias of ls-l has been set to ll, so there is no ll command, ll is just an alias command.
Linux uses the ll command to see the file size
Oucanrong@zcwyou:~/iso$ ll-h ~ / iso/ubuntu-18.04.1-live-server-amd64.iso
-rw-rw-r-- 1 oucanrong oucanrong 812m December 21 15:23 / home/oucanrong/iso/ubuntu-18.04.1-live-server-amd64.iso
The above is all the contents of the article "how to check file size in Linux". Thank you for reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more knowledge, welcome to follow the industry information channel!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.