Posts

Showing posts from October, 2019

Determine OS version from Command line in MacOS

Image
Sometimes we would like to know about the installed MacOS from Terminal. Or say we are writing scripts to extract the OS related information like it's version and release name etc. For Mac we have couple of options System Profiler Execute the following command from Terminal system_profiler As you can see from the screenshot system_profiler will print a lot of information about the Software and Hardware of the Mac. This is it..... sw_vers Execute the following command from Terminal sw_vers As you can see from the screenshot sw_vers will print information about the current installed OS Name and Version.

How to change computer name and user name in terminal command prompt in MacOS

Sometimes we want to hide the system name or username that is displayed on the Terminal. May be to take some screenshot and then paste it in the blog and we want to hide the System name/user Name etc. For Bash based terminals it can be done by setting PS1 variable. Example on the terminal $ export PS1="> " > $ PS1="Mac:~sidd:" Mac:~sidd: $ export PS1="This is Demo Terminal: $ " This is Demo Terminal: $ Change your prompt in your  profile file to make it permanent across all Terminals and new sessions.

How to Install Apache 2 on Ubuntu Linux

Following are the steps to install Apache 2 on Ubuntu Linux and then start it. Update the System Repository sudo apt update Install Apache2 Software with apt command sudo apt install apache2