'tar' is not recognized as an internal or external command - batch-file

I am trying to extract a zip file in Windows 10 using a batch script.
It a simple command:
tar zxf "logstash-5.4.0.tar.gz"
ECHO "installed"
But I am getting following error:
'tar' is not recognized as an internal or external command
I have seen that I have to install the tar but how can I do that?
How can I do this?
EDIT Tar is pre installed in windows or we have to externally add it? Still how can i extract without using third party tool.

You can download Tartool Application in your desktop and paste it into
C:\Windows\system32\
For eg:-(C:\Windows\system32\tartool.exe)
By doing this it work as internal command when you want to extract your file you can simply use
C:>TarTool.exe D:\sample.tar.gz ./
For more commands you can read documention part of that Tool

Starting windows 10 build 17063, TAR is an inbuilt tool and no need to install it separately. MSDN link
For example, to uninstall a file named XYZ.zip you can execute the following in Command Prompt.
tar -xvf XYZ.zip

Related

How to install allure in MAC manually

I am trying to install allure in MAC not able to it.
I am getting the error "-bash: allure: command not found".
I have downloaded allure-commandline-2.9.0.tgz and allure-commandline-2.9.0.zip from the below link: https://repo.maven.apache.org/maven2/io/qameta/allure/allure-commandline/2.9.0/
I tried with both but it is not working.
Steps I have followed:
download the .tgz or .zip file.
unzip/untar the file.
set /allure-2.9.0/bin dir to the PATH variable.
Restart the terminal.
trying to run allure --version command.
But I am getting the error "-bash: allure: command not found".
Your installation folder of the tool is not /allure-2.9.0/bin
A good practise is to create a "bin" folder inside your user-account: "~/bin" and include this to the $PATH environment. From now on you can link or copy your extracted tool from e.g. ~/Downloads/allure-2.9.0/bin to ~/bin
You don't have to extend the PATH variable for each new tool.

'ls' is not recognized as an internal or external command, operable program or batch file

'ls' is not recognized as an internal or external command, operable program or batch file.
I get this error when I try to glance at the files of my folder.
cmd opened regularly(not as an admin).
I've recently downloaded anaconda for python.During the installation process, there was a time when I allowed to add a PATH which was not recommended.
'ls' used to work well be
Here are the paths
I'm fairly certain that the ls command is for Linux, not Windows (I'm assuming you're using Windows as you referred to cmd, which is the command line for the Windows OS).
You should use dir instead, which is the Windows equivalent of ls.
Edit (since this post seems to be getting so many views :) ):
You can't use ls on cmd as it's not shipped with Windows, but you can use it on other terminal programs (such as GitBash). Note, ls might work on some FTP servers if the servers are linux based and the FTP is being used from cmd.
dir on Windows is similar to ls. To find out the various options available, just do dir/?.
If you really want to use ls, you could install 3rd party tools to allow you to run unix commands on Windows. Such a program is Microsoft Windows Subsystem for Linux (link to docs).
We can use ls and many other Linux commands in Windows cmd. Just follow these steps.
Steps:
1) Install Git in your computer - https://git-scm.com/downloads.
2) After installing Git, go to the folder in which Git is installed.
Mostly it will be in C drive and then Program Files Folder.
3) In Program Files folder, you will find the folder named Git, find the bin folder
which is inside usr folder in the Git folder.
In my case, the location for bin folder was - C:\Program Files\Git\usr\bin
4) Add this location (C:\Program Files\Git\usr\bin) in path variable, in system
environment variables.
5) You are done. Restart cmd and try to run ls and other Linux commands.
you can use dir instead of ls in cmd
If you want to use Unix shell commands on Windows, you can use Windows Powershell, which includes both Windows and Unix commands as aliases. You can find more info on it in the documentation.
PowerShell supports aliases to refer to commands by alternate names.
Aliasing allows users with experience in other shells to use common
command names that they already know for similar operations in
PowerShell.
The PowerShell equivalents may not produce identical results. However,
the results are close enough that users can do work without knowing
the PowerShell command name.
when you use windows as operating system you should write dir
and you will find all folders including empty folders and their data bytes storage
and you can use git ls-files to show all folders but not including hidden folders
The reason you cannot run the ls command is because it does not exist on windows. The windows equivalent is the dir command, however it does not work the same way. The solution, Winls. It is
The ls command, written for windows.
According the the Winls github.
Had this error because i was using command prompt to access my files.
how did i solve it...
i opened my folder with vscode, and used bash from the terminal...the "ls" command worked as it should from bash.

sencha: command not found

I've installed Sencha by using the Terminal but I can't run if from the Terminal
samuel#samuel-pc:~/Downloads$ sudo ./SenchaCmd-6.5.0.180-linux-i386.sh -q
Starting Installer ...
The installation directory has been set to /root/bin/Sencha/Cmd/6.5.0.180.
Extracting files ...
Finishing installation ...
samuel#samuel-pc:~/Downloads$ sencha
sencha: command not found
Because you don't set environment variable.
If running sencha results in the error message sencha: command not
found on OSX/Linux or 'sencha' is not recognized as an internal or
external command, operable program or batch file on Windows, follow
these steps: ...
This is official guide: https://docs.sencha.com/cmd/guides/intro_to_cmd.html#intro_to_cmd_-_command_not_found

wget not recognized as internal or external command

I am working on a program to auto update my game as I make new developments and add new patches. When I go to run the patch update it doesn't recognize wget as a internal or external command.
Game:
:Checkforupdates
cls
cd C:\AirlineSim\
echo Checking for Updates
wget "http://interversesoftware.weebly.com/uploads/4/8/5/8/48585729/aspatcher.bat"
if /i not exist "ASpatcher.bat" (echo Could not retrieve update file.) && pause
if exist "ASpatcher.bat" call "ASpatcher.bat"
if exist "ASpatcher.bat" del "ASpatcher.bat"
goto menu
More code above in the updater
Updater:
cd C:\Airlinesim
echo Updating...
echo.
if /i exist Airline_Simulator.bat" del Airline_Simulator.bat
wget "http://interversesoftware.weebly.com/uploads/4/8/5/8/48585729/airline_simulator.bat")
set version=2.0
wget is a third-party program that doesn't come bundled with Windows, so you need to explicitly install it in order to use it.
You can find (one of) the Windows versions here: http://gnuwin32.sourceforge.net/packages/wget.htm
You will need to add the path of the wget.exe file to your PATH environment variable in order to call the executable as in the batch file above without explicitly specifying the path.
For Windows 10: A good link is available here: https://builtvisible.com/download-your-website-with-wget/
I followed this tutorial-> (https://builtvisible.com/download-your-website-with-wget/) and it worked for me. Still, I will give an overview of that,
credit: Richard Baxter
for 64bit version download wget from here
move your wget.exe to the Windows directory, which is generally c:\Windows\System32.if you don't know then you can find that either using the $PATH command or by opening your cmd as an administrator and in which path it will open that will be your Windows directory. like this one ->
2.1. Check that you have copied that in a proper place or not, to do that restart your cmd/terminal then type wget -h. if it gives some output related to some commands and their utilities(basically what a help command does) then you are good to gođź‘Ť.
If you pass the above check, then go to your c:/ directory using cd .., then make a directory called wgetdown using md wgetdown. Now you are all set. use get how ever you want.
What this simply means is, wget isn’t installed in your windows machine or it is, but hasn’t been added to Windows environmental path.
If you don’t have wget installed, download it from here (32-bit) and here (64-bit).
Extract the files to a folder say C:\wget and then add the folder to Windows environmental path.
Go to C:\Program Files (x86)\GnuWin32\bin folder and check the .exe file name.
For me it was sid.exe so I'm using sid instead of Wget command
download wget.exe here after downloading, go to command prompt by typing 'cmd' in the search menu, open the cmd type 'path' then enter in the command prompt, you're going to move the downloaded wget.exe to C:\Windows\System32 folder. if its successful, close and open the command prompt and type 'wget -h' then enter you should see different available commands. You can now use 'md wgetdown' to create directory for your downloads
first you have to install wget
pip install wget
than in Jupiter notebook locally on Windows 10
!python -m wget
example
!python -m wget --no-check-certificate 'https://docs.google.com/uc?export=download&id=1InzR1qylS3Air4IvpS9CoamqJ0r9bqQg' -O inception.py
You simply need to install wget from https://anaconda.org/menpo/wget here. I found my solution by installing it.
I had a similar issue, and I resolved it by using Windows PowerShell instead of Command Prompt
The answers about it not being available by default are absolutely correct. A few other notes related to installing wget - if you use a package manager, they may have it for you to install with.. e.g.:
$ choco install wget
$ composer require fawno/wget

Unzip tar.gz in Windows

I would like to unzip Filename.tar.gz to Filename using single command in windows batch script
All the files inside zip should go inside the Filename Folder
I am trying to do in windows . I am not getting correct output.
Can anyone suggest an idea
Windows Command line now supports tar from Windows 10 insider build 17063. You may try run the below command in cmd or PowerShell to see if it works:
tar xzvf your-file-name.tar.gz
7 zip can do that: http://www.7-zip.org/
It has a documented command line. I use it every day via scripts.
Plus: it is free and has 32 and 64 bit versions.
Windows 10 command line supports tar command
Write the tar command as general to the Linux terminal.
tar -zxvf tar-filename.tar.gz --directory destination-folder
Another option is the Arc program:
arc unarchive test.tar.gz
https://github.com/mholt/archiver
in windows compand promt use quotation marks ("") when specifying the path. It will work properly
Exaple : tar -xvzf "C:/PATH/TO/FILE/FILE-NAME.tar.gz" -C "C:/PATH/TO/FOLDER/EXTRACTION"
tar -xvzf "C:/PATH/TO/FILE/FILE-NAME.tar.gz"

Resources