12/10/2023 0 Comments If then bash grep curlWhile running these commands requires Terminal or an SSH, Hostinger VPS plans’ Browser terminal lets you run them directly via a web browser. You can also combine them with other commands, such as sort, grep, and exclude for a more specific output. These commands take various options to refine the output based on your needs, like -h, -m, and -k. The df command is used to check the disk usage of a file system, while du is for analyzing files or directories storage consumption. The df and du commands are important file management utilities in a Linux system. The –exclude=”.txt” argument tells the du command to display all file formats except. ![]() If you want to exclude a particular file format from the search results, use the following combination: du -h /home/user/Desktop/ -exclude="*.txt" If you want to list files over 1 MB, replace G with M. In this example, the script will output all files bigger than 1 GB. The grep command lets us search files based on a specified pattern. ![]() If you want to see all files beyond a certain size, the most effective way is to use the command below: du -h /home/user/Desktop | grep '^\s*\+G' If not careful, you might delete essential files that will break your project or virtual private server. Remember that you shouldn’t delete files solely based on their size. The combination should look like this: du -h /home/user/Desktop | sort -rn The script will sort all the files and folders by size in descending order to check the disk space usage in your Linux system. Then, pipe the result to the sort command with the -rn option. To sort files by size, run the du command to list files and folders on /Desktop in a readable format. To check another directory, change it accordingly. Important! We will use the /home/user/Desktop directory path for this tutorial. It also offers a graphical user interface (GUI) that simplifies the task for non-technical users. This feature is useful for a quick analysis since you can access it directly from your browser. For example, our custom hosting control panel hPanel has a built-in analytics tool showing your VPS storage space usage. Hostinger VPS hosting plans offer various features that help users efficiently manage their server’s disk space. How to Optimize Disk Space in Hostinger VPS df –help – displays a list of available options with their usage.du -h – time /home/user/Desktop – retrieves the last modification date of the displayed folders and files.Replace -m with -k to see the information in KB. du -m /home/user/Desktop – provides us with folder and file sizes in MB.du -sh /home/user/Desktop – gives us the total size of a specified folder, namely Desktop.du -h /home/user/Desktop – displays information in a human-readable format, similar to the -h option for the df command.du /home/user/Desktop – allows users to see the disk usage of their Desktop folders and files, including subdirectories.Here’s the syntax: du Ĭonsider these du command usage examples with the /Desktop directory: This SSH command requires you to specify which folder or file to check. The du or Disk Usage command will show files and directories’ disk usage on your Linux system. How to Check Disk Usage in Linux Using the du Command df – help – lists other options to use and their descriptions.In this example, it’s the /home file system. df /home – allows you to view information about a specific file system in a readable format.df -T – specifies the file system type in a new column.df -k – tells users the file system usage in KB.df -m – displays file system usage information in MB.df -h – shows the result in a human-readable format.Mounted On – tells us a particular file system’s mount point.Īdd an option to the df command for detailed disk space checking in Linux.Use% – displays the amount of used disk space in percentage.Available – specifies the remaining disk space in the file system. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |