Tip: How to quickly fill whole disk space in Linux with one command ?

Today lets have a look at a short tip to quickly fill complete disk space of our hard drive in Linux with a single command.

It is an interesting and quick tip and the command “yes” is usually available on most of Linux flavors.

[root@nglinux ~]# df -h /
Filesystem      Size  Used Avail Use% Mounted on
/dev/sdb1       7.8G  6.0G  1.4G  82% /

[root@nglinux ~]# date; nohup yes; date
Tue Apr 23 22:48:15 PDT 2019
nohup: ignoring input and appending output to `nohup.out'
Tue Apr 23 22:50:37 PDT 2019
[root@nglinux ~]# 

[root@nglinux ~]# df -h /
Filesystem      Size  Used Avail Use% Mounted on
/dev/sdb1       7.8G  7.8G     0 100% /

[root@nglinux ~]# du -sh nohup.out 
1.8G	nohup.out

 

# nohup yes;
Make sure not to run this command on production server, otherwise it can bring the app down.
The command fills nohup.out file till space is filled.

Leave a Reply

avatar
  Subscribe  
Notify of