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.
Create Python Linux Script to Generate a Disk Usage Report
Taught in English
Instructor: David Dalsveen
4,712 already enrolled
Included with
Guided Project
Recommended experience
(63 reviews)
What you'll learn
Prepare the Python Script
Iterate through a directory structure using the Python script
Use a python package to generate a report in CSV format
Skills you'll practice
Details to know
Add to your LinkedIn profile
Guided Project
Recommended experience
(63 reviews)
See how employees at top companies are mastering in-demand skills
Learn, practice, and apply job-ready skills in less than 2 hours
- Receive training from industry experts
- Gain hands-on experience solving real-world job tasks
- Build confidence using the latest tools and technologies
About this Guided Project
Learn step-by-step
In a video that plays in a split-screen with your work area, your instructor will walk you through these steps:
Prepare the Python Script.
Use the __name__ to identify the main code and use sys.argv to access the command line arguments.
Create a for loop to access each sub-directory.
Create a function to determine the disk space used by each directory.
Use a python package to generate a report in CSV format.
Recommended experience
Learners should be familiar with some Python; variables and input/output, and the basic data structures. Some command line experience is recommended.
3 project images
Instructor
Offered by
How you'll learn
Skill-based, hands-on learning
Practice new skills by completing job-related tasks.
Expert guidance
Follow along with pre-recorded videos from experts using a unique side-by-side interface.
No downloads or installation required
Access the tools and resources you need in a pre-configured cloud workspace.
Available only on desktop
This Guided Project is designed for laptops or desktop computers with a reliable Internet connection, not mobile devices.
Why people choose Coursera for their career
Learner reviews
Showing 3 of 63
63 reviews
- 5 stars
63.49%
- 4 stars
23.80%
- 3 stars
9.52%
- 2 stars
1.58%
- 1 star
1.58%
New to Software Development? Start here.
Open new doors with Coursera Plus
Unlimited access to 7,000+ world-class courses, hands-on projects, and job-ready certificate programs - all included in your subscription
Advance your career with an online degree
Earn a degree from world-class universities - 100% online
Join over 3,400 global companies that choose Coursera for Business
Upskill your employees to excel in the digital economy
Frequently asked questions
By purchasing a Guided Project, you'll get everything you need to complete the Guided Project including access to a cloud desktop workspace through your web browser that contains the files and software you need to get started, plus step-by-step video instruction from a subject matter expert.
Because your workspace contains a cloud desktop that is sized for a laptop or desktop computer, Guided Projects are not available on your mobile device.
Guided Project instructors are subject matter experts who have experience in the skill, tool or domain of their project and are passionate about sharing their knowledge to impact millions of learners around the world.