medz91
medz91

Reputation: 107

Unable to use unix shell commands in Jupyter notebook

I have installed Jupyter notebook and python using Anaconda. However, I have a problem when I try running any UNIX shell commands like 'cat' for example. I get the following error

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

I tried re-installing Git and Anaconda but I still face the same issue. I am using Windows 10 by the way.

Upvotes: 0

Views: 4987

Answers (4)

deysubrat
deysubrat

Reputation: 11

Install git bash in windows, it allows you to run most of the Linux commands. Start Jupyter notebook from Git bash instead command prompt and it accepts Unix commands!

Upvotes: 0

Kane Chew
Kane Chew

Reputation: 4093

I used the following command

!type

in place of

!cat

in Windows 10 Jupyter Notebook and it worked.

Upvotes: 1

Lov Verma
Lov Verma

Reputation: 238

There is no problem in git and Anaconda and it doesn't have to do anything with your operating version. Jupyter does not recognise all the UNIX commands instead you can use their windows equivalent and that will solve the problem. For example: In place of ls you can use its windows equivalent i.e. dir which will give you the same result.

Hope this may help you!!

Upvotes: 1

Hugh Bothwell
Hugh Bothwell

Reputation: 56644

Windows 10 commandline does not have a cat command.

You can either use the Windows 10 equivalent, ie type, or install a package like Cygwin which provides Unix-equivalent commands.

Upvotes: 2

Related Questions