PowerShell on Linux: More commands and their equivalents

PowerShell on Linux: More commands and their equivalents

PowerShell on Linux: More commands and their equivalents

Less than a month ago, we addressed in a post about PowerShell 7.2.6, its installation and we gave some examples of useful commands of "PowerShell on Linux". Making it clear, what is its equivalent command in Linux.

And since there are many existing ones, today we will continue with other more well-known ones, which will surely be very useful and interesting, not only for those who already know and use PowerShell, but for those who have never typed commands on windows, but they are very good about the GNU/Linux terminal.

PowerShell 7.2.6: Using Linux and Windows Commands in GNU

PowerShell 7.2.6: Using Linux and Windows Commands in GNU

And, before starting this post of "PowerShell on Linux" and see more equivalent commands between Linux and Windows, we recommend exploring the following related contents, at the end of reading it:

PowerShell 7.2.6: Using Linux and Windows Commands in GNU
Related article:
PowerShell 7.2.6: Using Linux and Windows Commands in GNU
about PowerShell
Related article:
PowerShell, install this command line shell on Ubuntu 22.04

PowerShell on Linux: Equivalent Commands

PowerShell on Linux: Equivalent Commands

10 more examples of PowerShell commands on Linux

Since, in the previous post, we explained the equivalent powershell commands Linux commands following, cd, ls, pwd, find, mkdir, touch, cp, mv, and rm; today we will explore the following equivalent commands PowerShell / Bash Shell:

  1. Get-Content "file" / cat "file": To display the content of a file.
  2. Get-Date / date: To obtain information related to the dates/times of the computer.
  3. Get-Command "command" / which "command": To view the path of a command or file.
  4. Get-Content "file" -TotalCount n / head -n "file": To display the initial content of a file.
  5. Get-Content "file" -Tail n / tail -n "file": To display the final content of a file.
  6. Set-Alias ​​abbreviation “command” / alias abbreviation=”command”: To create command aliases.
  7. «Input» | Select-String -Pattern 'pattern' / "Input" | grep 'pattern': To filter a pattern within an input from a previous command.
  8. Invoke-WebRequest "URL" / curl -I "URL": To obtain information from the header of a website.
  9. Get-Help -Name "Command" / man "command" or "command" --help: To obtain usage information (help manual) an Operating System command.
  10. «Input» | Tee-Object -FilePath "/path/file" / "Input" | tee "/path/file": To read standard input and write it to a file.

5 other equivalent commands with the same names

Between both Shell, that is, PowerShell and Bash Shell there same commands (same name), and among those we can mention the following:

  1. "clear" command: Completely clear the terminal screen. In addition, they use the same key shortcut, that is, the key combination Ctrl + l.
  2. "dir" command: List the files and folders corresponding to our location or another indicated. In addition, they often share many parameters in common, for example: "-a", "-l" and "-s".
  3. echo commands: Show messages on the screen of the terminal used. Also, to work the same, messages must be quoted, either as single or double quotes.
  4. "cat" command: To display the content (text/characters) of a file.
  5. Command "Aliases"/"aliases": To see the aliases generated in the operating system.

For more information about PowerShell and its commands, you can continue exploring the next link.

Powershell
Related article:
Microsoft PowerShell Core has already reached its version 6.0
Shell Scripting - Tutorial 01: The Shell, Bash Shell and Scripts
Related article:
Shell Scripting – Tutorial 01: Terminals, Consoles and Shells

Abstract banner for post

Summary

In short, if you like or have used "PowerShell on Linux", tell us about your experience and offer us some other Useful PowerShell Command Examples, that we can use on any GNU / Linux Distro. Or, if you know of another PowerShell command that has its Linux equivalent, will also be of great use to us, to continue providing value and knowledge to many, on the technical field of managing the GNU/Linux and Windows Terminal.

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.


Leave a Comment

Your email address will not be published. Required fields are marked with *

*

*

  1. Responsible for the data: Miguel Ángel Gatón
  2. Purpose of the data: Control SPAM, comment management.
  3. Legitimation: Your consent
  4. Communication of the data: The data will not be communicated to third parties except by legal obligation.
  5. Data storage: Database hosted by Occentus Networks (EU)
  6. Rights: At any time you can limit, recover and delete your information.

  1.   Álvaro said

    I have used it and not with much success. The only use I saw for it was to lend a hand to the IT Windows department and for that you need something more than powershell (which you can end up building if you look a little chestnuts). Regarding its use in UNIX-based systems, I would only see it useful if someone who uses Windows has no choice but to access Linux. The problem in these cases is that few I have found that really feel comfortable with a terminal. All this if I am talking about something purely “systems” oriented. If we refer to fields such as the deployment of applications, the most neutral and versatile thing between both operating systems that I have found is people using python

    1.    Joseph Albert said

      Greetings, Alvaro. Thank you for your comment and giving us your personal experience with PowerShell on Linux and Windows.