After growing up on Windows computers, I bought my first Macbook. My reasoning behind this is being a Unix-based system and I knew at some point I would be using Linux. Linux is also a Unix based system that relies on heavy use of the Command Line Interface or CLI. This is primarily how you install, navigate and manage your files. In your CLI you have a package manager. Each type of Linux distribution has package manager. Red Hat distributions like Fedora and CentOS us Dandified Yum, DNF. This is an upgrade from their previous package manager, YUM. The file extension for the packages are .rpm. Debian based systems like Ubuntu and Linux Mint have Advanced Package Tool, APT. APT manages files that end with the extension .deb but sometimes you have to use apt-get instead of apt. Arch users use Pacman and use the Arch User Repository, AUR. There are also universal package managers that can be used on all distributions of Linux like Snap and Flatpak.
Power Shell is an upgrade from Windows previous CLI system called DOS. Recent versions of Windows like 10 and 11 don’t require DOS but they emulate DOS through Windows Command prompt.The problem with the Windows Command Prompt is that it is limited. Power Shell the CLI functions as both a management tool and scripting language. Microsoft has added thousands of Powershell commands with support for adding additional commands.
PowerShell uses commands start with a verb followed by a dash and a noun. An example of this would be Get-help. PowerShell supports the same DOS commands that you know and love but they are just aliases to the modern commands. PowerShell also allows the user to build GUI interfaces by making calls to .NET.
Bash is an environment that can interact directly with your OS. It has many similarities to PowerShell but it was designed for use in Linux environments. In recent years, Bash has been used in Windows environements as well via the Windows Subsystem for Linux, WSL. WSL has made it possible to install Linux distrubutions on Windows machines. You can even call the shell system from the file explorer. In the past, this would require the install of Cygwin Bash program to use the shell on a Windows computer. The problem with Cygwin was that it did not offer a native Bash experience.
What makes the Unix CLI systems different from the Windows is they use Power shell scripting while Unix uses Bash Shell scripting. PowerShell is more of a configuration tool that turns the Linux CLI into a point and click solution in Windows. PowerShell can be used for scripting but it is mainly used to manage Windows environements at scale. Bash is tailored towards development environments. Many modern development tools are Linux-first tools like Python, Ruby and Git.
Powershell enables admins to edit the registry for Microsoft’s Azure. The Bash Shell does not offer these capabilities in Windows. It also processes XML easily.
The true value of Powershell and Bash all come down to the user. If you are working in a Windows system, Powershell will be used to write most scripts. Bash can’t access many of the Windows apps natively. Bash is great for managing text files in a scripting environment but the real strength in Bash is manging through API’s not files. Importing Linux code into Windows machines and developing the code is where Bash shines the most.
Where Power Shelll falls short is when the user is on a Mac or Linux system. PowerShell is a Windows only scripting system. With that said, Bash is the default for all system outside of Windows. From installing new software packages to spinning up virtual machines, Bash shell scripting allows you to fine tune your experience in a way no other can.
What is Systemd?
- It’s an “init sysem”
- The init system is the most important process running on your sever (PID1)
- It manages all serves that run in the background
Units are a resource that Systemd can manage for you and a service is a type of unit. Systemd runs in the background is completely self-sufficient.
systemctl : system control command used to inspect Linux services
Systemctl functions:
- start
- stop
- inspect
- restart
- enable
- disable
ls : command used to list all files and directories within a current directory
cat : command used to print out a file in the terminal
cd : command used to change directories
diff:
systemctl daemon-reload: look for new changes and make new changes to unit file