Certainly, when it comes to using Free and open operating systems based in GNU / Linux, the use of the terminal is usually more common than, when it comes to Private and closed operating systemsas Windows and macOS. However, in both the terminal is present and each with their respective Terminals and Shells.
And, as many will already know from different sources, Microsoft has time betting on him open source and the convergence of many of its Windows applications on GNU/Linux. being one of them, PowerShell. Which is a modern command shell that includes the best features of other popular shells. One, unlike others, which only accept and return text, accepts and returns objects.
And, before starting this post of "PowerShell 7.2.6" and using Linux and Windows commands on a GNU Distro, we recommend exploring the following related contents, at the end of reading it:
Using Windows PowerShell 7.2.6 on GNU/Linux Distros
Installation of PowerShell on GNU/Linux
To make use of PowerShellabout my current GNU / Linux Operating System, LLAMADA Miracles (a respin of MX Linux) we install its ".deb file" in its version 7.2.6, using the following command:
sudo dpkg -i ./Descargas/powershell_7.2.6-1.deb_amd64.deb
Linux and Windows Command Examples Using PowerShell on GNU
First, to start PowerShell on GNU/Linux we must execute the pwsh command, as seen in the following image:
And ready! From here we can execute almost any Linux Bash Shell command and Windows PowerShell supported, as we will show below in the following images with the execution of the following 5 command orders:
move between directories
Set-Location ./Descargas/
cd /home/sysadmin
List route contents
Get-ChildItem -Path /home/sysadmin
ls -l /home/sysadmin
Request the route where we are positioned
Get-Location
pwd
Find files using search patterns
Get-ChildItem '/opt/milagros/scripts/' -Filter '*milagros*' -Recurse
find /opt/milagros/scripts/ -name *milagros*
Create, copy, move and delete files and folders
On windows
New-Item -ItemType File FileUbunlog.txt
New-Item -ItemType Directory 'DirUbunlog'
Copy-Item ./FileUbunlog.txt ./FileUbunlog2.txt
Move-Item ./FileUbunlog2.txt ./FileUbunlog3.txt
Remove-Item *.txt
On Linux
mkdir dirtemp
touch filetemp
mv ./filetemp ./dirtemp/
cp ./dirtemp/filetemp ./dirtemp/filetemp2
rm ./dirtemp/filetemp2
For more information about PowerShell and its commands, you can start with the following official link. Or this other one, which is located in GitHub.
Summary
In short, we hope that initial look at "PowerShell 7.2.6" and the use of Linux and Windows commands on a GNU Distro, continue to provide value and knowledge to many, on the technical field of managing the GNU/Linux Terminal, either on GNU/Linux or Windows Distros.
If you liked the content, comment and share it. And remember, visit the beginning of our «site», in addition to the official channel of Telegram for more news, tutorials and Linux updates. West group, for more information on today's topic.