From 812cc87a7b655ca70fc075913059d0edac3fc109 Mon Sep 17 00:00:00 2001 From: benjamyn Date: Mon, 25 Feb 2019 03:00:10 +1100 Subject: [PATCH] Fixde typo on index and added in some more info --- docs/commands.md | 39 ++++++++++++++++++++++++--------------- docs/examples/grep.md | 2 +- docs/examples/lsof.md | 4 ++++ docs/index.md | 6 +++--- mkdocs.yml | 2 +- 5 files changed, 33 insertions(+), 20 deletions(-) create mode 100644 docs/examples/lsof.md diff --git a/docs/commands.md b/docs/commands.md index 5a2e598..b7f77d8 100644 --- a/docs/commands.md +++ b/docs/commands.md @@ -1,47 +1,56 @@ #Commands -##Files +## Files + +Commands that can be used for reading and manipulating files + +### tail -###tail `tail` by default reads the last 5 lines of the input file and then exits | Useful Flags | Function | | ------------- |:-------------| | -n *x* | Returns the last x lines of a file | -| -f | Follows the end of the file, so any new data will be printed out to the screen | +| -f | Follows the end of the file, so any new data will be printed out to the screen | + +### head -###head `head` by default reads the first 5 lines of the input file and then exits | Useful Flags | Function | | ------------- |:-------------| | -n *x* | Returns the first x lines of a file | -###awk +### awk + `awk` is used to extract, layout and modify data using the command line (It is way more then this but its all I use it for) -###sed -`sed` is the '**S**tream **ED**itor' you can use to to modify files via commands and scripts using patterns, an [example](examples/seddnszone.md) can be seen here +### sed +`sed` is the '**S**tream **ED**itor' you can use to to modify files via commands and scripts using patterns, an [example](examples/seddnszone.md) can be seen here | Useful Flags | Function | | ------------- |:-------------| | -i | In-place, writes the changes to the file | -| -f | Use a script file instead of reading the expression from STDIN | +| -f | Use a script file instead of reading the expression from STDIN | +### grep -###grep `grep` is used to match text in a file, | Useful Flags | Function | | ------------- |:-------------| | -o | Returns only the matched data (Useless without regex really) | -| -E | Allows extended regex to be used in the search, [regex info](/regex)| -| -P | Allows the use of Perl regex, this uses a different syntax to -E | -| -i | Makes the search case insensitive | -| -r | Searches files recursively (i.e if you have quite a few files and folders it will search through all of them) | -| -l | Returns the filename where the data was matched instead of the matched data | +| -E | Allows extended regex to be used in the search, [regex info](/regex)| +| -P | Allows the use of Perl regex, this uses a different syntax to -E | +| -i | Makes the search case insensitive | +| -r | Searches files recursively (i.e if you have quite a few files and folders it will search through all of them) | +| -l | Returns the filename where the data was matched instead of the matched data | Some examples of grep usage can be found [here](/examples/grep) -###rev \ No newline at end of file +### losof + +`lsof` is a command that will show you what processes have specified file open currently you can see an example [here](/examples/lsof) + +### rev \ No newline at end of file diff --git a/docs/examples/grep.md b/docs/examples/grep.md index 25acf19..9084b09 100644 --- a/docs/examples/grep.md +++ b/docs/examples/grep.md @@ -1,2 +1,2 @@ -#Grep examples +# Grep examples diff --git a/docs/examples/lsof.md b/docs/examples/lsof.md new file mode 100644 index 0000000..d2bb05e --- /dev/null +++ b/docs/examples/lsof.md @@ -0,0 +1,4 @@ +# lsof examples + +```COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME +tail 17481 ben 3r REG 0,49 240 1220028 docs/index.md``` \ No newline at end of file diff --git a/docs/index.md b/docs/index.md index 4356922..e7097ce 100644 --- a/docs/index.md +++ b/docs/index.md @@ -2,10 +2,10 @@ [Klaatu barada nikto](https://www.imdb.com/title/tt0106308/) -## What is this? +## What is this This is a compendium of all the useless facts, tips, tricks and commands that I know, enjoy -##Quick Links +## Quick Links -[Commands](commands) \ No newline at end of file +[Commands](commands) diff --git a/mkdocs.yml b/mkdocs.yml index 566d1a5..acf2dc5 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: Usefull commands and tips +site_name: Useful commands and tips nav: - Home: index.md - Commands: commands.md