Mathematical commands bc, expr, factor, units in Linux in Hindi

Linux mein mathematical calculations aur unit conversions ke liye kuch commands available hain, jaise bc, expr, factor, aur units. Main aapko in commands ke bare mein thoda detail mein bataunga:

Mathematical commands bc, expr, factor, units in Linux in Hindi

1. bc Command (Basic Calculator):

  • bc command ek basic calculator ko run karne ke liye hota hai. Iska istemal complex mathematical calculations ke liye kiya ja sakta hai.
  • bc command ko terminal mein run karte samay, aap interactive mode mein mathematical expressions likh sakte hain ya ek file se calculations kar sakte hain. Example (Interactive Mode):
   bc
   3 + 5

Example (Using File):

   echo "3 + 5" | bc -l

2. expr Command (Expression Evaluation):

  • expr command ek shell built-in command hai, jiska istemal arithmetic expressions evaluate karne ke liye hota hai.
  • expr command ka istemal mainly shell scripts mein kiya jata hai. Example:
   result=$(expr 3 + 5)
   echo $result

3. factor Command (Prime Factors):

  • factor command ka istemal ek number ke prime factors ko display karne ke liye hota hai. Example:
   factor 24

Is example mein, factor command 24 ke prime factors ko display karega.

4. units Command (Unit Conversion):

  • units command ka istemal different units (e.g., length, mass, volume) ke conversions ke liye hota hai.
  • Aap units command ko interactive mode mein use kar sakte hain, jahan aap different units mein values convert kar sakte hain. Example (Interactive Mode):
   units
   You have: 10 feet
   You want: meters

Is example mein, units command 10 feet ko meters mein convert karega aur result display karega.

In commands ka istemal Linux terminal mein mathematical calculations aur unit conversions ke liye hota hai. Aap in commands ke documentation aur man pages ko man command se padhkar inka istemal sikh sakte hain.

Leave a Comment