Search icon
Arrow left icon
All Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletters
Free Learning
Arrow right icon
Mastering Julia

You're reading from  Mastering Julia

Product type Book
Published in Jul 2015
Publisher
ISBN-13 9781783553310
Pages 410 pages
Edition 1st Edition
Languages

Executing commands


We saw in the first chapter that it is possible to shell out of the console REPL to the operating system by using the ; command. In addition, Julia provides a number of built-in functions so that scripts can interactive with the OS and its filesystem. Most of these commands mirror the standard Unix commands. For Windows users, they will be familiar to those who have used the MINGW or similar shells.

Two familiar ones are pwd() and cd():

julia> pwd();
"/Users/malcolm/Packt/Chapter-4"
julia> cd("../../Work");
julia> pwd();
"/Users/malcolm/Work"

The pwd() command indicates where we are now (print working folder), and of course, cd() is used to change the folder. This can be relative to the current location or an absolute if the file specification starts with /.

It is also possible to create new folders with mkdir() subject to your access permissions. Files may be copied cp(), moved mv(), or deleted rm().

Folders are also deleted using the rm() command, which has a...

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at €14.99/month. Cancel anytime}