This blog is the continuation of my previous Blog, where I have explained the difference between PowerShell and Shell Scripting through 5 different scenarios. Here , in this Blog , I will take 5 more different commands and will show the difference between them.Consider one file in windows and one file in Linux with same Data.
![](https://www.allabouttechnologies.co.in/wp-content/uploads/2022/08/image.png)
![](https://www.allabouttechnologies.co.in/wp-content/uploads/2022/08/image-1.png)
Clear the content of a file
Windows use “Clear-Content”Clear-Content .\PowerShell_Scripting.txt
![](https://www.allabouttechnologies.co.in/wp-content/uploads/2022/08/image-2.png)
Linux uses “>” symbol to truncate or removing content of a file.>Linuxfile.txt
![](https://www.allabouttechnologies.co.in/wp-content/uploads/2022/08/image-3.png)
Copy a file from one Location to another
Windows uses “Copy-Item” command to remove a file.Copy-Item .\PowerShell_Scripting.txt .\files\PowerShell_Scripting.txt
It will copy files from current location to files folder.
![](https://www.allabouttechnologies.co.in/wp-content/uploads/2022/08/image-6.png)
![](https://www.allabouttechnologies.co.in/wp-content/uploads/2022/08/image-4.png)
![](https://www.allabouttechnologies.co.in/wp-content/uploads/2022/08/image-5.png)
Linux uses “cp” commandcp linuxfile.txt copyfiles/linuxfile.txt
![](https://www.allabouttechnologies.co.in/wp-content/uploads/2022/08/image-7.png)
Remove a file
Windows use “Remove-Item” command to remove a file.Remove-Item .\PowerShell_Scripting.txt
![](https://www.allabouttechnologies.co.in/wp-content/uploads/2022/08/image-8.png)
Linux uses “rm -f” command to remove a file.rm -f linuxfile.txt
![](https://www.allabouttechnologies.co.in/wp-content/uploads/2022/08/image-9.png)
Move a file from one Location to Another
Windows uses “Move-Item” command to move a file.Move-Item .\PowerShell_Scripting.txt .\files\PowerShell_Scripting.txt
![](https://www.allabouttechnologies.co.in/wp-content/uploads/2022/08/image-10.png)
Linux uses “mv” command to move a file.mv linuxfile.txt copyfiles/
![](https://www.allabouttechnologies.co.in/wp-content/uploads/2022/08/image-11.png)
Kill a Process
Windows uses “Stop-Process” command to kill a process.Stop-Process -processname note*
The Above command kill all processes running starting with word “note” like Notepad and Notepad++
![](https://www.allabouttechnologies.co.in/wp-content/uploads/2022/08/image-12.png)
![](https://www.allabouttechnologies.co.in/wp-content/uploads/2022/08/image-14.png)
Linux uses “Kill” command to kill a process running in Linux Machinekill processid
Processid is fetched using below command.ps -eaf | grep "<processname>"