How create 2 GB file in Linux?
Linux / UNIX: Create Large 1GB Binary Image File With dd Command
- fallocate command – Preallocate space to a file.
- truncate command – Shrink or extend the size of a file to the specified size.
- dd command – Convert and copy a file i.e. clone/create/overwrite images.
- df command – Show free disk space.
How do I find the top 10 files in Linux?
Find the Largest Top 10 Files and Directories On a Linux
- du command : It estimates 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 : It Searches file on Linux machine.
How create 10 GB file in Linux?
How to Create a Large File in Linux
- Using dd. dd is the most common way to create large files in Linux. Here is the command to create file data.
- Using Truncate. You can also use truncate command to create large files.
- Using fallocate. fallocate is the best method to create large files.
How do I find the top 10 space consuming files in Linux?
The procedure to find largest files including directories in Linux is as follows:
- Open the terminal application.
- Login as root user using the sudo -i command.
- Type du -a /dir/ | sort -n -r | head -n 20.
- du will estimate file space usage.
- sort will sort out the output of du command.