Create Python Linux Script to Generate a Disk Usage Report

4.5
49 个评分
提供方
Coursera Project Network
3,967 人已注册
在此指导项目中,您将:

Prepare the Python Script

Iterate through a directory structure using the Python script

Use a python package to generate a report in CSV format

Clock1 hour
Intermediate中级
Cloud无需下载
Video分屏视频
Comment Dots英语(English)
Laptop仅限桌面

There are many choices when it comes to writing scripts on Linux. The bash shell script has been a popular choice, since the bash shell itself is a programming language and the commands used in the script match the syntax of the shell. Python is becoming increasingly popular for scripting on Linux because of its simple syntax, easy access to Linux system commands, and powerful libraries with which to create reports, for example. In addition, Python can be used in other applications and on multiple platforms, so there is also the benefit of learning one language for many programming requirements. In this course, you will create a Python script in which you will determine disk space and generate a report on disk usage on an Ubuntu Linux system. Note: This course works best for learners who are based in the North America region. We’re currently working on providing the same experience in other regions.

您要培养的技能

Linux Disk UsagePandasCommand LinePython ScriptingComputer Programming

分步进行学习

在与您的工作区一起在分屏中播放的视频中,您的授课教师将指导您完成每个步骤:

  1. Prepare the Python Script.

  2. Use the __name__ to identify the main code and use sys.argv to access the command line arguments.

  3. Create a for loop to access each sub-directory.

  4. Create a function to determine the disk space used by each directory.

  5. Use a python package to generate a report in CSV format.

指导项目工作原理

您的工作空间就是浏览器中的云桌面,无需下载

在分屏视频中,您的授课教师会为您提供分步指导

审阅

来自CREATE PYTHON LINUX SCRIPT TO GENERATE A DISK USAGE REPORT的热门评论

查看所有评论

常见问题

常见问题

还有其他问题吗?请访问 学生帮助中心