Linux Mac 常用命令合集(持续更新中)

311 阅读1分钟

1. 文件Rename

最简单的方式是使用mv命令

mv (option) filename1.ext filename2.ext

参考实例:

➜  shell-learning ll
total 8
-rw-r--r--  1 USER  staff  31 Apr 23 10:59 helloworld
➜  shell-learning mv helloworld helloworld.sh
➜  shell-learning ll
total 8
-rw-r--r--  1 USER  staff  31 Apr 23 10:59 helloworld.sh
➜  shell-learning

2.查看文件夹容量

使用du命令可以实现查看文件夹和文件的size 参考实例:

人性化的方式为

~/Documents/  11:30:24
$ du -sh .
124G	.

如果你脑路清奇的话,也可以试试

~/Documents/  11:30:20
$ du -s .
261029384	.