
Explore de jure, de facto, and community standards within dev ops and how cross-platform standards enable Python scripts to run on Linux, Windows, and beyond.
Introduce dev ops concepts, best practices, and the files and paths, outlining three major themes to guide ongoing software development in operational realms.
Define dev ops by comparing development and operations, using a truth table, and explore how Python scripting enables cross-platform automation for reliable, ongoing operations.
Explore the key dev ops roles and responsibilities, from developers and operators to requirements gatherers, scribes, architects, and managers, and how stakeholders and customers shape software delivery.
Explore essential linux commands and shells in a devops context, using sigwin on Windows, and master ls options, clear, whoami, pwd, and man for hands-on shell proficiency.
Navigate the linux filesystem from the home directory using ls and man, understand inodes and directories, and perform recursive listings with ls -R and file names, times, and dates.
Master interpreting ls -la output in Linux, distinguish directory vs file, and decode permissions for user, group, and others, including links, inode, owner, size, and timestamp.
Echo text with proper quoting to control variable expansion, including the path variable, and compare how Linux and Windows handle path separators and slashes.
Learn to create and view files with echo and cat, concatenate multiple files, use wildcards to match text files, and practice a starter set of commands.
Install sig win support on your path to run its commands from Windows or Linux-like systems. Update your bin path and explore a Python solution to who am I.
Explore how to leverage Python in dev ops to run shell commands on Linux and Windows, using the Popen interface, and manage basics like whoami, ls, clear, and chmod.
Learn to use Popen from the os module to run commands like ls -la and explore ANSI escape sequences for terminal control across Linux and Windows.
Collaborate by creating three text files in your current directory, then use the concatenation command to merge them and display the combined output in a Python program.
Learn how to re-use the cat command from Python to concatenate files across Windows and UNIX, manage present working directories, and handle cross-platform line endings for dev ops.
Review Linux commands and DevOps automation across research, integration, and testing phases, emphasizing DevOps balance. Practice cross-platform commands and automate research using Python.
Learn to use stat, touch, and chmod to manipulate files, folders, and nodes, enabling DevOps automation and cross-platform integration of Python and ops tooling.
Learn to open, read, and write files in Python, inspect metadata with stat, and manage timestamps with touch and chmod across platforms.
Use Python's os.stat() to retrieve file metadata—user and group IDs, times, mode, size, links, attributes, and device—across platforms. Decode timestamps and inspect a file's creation date and size.
Explore how to complete an os.stat() based solution by printing the SD size and a formatted string with year, month, and day fields, ensuring accurate reporting and proper line endings.
Learn to use mv and rm for file management, understand whatis return codes, and leverage the backup option and Python's subprocess.Popen to run commands efficiently in DevOps workflows.
Explore how to use locate, whereis, and find on Linux systems (Ubuntu/Debian styles) to navigate directories, create and remove folders, and manage files with wildcards and recursive delete.
Explores using os.popen to manage directories, inspect return codes, and run shell commands, while comparing native Python, the shell, and external commands on the system path.
Learn to locate external commands across multiple versions with whereis, locate, and find, and compare Unix path search with Windows attribute search on the C drive.
Master how locate and find differ in speed and scope by indexing file systems, and learn to use update db to maintain a fast, searchable database for devops searches.
Compare python tooling with posix commands for locating files, using updatedb, locate, and find. Time and justify whether to use os.popen, python workflows, or os.walk for devops tasks.
Explore timing of database creation and file search operations. Compare locate, find, and Python walks across Linux, Windows, and POSIX to reveal cross-platform performance differences.
Explore unlink's system call across C, C++, and Python, including open and file descriptor usage, and use cal for calendars with file comparison via cmp.
Master hex dumps and ASCII views with the od utility, switching between hexadecimal and ASCII representations, and practice piping output to more or a file for quick data inspection.
Explore how the cmp command compares two files byte by byte to reveal differences and offsets, then use pipes and the more command for hex dumps and text views.
Explore line-oriented Linux commands for comparing and sorting files, using sort on input files and comm and uniq to find differences and common lines, with piping and options 1–3.
Explore how diff and delta notation detect changes between two or three files, produce prescriptive line changes, and reveal explicit differences with left and right syntax across platforms.
Explore how to use cut and paste commands and piping from cow to cut, using 1-based column identifiers and the -c option to extract multiple columns.
Join two text files side-by-side with the paste command using a tab delimiter, compare inputs via a pipe, and apply Python-like slicing to extract Friday columns from a calendar file.
Demonstrate extracting columns 15, 37, and 59 from a text file using POSIX cut -c, and reproduce the same results with Python slicing in a lab.
Explore a challenger solution that creates a file in a Windows directory, uses shell true, and applies zero-based Python slicing to extract columns 14–17, 36–39, 58–61 with zero return code.
Compare textual and graphical interfaces for ops tools, and build a Python logging demo using argv parameters, datetime, RFC formatting, and static methods.
Learn to run a Python program with command line arguments by importing os, printing received parameters, and handling sys.argv on Windows and POSIX systems, including shebang execution.
Explore how to use Python's argparse module to define and parse command-line arguments, including short and long options, help strings, and simple actions like store_true for practical devops.
Use python's argparse to drive create and list operations in the main loop, with default boolean values and a crud workflow, while logging to the present working directory logger.log.
Explore how to model and implement create, read, update, delete, and search operations for log messages using a console-based approach with arg parse, including handling messages, remainders, and help.
There are many ways to test a Command Line Interface (C.L.I.)
Testing our classical CREATE (-c) option first, allows us to review two (2) of the more automated ways to "inject" command line parameters into ezlog.py.
When using a classic text file, listing the content is easy to do.
But which line should be #1 - the first, or last, entry?
When all log entries are not the same length, updating any entry requires the entire log file to be re-written. Be sure to see the attached resource for a right-to-re-use way to make updating small log files (under 5000 lines, or so) ... 'e-z!
Note: Converting ezlog to use a database technology - such as SQLite - would be a great way to support EZU-4000 quickly, for much larger files.
Having previously completed the Update Operation, deleting an entry from the log file is easy ...
Searching need not be complex. -Rather than including Regular Expressions (REs,) classic Wildcards, or negations, we decided to simply check to see if a log entry contains a partial string-match.
Asking our users questions such as "what do you mean by 'help' " -sound so silly, that we often avoid their asking.
Indeed, until after the 'Ops folks have had a chance to review what 'Dev has done for them, there may be a good deal of work ... yet ... to be done?
Here is the process - in review.
Python and Linux are two things that all popular DevOps strategies have in common.
By discovering how to use GNU Linux commands under Python 3, you will discover where you can start enjoying some of the many speed-up by "going native".
Focusing upon automating operating system activities, Python 4000: Linux Commands & DevOps Automation explorers will also spend some quality time demystifying the DevOps experience, as well as well as how to take advantage of using POSIX under Modern Python.
DevOps Realms
From AIX, Linux, Android, and macOS, to the Microsoft Windows Operating Systems, if you are confused about exactly what folks might mean when they say "POSIX" or "DevOps," then this training is for you.
Software developers wanting to know how to run Linux & GNU commands on the Microsoft Windows Operating Systems via Cygwin will also enjoy this educational offering. -The more operating system you have to work on, the better you'll like Python 4000: Linux Commands & DevOps Automation!
You'll also enjoy many hands-on practice activities.
Standards?
Much like Python itself, the P.O.S.I.X standards assure us that we can write our DevOps automation routines once, and then run them as far and wide as possible. Even across an ever increasing number of operating systems!
Because standards matter, Python 4000: Linux Commands & DevOps Automation starts by defining the various type of standards we need to be aware of.
POSIX?
Discussing cross-platform DevOps automation often requires us to appreciate the formal standards, tools, and operating system conventions & commands that we can rely upon.
POSIX means having a compatible file system that allows us to have the classic embedded permissions, groups, user identifiers, as well as file names which include special 'ops characters (e.g. os.pathsep, os.sep) and other common conventions.
Both in terms of definition as well as compliance, the Portable Operating System Interface (POSIX Standard) has been growing since 1996. Most Operating Systems - even Microsoft Windows - support various levels of POSIX compliance.
DevOps Power-Up
While Python is fast, Operating System commands are usually faster.
The POSIX Standard also includes the definition and inclusion of over 159 command-line utilities, as well as user-interface 'shells.' Each a powerful performance power-up that DevOps can re-use from within the Python programming world.
Ultimately, using standardized POSIX commands represent an OS-quick, DevOps opportunity that allows us to work on many different Unix-inspired operating systems so as to not be concerned about what flavor of Linux we're running.