toolshed v0.2.12 Toolshed.Unix View Source

Helpers for when your fingers are too used to typing Unix commands.

Helpers include:

  • cat/1 - print out a file
  • date/0 - print out the current date and time
  • grep/2 - print out lines of a file that match a regular expression
  • tree/1 - print out a directory tree
  • uptime/0 - print the update of the Erlang VM

Link to this section Summary

Functions

Print out a file

Print out the date similar to the Unix date command

Run a regular expression on a file and print the matching lines.

Print out directories and files in tree form.

Print out the current uptime.

Link to this section Functions

Link to this function

cat(path)

View Source
cat(Path.t()) :: :"do not show this result in output"

Print out a file

Print out the date similar to the Unix date command

Link to this function

grep(regex, path)

View Source
grep(Regex.t(), Path.t()) :: :"do not show this result in output"

Run a regular expression on a file and print the matching lines.

iex> grep ~r/video/, "/etc/mime.types"

Link to this function

tree(path \\ ".")

View Source
tree(Path.t()) :: :"do not show this result in output"

Print out directories and files in tree form.

Link to this function

uptime()

View Source
uptime() :: :"do not show this result in output"

Print out the current uptime.