0

What's the best way and how to run the below commands in windows cmd? I'm running them in Ubuntu ... but how to do so in Windows?

Ubuntu terminal:

sudo unzip '/var/www/html/*20180301.zip' -d '/var/www/html/';
sudo sed -i '1,2d;$d' /var/www/html/*20180301.TXT;
sudo cat /var/www/html/*20180301.TXT > /var/www/html/records_all20180301.txt;

Windows cmd:

?

Philipp M
  • 3,306
  • 5
  • 36
  • 90
  • Did you try using git bash? Otherwise there's also cygwin or the bash subsystem for windows – Axnyff Mar 03 '18 at 14:42
  • I'm open either way ... which one should I try/go for first? – Philipp M Mar 03 '18 at 14:44
  • git bash is pretty easy to use. During the installation you can tell it to add its command to the path to make it so that you can use most of these commands even in the windows console – Axnyff Mar 03 '18 at 14:45
  • Windows command shell and utilities are different from Linux command shell and utilities. There are several versions of the Linux command shell and the Linux utilities that have been ported to Windows. The underlying operating system API is different so there are some differences in the way that the Linux command shell and utilities work under Windows. – Richard Chambers Mar 03 '18 at 14:45
  • Thanks Axnyff. Install git bash like this http://www.techoism.com/how-to-install-git-bash-on-windows/ and I'm good to go to use the above commands? – Philipp M Mar 03 '18 at 14:56

1 Answers1

0

Sorry for my bad answer :(

You can use the following commands to read text files

type text.txt 
more text.txt

To write to a text file, use

"text" > text.txt

I don't know about the second command. Windows doesn't come with a command-line file zipping tool so you have to use other methods.

How to zip a file using cmd line?