1.3 “Materials” means software or other collateral Intel delivers to You under this Agreement. 1.2 “Intel Components” means a hardware component or product designed, developed, sold, or distributed by Intel or its affiliates. 1.1 “Including” means including but not limited to, whether or not capitalized. If You do not agree, do not use the Materials and destroy all copies. By downloading, installing, or using the Materials, You agree to these terms. If You are accepting this Agreement on behalf of or in conjunction with Your work for Your employer, You represent and warrant that You have the authority to bind your employer to this Agreement. ).Deprecated: Intel OBL Distribution (Commercial Use) License This LIMITED DISTRIBUTION LICENSE AGREEMENT (“Agreement”) is a contract between You and Intel Corporation and its affiliates (“Intel”). Finally, run the below bash command to execute your script ( temp_file_terminator.sh) from the working directory (. The /tmp directory is now below the maximum size of 2GB."Įcho "The /tmp directory is not large enough to trigger file deletion. # If the /tmp directory is still larger than the maximum size, delete all filesĮcho "All files in /tmp have been deleted."Įcho "Files in /tmp have been deleted. # Check the current size of the /tmp directoryĬURRENT_SIZE=$(du -sk /tmp | awk '') # Set a maximum size for the /tmp directory Otherwise, a message prints on the console without deleting a single file. If the size is larger than the maximum size declared, the code runs a command to delete all files in the /tmp directory. The code below checks the current size of the /tmp directory. Next, populate the code below to the temp_file_terminator.sh file, save the changes and close the file. Create a Bash script file with your preferred editor and name it as you like, but this tutorial’s choice is temp_file_terminator.sh.Ģ. Related: Your One and Only Linux Shell Scripting Tutorialġ. In this example, you will create a script to check your disk space and delete unnecessary files automatically. So why not automate the task with a script? Why? Running out of disk space causes problems for programs that need to write temporary files.īut manually checking your disk space becomes a tedious task in the long run. Monitoring directories you do not want to be inflating helps keep your system at its peak. Sudo rm -f test2.img Automating Disk Space Checking and File Deletion Moreover, filesystem repairs may cause data loss, so back up your data before proceeding. □ Note that filesystem checks take some time, especially if the volume is large or there are many problems with the filesystem. This option performs a filesystem check on the volume, which can help identify and fix any problems, such as corruption or inconsistencies with the filesystem. The label or name of a partition is a short, descriptive string that identifies the partition on your system. This option lets you change the label or name of a partition on your system. This option is useful when you plan to reinstall your OS.Įditing the partition allows you to change the partition’s size, format, and filesystem type without deleting any data. Some of the actions you can take include but are not limited to the following: Optionįormatting a partition erases all its data and creates a new empty filesystem. Lastly, click the gear icon and choose any option you wish to perform from the context menu. Search for and open the Disks app, as shown below.ģ. To see the Disks app in action with disk space management, follow these steps:ġ. The Disks app provides a visual representation of disk usage, which is intuitive for users who prefer a GUI when working with files and directories. So long as the gnome-disk-utility is installed, you can access the Disks app. If you are looking for a quick way to work on disk space management, GNOME-based desktop environments like Ubuntu have a default graphical partitioning tool. Related: How to Install Ubuntu 20.04 Using the Disk App This tutorial uses Ubuntu 20.04, but other versions will work. To follow along, be sure you have an Ubuntu system. This tutorial will be a hands-on demonstration. Read on and say goodbye to disk space anxieties with Ubuntu! Prerequisites This comprehensive guide will provide many tools for managing your Ubuntu disk space, including installing and using various tools and techniques. But without proper attention and maintenance, your Ubuntu disk space can quickly become cluttered and run out of room. As an efficient and user-friendly operating system (OS), Ubuntu offers numerous tools and techniques to manage disk space and keep your system running smoothly.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |