dbutils
and %fs commands%python
, %sql
, %r
, %scala
, %md
, %fs
dbutils.fs
(%fs
), dbutils.notebook
(%run
), dbutils.widgets
display()
, displayHTML()
%fs
magic command or dbutils.fs
to interact with DBFS.
dbutils.fs.mount
command, which requires the source and mount point as parameters.
%fs
is a shorthand for dbutils.fs
and allows you to run file system commands directly in the notebook.
%fs ls
or dbutils.fs.ls
- List files and directories in DBFS.
%fs rm
- Remove files and directories in DBFS.
%fs head /datasets/readme.txt
- Display the first few lines of a file in DBFS.
%fs mounts
- List all mounted directories in DBFS.
%fs cp
- Copy files and directories in DBFS.
%fs mv
- Move files and directories in DBFS.
%fs help
- Display help information for DBFS commands.
dbutils.widgets
module, which provides methods to create different types of widgets (e.g., text, dropdown, combobox, multiselect).dbutils.widgets.get
method, which retrieves the value of the widget based on its name.dbutils.widgets.remove
method, which removes the widget from the notebook.dbutils.widgets.removeAll
method, which removes all widgets from the notebook.display
function, which renders the widget in the notebook.getArgument()
function.