---
name: "Util::Cmd"
section: "3pm"
platform: "linux"
package: "systemconfigurator"
version: "1.20-1"
release: "Debian 3.0 (Woody)"
platforms: ["linux"]
url: "https://new.carta.tech/Util::Cmd"
---

# Util::Cmd(3pm)

Util::Cmd - Additional Unix Commands needed by SC

```
  use Util::Cmd qw(:all);
  my $grubpath = which('grub');
  deltree("/tmp/file1");
  deltree("/tmp/directory");
  mkpath("/tmp/tmp2/tmp3");
```

Exports *which()*, *deltree()* and *mkpath()* functions.   *which* takes an executable and returns the path to it.  *deltree* recursively deletes files and directories given a list of such files and directories. Note: *deltree* does not recognize shell metacharacters such as "\*" and "?" so if you want do send it a list of files use something like: deltree(glob("files\*")); *mkpath* takes a directory and creates it, along with all the intermediate directories as needed.  Acts exactly like "mkdir -p".\
 **EXPORT** None by default.  With the *:all* specification *which*, *deltree*, and *mkpath* are exported.

```
  Sean Dague <japh@us.ibm.com>
  Vasilios Hoffman <greekboy@users.sourceforge.net>
```

perl.
