I have setup react-native in my system. I have mac OS X El Capitan.
After completing setup of react native, whenever i open my terminal and type command ls then, it shows "command not found".
export PATH="/usr/bin:/bin:/usr/sbin:/sbin"
export PATH="/usr/local/bin:/usr/local/sbin:$PATH"
After executing above two lines in my terminal, everything works fine. ls command is working after that. But once i close my terminal and again open it, ls command stops working and it shows "command not found".
I have also tried to add above two lines in .bash_profile file, but didn't get success. I don't know how to get rid of this issue.
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 .
Use the command dir to list all the directories and files in a directory; ls is a unix command. it is possible to make dir dsplay text horizontally ? this is helpful, just type dir in the cmd not the filename and dir. @Webwoman To show text horizontally, you can use dir /w .
The wc command tells you how big a text document is. tells you the number of lines, words, and bytes in each file. This pipes the output of ls through wc.
If you use ls -lR you have to then exclude content from the output, somehow, and then grep out what you want. find is probably quicker.
Add following line to you .bash_profile
export PATH=/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/bin
Simply you can do it by following command
echo "export PATH=/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/bin" >> ~/.bash_profile
After that please restart your terminal
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With