A collection of useful commandline utilities for Picotron
Includes
cat
- concatenates and prints files (including URLs!)- example:
cat file1.txt file2.txt
- example:
touch
- creates new files, updates modification time (rewrites) files- example:
touch newfile.txt
- example:
tree
- prints a tree view of a directory- example:
tree desktop
- example:
wget
- downloads a file- example:
wget https://gutenberg.org/cache/epub/64317/pg64317.txt gatsby.txt
- example:
grep
- search within a file or folder- pattern is a lua pattern. See Programming in Lua 20.2 - Patterns
- examples:
grep _init
(searches for_init
recursively through pwd)grep test file1.txt
(searches fortest
infile1.txt
)grep hello desktop
(searches forhello
recursively throughdesktop/
)
frange
- print a file range with line numbers- examples:
frange file.txt
(printsfile.txt
with line numbers)frange file.txt 1 10
(prints first 10 lines)frange file.txt 20
(prints starting from line 20 to the end of the file)frange file.txt 20 10
(prints 10 lines starting from line 20)frange file.txt -10
(prints last 10 lines)frange file.txt -20 10
(prints 10 lines starting from 20 lines before end)
- examples:
pwd
- print working directory (UNIX-style shortcut for print(pwd()))- example:
pwd
- example:
Picotron Utilities can be used in 3 ways:
- As a yotta utility
- As a bundle command
- Manually
To install Picotron Utilities as a yotta utility, run yotta util install #picotron_utilities
. This requires yotta.
To install Picotron Utilities as a bundle command, save the cartridge to your utility path (/appdata/system/util
).
load #picotron_utilities
save /appdata/system/util/busybox
Once installed, you can run a bundled command by passing that command as an argument, like busybox tree
.
To add these commands to Picotron manually, add the lua files found in src/exports/appdata/system/util to /appdata/system/util