Debug School

rakesh kumar
rakesh kumar

Posted on

Linux: how to display disk space usage of all mounted filesystems to remove corrupted file

step 1 : move directory where XAMPP logs are stored

cd /opt/lampp/var/log/
Enter fullscreen mode Exit fullscreen mode

This command changes the current directory to /opt/lampp/var/log/, which is the directory where XAMPP logs are stored. Logs are crucial for troubleshooting and monitoring the activities of various services like Apache, MySQL, etc.
step2:ists the contents of the current directory

ls 
Enter fullscreen mode Exit fullscreen mode

Lists the contents of the current directory, which in this context would typically show log files for Apache, MySQL, and other services managed by XAMPP.
step3:move to directory

cd .. 
Enter fullscreen mode Exit fullscreen mode

Moves up one directory level from /opt/lampp/var/log/ to /opt/lampp/var/. This command is often used to navigate through directories without having to type the full path.
step5: see different type of directory

ls 
Enter fullscreen mode Exit fullscreen mode

Again lists the contents of the current directory, now /opt/lampp/var/, to view the different types of directories and files present there.
step6:move to directory where contain logs specifically for the MySQL service
cd mysql/ :
Changes the directory to the mysql/ subdirectory within /opt/lampp/var/, which is likely to contain logs specifically for the MySQL service.
ls:
Lists the contents of the MySQL log directory, likely showing different log files related to MySQL operations.
step5:remove large, corrupted file, or no longer needed to free disk space

ls -la
Enter fullscreen mode Exit fullscreen mode

This command lists all contents of the current directory (-a includes hidden files) in a detailed format (-l shows permissions, ownership, size, and modification date), providing a comprehensive view of the files, including details often needed for troubleshooting.

rm ip-172-31-4-145.err
Enter fullscreen mode Exit fullscreen mode

Image description

step7:restart xampp service
Removes (deletes) the file named ip-172-31-4-145.err from the current directory. This might be a log file that is either too large, corrupted, or no longer needed.

/opt/lampp/lampp restart\
Enter fullscreen mode Exit fullscreen mode

This command restarts the XAMPP services, which might include Apache, MySQL, and others. Restarting is common after making changes to configurations or clearing logs to ensure that services run with the latest updates.
step8:Displays disk space usage of all mounted filesystems in a human-readable format**

df -kh 
Enter fullscreen mode Exit fullscreen mode

Image description

Displays disk space usage of all mounted filesystems in a human-readable format (-h for human-readable, -k forces units in KB where applicable). This is useful for checking the space left on the device, which could be critical after dealing with large log files or before restarting services.
history (Command 2045):
This command lists the history of commands entered in the terminal session. It’s useful for reviewing or repeating past commands or for debugging purposes.

Top comments (0)