write counts for all files, not just directories -h, --human-readable print sizes in human readable format (e.g., 1K 234M 2G) du -h --max-depth=1 du -h --max-depth=2 | sort -n sort: -n, --numeric-sort compare according to string numerical value -r, --reverse reverse the ...
-h或--human-readable 以K,M,G为单位,提高信息的可读性。 -x或--one-file-xystem 以一开始处理时的文件系统为准,若遇上其它不同的文件系统目录则略过。 -L<符号链接>或--dereference<符号链接> 显示选项中所指定符号链接的源文件大小。 -S或--separate-dirs 显示个别目录的大小时,并不含其子目录的大小。
[root@localhost ~]# find /root/ -name "filetest" -exec grep "halt" {} \; #halt:x:7:0:halt:/sbin:/sbin/halt 1. 2. find命令与sed命令连用,找出/root下以filetest的文件,找出以halt的行,将它的以#开头的注释删除掉 [root@localhost ~]# find /root/ -name "filetest" -exec grep "halt...
linux中的一些基础命令的使用(which,whereis,locate,find,alias,file,ls,cat,echo,tar,bzip2,gzip,history,mv,cp,rm) which whereis locate find alias file ls cat echo tar bzip2 gzip history mv cp rm --- linux下的查找命令which,whereis,locate which主要是用来查找命令的,而且只是在特定的目录下查找(...
Running du on a disk or directory outputs the total allocated space for each subfolder and file in human-readable format. First , invoke the command below which will enable you to switch to root : sudo-i And then execute : sudo du -a /home | sort -n -r | head -n 20 ...
Read:How to display the contents of a text file on the terminal in Linux/Ubuntu Conclusion If you’re using Ubuntu and need to find the total size of all files in a directory, there are plenty of ways to do it! You can use the du command, which is pretty easy to use, or the fi...
-exec du -h {} +: For each file found, it executes the du -h command to get the file sizes in human-readable format. sort -rh: This sorts the output in reverse order (-r) based on the numeric value (-h for human-readable sizes). ...
file find grep 1. Introduction In Linux, there are two types of files: binary and text. Text files are human-readable, while binary files contain machine-readable binary data that is usually executable. In this tutorial, we’ll look at how to find the binary files in a given directory an...
-h tells the command that the data to process is in human readable format. -r makes the sort command order the data in reverse format The output will be as follows:
4. Checking/procFilesystem for Memory Leak Data The/procfilesystem in Linux provides detailed information about running processes.Linux maps all the running processes to the filesystem, which we can access through the/procdirectory. We can access memory-related data for any running process directly...