Python Forum
search and store a value from linux command output in to variable python
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
search and store a value from linux command output in to variable python
#1
Hi I am a python bigginer, I have a scenario where I need to search and select a particular value from linux command "df -h".

dumpe2fs 1.42.13.x5 (23-Mar-2017)
Inode count: 786432000

In this above output I need to store the inode count number in to a variable to use it for further calculation.
Can anyone explain how to use python regular expressions to do the above task?
Reply


Messages In This Thread
search and store a value from linux command output in to variable python - by prazy29 - Apr-06-2018, 12:19 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Is possible to run the python command to call python script on linux? cuten222 6 710 Jan-30-2024, 09:05 PM
Last Post: DeaD_EyE
  Python VS Code: using print command twice but not getting output from terminal kdx264 4 1,068 Jan-16-2023, 07:38 PM
Last Post: Skaperen
  store all variable values into list and insert to sql_summary table mg24 3 1,123 Sep-28-2022, 09:13 AM
Last Post: Larz60+
  How to combine two output in one variable? ilknurg 2 1,179 Aug-01-2022, 09:31 AM
Last Post: Gribouillis
  How to write a part of powershell command as a variable? ilknurg 2 1,114 Jul-26-2022, 11:31 AM
Last Post: ilknurg
  Os command output in variable shows wrong value paulo79 2 1,501 Apr-09-2022, 03:48 PM
Last Post: ndc85430
  How to use a variable in linux command in python code? ilknurg 2 1,584 Mar-14-2022, 07:21 AM
Last Post: ndc85430
  Search text in PDF and output its page number. atomxkai 21 8,868 Jan-21-2022, 06:20 AM
Last Post: snippsat
  Store variable data and display sum after 60 seconds the_dude 11 3,432 Dec-16-2021, 07:07 PM
Last Post: deanhystad
  use subprocess on linux\pi wwith a "grep " command korenron 2 8,044 Oct-19-2021, 10:52 AM
Last Post: DeaD_EyE

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020