Magic Commands

Magic Command: %sh

%sh ps | grep 'java'

Magic Command: Other Languages


println("Hello Scala!")

print("Hello Python!")

print("Hello R!", quote=FALSE)

select "Hello SQL!"

Magic Command: %md


Magic Command: %run

  • You can run a notebook from another notebook by using the Magic Command %run
  • All variables & functions defined in that other notebook will become available in your current notebook
%run "./Includes/Classroom-Setup"

Magic Command: %fs

It is a wrapper around dbutils.fs and it is the Magic Command known as %fs.

The following call is equivalent to the display("/mnt/training") ) – there is no real difference between the two.

%fs ls /mnt/training
%fs head /mnt/training/pageviews_by_second.tsv