博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
Portable way to get file size (in bytes) in shell?
阅读量:7173 次
发布时间:2019-06-29

本文共 441 字,大约阅读时间需要 1 分钟。

 

du -b file

3

 

 

On Linux, I use stat --format="%s" FILE, but Solaris I have access to doesn't have stat command. What should I use then?

I'm writing Bash scripts, and can't really install any new software on the system.

I've considered already using:

perl -e '@x=stat(shift);print $x[7]' FILE

or even:

ls -nl FILE | awk '{print $5}'

But neither of these looks sensible - running Perl just to get file size? Or running 2 commands to do the same?

转载地址:http://jqbzm.baihongyu.com/

你可能感兴趣的文章
Lua------------------unity与lua的热更新
查看>>
【Win 10 应用开发】UI Composition 札记(一):视图框架的实现
查看>>
JavaScript面向对象总结
查看>>
分布式系统理论基础,以及选举,多数派,租约
查看>>
Breadth-first search 算法(Swift版)
查看>>
Vue.js系列之四计算属性和观察者
查看>>
pycharm 对代码做静态检查
查看>>
Python的sys.argv使用说明 通过终端写入环境变量
查看>>
在Windows上安装Nexus
查看>>
用mysql查询某字段是否有索引
查看>>
ubuntu 查看进程,查看服务
查看>>
Cisco DHCP Snooping + IPSG 功能实现
查看>>
Linux命令_用户身份切换
查看>>
学习在.NET Core中使用RabbitMQ之启动和基础(一)
查看>>
支付业务的数据库表的设计
查看>>
php面试题二--解决网站大流量高并发方案(从url到硬盘来解决高并发方案总结)...
查看>>
PHP 16 个编程法则
查看>>
【微信】2.微信小程序开发--官方开发工具使用说明
查看>>
RedisTemplate访问Redis数据结构
查看>>
面试如何回答优化数据库
查看>>