Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

In gnuplot for Windows, how can I list the files in the current/working directory?

Tags:

gnuplot

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?

like image 832
Andrew Avatar asked Jul 19 '12 20:07

Andrew


People also ask

Which commands list the contents of the current working directory?

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.

What is the command used to show the name of the current working directory?

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.

What command can I use to generate a list of files and directories in my working directory including the timestamp of creation?

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.


2 Answers

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'

like image 139
Qiau Avatar answered Sep 25 '22 05:09

Qiau


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.

like image 24
bambino350 Avatar answered Sep 25 '22 05:09

bambino350