Monitorowanie zasobów systemowych: `df`, `du`, `free`
Nauczą się Państwo sprawdzać miejsce na dysku, rozmiary katalogów i wykorzystanie pamięci, aby utrzymać optymalną pracę systemu.
Monitorowanie zasobów systemowych: `df`, `du`, `free` to bezpłatna lekcja Linux Command Line Mastery na CoddyKit. To lekcja 3 z 4. Możesz przeczytać całą lekcję poniżej za darmo — a potem ćwiczyć ją interaktywnie w przeglądarce z wbudowanym edytorem kodu i tutorem AI dostępnym 24/7. To część ścieżki edukacyjnej Linux Command Line Mastery, a Twój postęp synchronizuje się między webem a aplikacją CoddyKit. Kurs Linux Command Line Mastery zawiera 4 lekcji w sumie.
Części tej lekcji nie zostały jeszcze przetłumaczone i są wyświetlane po angielsku.
Why Monitor System Resources?
Keeping an eye on your system's resources is crucial for smooth operation. Just like a car needs fuel and oil, your computer needs enough disk space and memory to run efficiently.
Ignoring these can lead to slow performance, crashes, or even data loss.
Check Disk Space with `df`
The df command, short for "disk free", reports the amount of available disk space used by file systems.
It's your go-to command to see how much room is left on your partitions.
`df` Command in Action
Let's try df with the -h option for human-readable output. This makes sizes like gigabytes (GB) and megabytes (MB) easy to understand.
Run this command in your terminal:
df -hInterpreting `df` Results
The output of df -h shows several columns:
- Filesystem: The name of the disk partition.
- Size: Total capacity of the partition.
- Used: Space currently occupied.
- Avail: Remaining free space.
- Use%: Percentage of disk space used.
- Mounted on: Where the filesystem is accessible in the directory tree.
Disk Usage with `du`
While df shows overall disk free space, du ("disk usage") estimates file space usage, primarily for specific files or directories.
It helps you find out which folders are taking up the most space.
`du` on a Directory
To see the total size of a directory in a human-readable format, use -s (summary) and -h (human-readable) with du. Replace /var/log with any directory you want to check.
du -sh /var/logDetailed `du` Output
Want to see the size of subdirectories within a folder? Use --max-depth=N to limit the depth of the output. Here, we'll see direct subdirectories (depth 1).
du -h --max-depth=1 /home/userMonitor Memory with `free`
Memory (RAM) is vital for your system's speed. The free command displays the total amount of free and used physical and swap memory in the system.
Keeping an eye on free memory helps prevent slowdowns.
`free -h` in Practice
Similar to df, using the -h option with free provides output that's much easier to read. It shows memory in KB, MB, or GB.
free -hResource Monitoring Check
You're running low on disk space and want to find which large directories are consuming it. Which command is best suited for this task?
Recap: System Resources
Great job! In this lesson, you learned how to monitor your Linux system's vital resources:
df: Check overall disk free space.du: Estimate disk usage for files and directories.free: Monitor physical and swap memory usage.
These commands are essential tools for maintaining a healthy and optimized system!
Często zadawane pytania
Czy lekcja „Monitorowanie zasobów systemowych: `df`, `du`, `free`” jest bezpłatna?
Tak — pełny tekst „Monitorowanie zasobów systemowych: `df`, `du`, `free`” jest dostępny za darmo tutaj w sieci. Aby ćwiczyć ją interaktywnie (wbudowany edytor kodu i tutor AI dostępny 24/7) i odblokować resztę kursu Linux Command Line Mastery, przejdź na CoddyKit PRO. Kurs Linux Command Line Mastery zawiera 4 lekcji w sumie.
Co nauczysz się w „Monitorowanie zasobów systemowych: `df`, `du`, `free`”?
Nauczą się Państwo sprawdzać miejsce na dysku, rozmiary katalogów i wykorzystanie pamięci, aby utrzymać optymalną pracę systemu. Ćwiczysz Linux Command Line Mastery z praktycznym kodem, który uruchamiasz bezpośrednio w przeglądarce, a tutor AI dostępny 24/7 odpowiada na Twoje pytania podczas pracy nad lekcją.
Czy potrzebuję doświadczenia, aby zacząć Linux Command Line Mastery?
Nie wymagamy żadnego doświadczenia. Linux Command Line Mastery w CoddyKit jest strukturyzowany dla początkujących i zaawansowanych użytkowników, więc możesz zacząć tutaj lub od początku i uczyć się w swoim tempie. To lekcja 3 z 4.
Ile czasu zajmuje lekcja „Monitorowanie zasobów systemowych: `df`, `du`, `free`”?
Większość lekcji CoddyKit trwa około 5–10 minut. Każda lekcja to mały, interaktywny krok, dzięki czemu robisz systematyczne postępy i zawsze wracasz dokładnie do tego samego miejsca — na webie i w aplikacji.
Czy mogę pisać i uruchamiać kod w tej lekcji Linux Command Line Mastery?
Tak. Każda lekcja Linux Command Line Mastery zawiera wbudowany edytor kodu, więc piszesz i uruchamiasz prawdziwy kod bezpośrednio w przeglądarce i od razu otrzymujesz sprzężenie zwrotne od AI — bez konfiguracji na komputerze.
Wszystkie lekcje w tym kursie
- Poznawanie procesów: `ps`, `top`, `htop`
- Zarządzanie procesami: `kill`, `bg`, `fg`
- Monitorowanie zasobów systemowych: `df`, `du`, `free`
- Priorytety procesów za pomocą nice, renice i sygnałów