diff options
author | salaaad2 <arthurdurant263@gmail.com> | 2021-12-28 00:36:00 +0100 |
---|---|---|
committer | Brian Gianforcaro <b.gianfo@gmail.com> | 2021-12-29 20:42:18 -0800 |
commit | d364c8e352eda946f5c585733460e7e7c770da9f (patch) | |
tree | 1b60d87b422a3d0c32fe5a48db6bfeda04340989 /Base/usr | |
parent | 87068896d0af03d4c934a48bca90d2bf6d97c2ca (diff) | |
download | serenity-d364c8e352eda946f5c585733460e7e7c770da9f.zip |
Base: Add manpages for cut, diff, head & rmdir command line utilities
Diffstat (limited to 'Base/usr')
-rw-r--r-- | Base/usr/share/man/man1/cut.md | 49 | ||||
-rw-r--r-- | Base/usr/share/man/man1/diff.md | 31 | ||||
-rw-r--r-- | Base/usr/share/man/man1/head.md | 41 | ||||
-rw-r--r-- | Base/usr/share/man/man1/rmdir.md | 34 |
4 files changed, 155 insertions, 0 deletions
diff --git a/Base/usr/share/man/man1/cut.md b/Base/usr/share/man/man1/cut.md new file mode 100644 index 0000000000..4a4ab94350 --- /dev/null +++ b/Base/usr/share/man/man1/cut.md @@ -0,0 +1,49 @@ +## Name + +cut - remove sections from each line of files + +## Synopsis + +```**sh +$ cut option... [file...] +``` + +## Description + +Print selected parts of lines from each FILE to standard output. + +With no FILE, or when FILE is -, read standard input. + +## Arguments + +* `file`: File(s) to cut + +## Options + +* `-b` `--bytes=list`: Select only these bytes +* `-f` `--fields=list`: select only these fields; also print any line that contains no delimiter character +* `-d` `--delimiter=delim`: use `delim` instead of `tab` for field delimiter + + +## Examples + +```sh +$ cat example.txt +245:789 4567 M:4540 Admin 01:10:1980 +535:763 4987 M:3476 Sales 11:04:1978 + +# Display first and third fields from file example.txt +$ cut example.txt -f 1,3 +245:789 M:4540 +535:763 M:3476 + +# Display first and third fields using `:` as a delimiter +$ cut example.txt -d ':' -f 1,3 +245:4540 Admin 01 +535:3476 Sales 11 + +# Display bytes at given position +$ echo "serenity is cool" | cut -b 5 +n + +``` diff --git a/Base/usr/share/man/man1/diff.md b/Base/usr/share/man/man1/diff.md new file mode 100644 index 0000000000..1f63b75ff2 --- /dev/null +++ b/Base/usr/share/man/man1/diff.md @@ -0,0 +1,31 @@ +## Name + +diff - compare files line by line + +## Synopsis + +```**sh +$ diff [files...] +``` + +## Description + +Compare `files` line by line. + +## Arguments + +* `files`: files to compare ex: `file1 file2` + +## Examples + +```sh +# View differences in two files +$ echo 123 > file1 +$ echo 456 > file2 +$ diff file1 file2 +1c1 +< 123 +--- +> 456 +``` + diff --git a/Base/usr/share/man/man1/head.md b/Base/usr/share/man/man1/head.md new file mode 100644 index 0000000000..c1e5db74a0 --- /dev/null +++ b/Base/usr/share/man/man1/head.md @@ -0,0 +1,41 @@ +## Name + +head - output the first part of files + +## Synopsis + +```**sh +$ head [option...] [file...] +``` + +## Description + +Print the first 10 lines of each `file` to standard output. With more than one `file`, +precede each with a header giving the file name. + +With no `file`, or when `file` is `-`, read standard input. + +## Arguments + +* `file`: File to process + +## Options + +* `-n` `--number=NUM`: Number of lines to print (default 10) +* `-b` `--bytes=NUM`: Number of bytes to print +* `-q` `--quiet`: Never print filenames +* `-v` `--verbose`: Always print filenames + + +## Examples + +```sh +# Print the first four lines from README.md and precede it with a filename header +$ head -v -n 4 README.md +==> README.md <== +# SerenityOS + +Graphical Unix-like operating system for x86 computers. + +``` + diff --git a/Base/usr/share/man/man1/rmdir.md b/Base/usr/share/man/man1/rmdir.md new file mode 100644 index 0000000000..6624724cf4 --- /dev/null +++ b/Base/usr/share/man/man1/rmdir.md @@ -0,0 +1,34 @@ +## Name + +rmdir - remove empty directories + +## Synopsis + +```**sh +$ rmdir `[directory...]` +``` + +## Description + +Remove given `directory(ies)`, if they are empty + +## Arguments + +* `directory`: directory(ies) to remove + +## Examples + +```sh +# Try to remove non-empty directory +$ mkdir serenity ; echo cool > serenity/cool.txt +$ rmdir serenity +rmdir: Directory not empty + +# Remove empty directory +$ mkdir example +$ ls -a example +. .. +$ rmdir example +$ ls -a example +example: No such file or directory +``` |