$ gofm [command] [arg1] [arg2]
Use the commands like their Linux counterparts but with gofm as the prefix.
$ gofm ls # List files in the current directory
$ gofm pwd # Get the current working directory
$ gofm cat abc.txt # View the contents of a file
$ gofm mv abc.txt def.txt # Move a file
$ gofm rm abc.txt # Delete a file
ls– List files in the current directoryrm– Delete a filepwd– Print the current working directorymv– Move or rename a filemkdir– Create a new directorycat– View the contents of a filetouch– Create an empty filecp– Copy a fileecho– Print text to the consoleinfo– Get information about the file system
-
Build the executable:
go build -o gofm
-
Move it to
/usr/local/binfor system-wide usage:sudo mv gofm /usr/local/bin/
-
Verify installation:
gofm --help