Th Most Handy du (Disk Usage) Commands in Linux
- du -g. ...
- du -L. ...
- du -a. ...
- du /path/to/file.txt. ...
- du -X FILE. ...
- du --exclude="*.o" Exclude files and subdirectories as specified by the pattern. ...
- du --threshold=SIZE. Exclude entries smaller than SIZE if positive, or entries greater than SIZE if negative. ...
- du -d N. Set the maximum depth to N folders.
- What is the use of DU command in Linux?
- How do I find my top 10 disk usage Linux?
- How do I see disk usage in Linux?
- What is the command to display the disk usage of the given directory?
- What is difference between DU and DF?
- What is PS EF command in Linux?
- What is the command to remove a directory in Linux?
- How do I list the first 10 files in Linux?
- How do you clear the cache in Linux?
- What are the commands in Linux?
- What does DF do in Linux?
- How do I find CPU in Linux?
What is the use of DU command in Linux?
The du command is a standard Linux/Unix command that allows a user to gain disk usage information quickly. It is best applied to specific directories and allows many variations for customizing the output to meet your needs.
How do I find my top 10 disk usage Linux?
Steps to find Largest Directories in Linux
- du command : Estimate file space usage.
- sort command : Sort lines of text files or given input data.
- head command : Output the first part of files i.e. to display first 10 largest file.
- find command : Search file.
How do I see disk usage in Linux?
- How much space do I have free on my Linux drive? ...
- You can check your disk space simply by opening a terminal window and entering the following: df. ...
- You can display disk usage in a more human-readable format by adding the –h option: df –h. ...
- The df command can be used to display a specific file system: df –h /dev/sda2.
What is the command to display the disk usage of the given directory?
The du command stands for disk usage. This command is included by default in most Linux distributions. The system should display a list of the contents of your home directory, with a number to the left.
What is difference between DU and DF?
The (very complicated) answer can be best summarized like this: The df command provides a sweeping ballpark figure for how much space is being utilized on your filesystem as a whole. The du command is a much more accurate snapshot of a given directory or subdirectory.
What is PS EF command in Linux?
This command is used to find the PID (Process ID, Unique number of the process) of the process. Each process will have the unique number which is called as PID of the process.
What is the command to remove a directory in Linux?
How to Remove Directories (Folders)
- To remove an empty directory, use either rmdir or rm -d followed by the directory name: rm -d dirname rmdir dirname.
- To remove non-empty directories and all the files within them, use the rm command with the -r (recursive) option: rm -r dirname.
How do I list the first 10 files in Linux?
Listing multiple files on a single line
The ls command even has options for that. To list files on as few lines as possible, you can use --format=comma to separate file names with commas as in this command: $ ls --format=comma 1, 10, 11, 12, 124, 13, 14, 15, 16pgs-landscape.
How do you clear the cache in Linux?
How to Clear Cache in Linux?
- Clear PageCache only. # sync; echo 1 > /proc/sys/vm/drop_caches.
- Clear dentries and inodes. # sync; echo 2 > /proc/sys/vm/drop_caches.
- Clear PageCache, dentries and inodes. # sync; echo 3 > /proc/sys/vm/drop_caches. ...
- sync will flush the file system buffer.
What are the commands in Linux?
which command in Linux is a command which is used to locate the executable file associated with the given command by searching it in the path environment variable. It has 3 return status as follows: 0 : If all specified commands are found and executable.
What does DF do in Linux?
The 'df' command stands for “disk filesystem“, it is used to get a full summary of available and used disk space usage of the file system on Linux system.
How do I find CPU in Linux?
9 Useful Commands to Get CPU Information on Linux
- Get CPU Info Using cat Command. ...
- lscpu Command – Shows CPU Architecture Info. ...
- cpuid Command – Shows x86 CPU. ...
- dmidecode Command – Shows Linux Hardware Info. ...
- Inxi Tool – Shows Linux System Information. ...
- lshw Tool – List Hardware Configuration. ...
- hardinfo – Shows Hardware Info in GTK+ Window. ...
- hwinfo – Shows Present Hardware Info.