rm

package
v0.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 1, 2021 License: MIT-0 Imports: 5 Imported by: 0

Documentation

Overview

remove files and directories.

SYNOPSIS

rm [-dfiRrv] FILE ...

DESCRIPTION

rm attempts to remove non-directory type files specified as arguments regardless of the file's permissions.

The options are as follows:

-d        Remove empty directories.

-f        Skip prompts and ignore warnings.

-i        Prompt before each removal.

-R, -r    Remove directories and their contents recursively.

-v        Print a message when actions are taken.

It is an error to attempt to remove the root directory or the files “.” or “..”. It is forbidden to remove the file “..” merely to avoid the antisocial consequences of inadvertently doing something like “rm -r .*”.

SEE ALSO

https://golang.org/pkg/os/#Stat
https://golang.org/pkg/os/#Remove
https://golang.org/pkg/path/filepath/#Walk

REFERENCES

https://pubs.opengroup.org/onlinepubs/9699919799/utilities/rm.html

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Options

type Options struct {
	Dir         bool
	Force       bool
	Interactive bool
	Recursive   bool
	Verbose     bool
}

func (*Options) Rm

func (opt *Options) Rm(operands []string) error

type Opts

type Opts func(*Options)

func Dir

func Dir(dir bool) Opts

func Force

func Force(force bool) Opts

func Interactive

func Interactive(interactive bool) Opts

func Recursive

func Recursive(recursive bool) Opts

func Verbose

func Verbose(verbose bool) Opts

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL