I am running gnuplot
version 4.6 (patchlevel 0) for Windows. The Windows version of this program provides a console or command prompt interface, similar to a bash
shell in Unix/Linux or the DOS Command Prompt in Windows.
Some commands in gnuplot
for Windows are similar to those in Unix/Linux or DOS. For example, pwd
prints the current/working directory. Also, cd
changes the directory, so I can use commands like cd 'C:\Documents and Settings'
.
However, I have oddly not been able to figure out how to list the files in the current/working directory (which in Unix/Linux would be ls
and in DOS would be dir
). Do you know how to do this?
By default, the ls commands lists the contents of the working directory (i.e. the directory you are in). You can always find the directory you are in using the pwd command.
The pwd command can be used to determine the present working directory. and the cd command can be used to change the current working directory.
ls command ls – Listing contents of directory, this utility can list the files and directories and can even list all the status information about them including: date and time of modification or access, permissions, size, owner, group etc.
A quick code review of Gnuplot 4.6.0 shows that ls
(or similar) isn't supported in windows.
You can however use the system
command, like system 'dir'
If you just want to see a listing of the working directory from within the Windows gnuplot console, the following works for me, but use backticks:
`dir && pause`
or alternatively
system("dir && pause")
This will open separate cmd window and keep it open until you hit a key.
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