From 86d1749e95cc2a5b6130afd14baccd036635a2a3 Mon Sep 17 00:00:00 2001 From: David Reihl Date: Mon, 22 Oct 2018 20:48:40 -0400 Subject: [PATCH 1/4] Added locate documentation --- _commands/basics/locate.md | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 _commands/basics/locate.md diff --git a/_commands/basics/locate.md b/_commands/basics/locate.md new file mode 100644 index 000000000..4aac3a63e --- /dev/null +++ b/_commands/basics/locate.md @@ -0,0 +1,17 @@ +# locate +`locate` : a command used to search a database for the location of files +#### Examples of commonly used commands: +```bash + $ locate FILENAME # Outputs the complete path of the file + $ /home/user/Documents/FILENAME +``` +```bash + $ locate -i *FILENAME* # Ignores case when searching for files + $ /home/user/Documents/FILENAME + $ /home/user/Downloads/filename +``` +Locate can also be used to search for a string in a path where the string is not necessarily a file name. Additionally, adding `-c` outputs the number of occurrences. +```bash + $ locate -c STRING # Outputs the count of the occurrences of the string + $ 34 +``` From 8bc4cfaa5ef20fb83ba6a455714746e290d20fac Mon Sep 17 00:00:00 2001 From: David Reihl Date: Mon, 22 Oct 2018 21:05:49 -0400 Subject: [PATCH 2/4] Testing in tools --- _commands/tools/locate.md | 1 + 1 file changed, 1 insertion(+) create mode 100644 _commands/tools/locate.md diff --git a/_commands/tools/locate.md b/_commands/tools/locate.md new file mode 100644 index 000000000..84f6ea60c --- /dev/null +++ b/_commands/tools/locate.md @@ -0,0 +1 @@ +# HEADING HELLO THERE From f4dbf63356da6801bb6a515f6c1ffd277be296fa Mon Sep 17 00:00:00 2001 From: David Reihl Date: Mon, 22 Oct 2018 22:22:59 -0400 Subject: [PATCH 3/4] Locate v1.0 complete --- _commands/basics/locate.md | 31 +++++++++++++++++++++++++++---- 1 file changed, 27 insertions(+), 4 deletions(-) diff --git a/_commands/basics/locate.md b/_commands/basics/locate.md index 4aac3a63e..7bcc7750d 100644 --- a/_commands/basics/locate.md +++ b/_commands/basics/locate.md @@ -1,17 +1,40 @@ -# locate +--- +--- + +locate +--- + `locate` : a command used to search a database for the location of files -#### Examples of commonly used commands: + +```bash +# Sample command and output format +$ locate FILENAME +$ /home/user/Documents/FILENAME +``` + + +### Common examples of commands using locate: + +Each command is followed by a sample output format. + ```bash $ locate FILENAME # Outputs the complete path of the file $ /home/user/Documents/FILENAME ``` + +Adding `-i` tells locate to ignore case while searching. + ```bash - $ locate -i *FILENAME* # Ignores case when searching for files + $ locate -i *FILENAME* $ /home/user/Documents/FILENAME $ /home/user/Downloads/filename ``` -Locate can also be used to search for a string in a path where the string is not necessarily a file name. Additionally, adding `-c` outputs the number of occurrences. + +Locate can also be used to search for a string in a file name. Additionally, adding `-c` outputs the number of occurrences. + ```bash $ locate -c STRING # Outputs the count of the occurrences of the string $ 34 ``` + +Type `man locate` in your terminal to check out the man page for more information! From 0dc15706d614d3a36a1684a181be59744144866c Mon Sep 17 00:00:00 2001 From: David Reihl Date: Mon, 22 Oct 2018 22:31:33 -0400 Subject: [PATCH 4/4] Deleted test file --- _commands/tools/locate.md | 1 - 1 file changed, 1 deletion(-) delete mode 100644 _commands/tools/locate.md diff --git a/_commands/tools/locate.md b/_commands/tools/locate.md deleted file mode 100644 index 84f6ea60c..000000000 --- a/_commands/tools/locate.md +++ /dev/null @@ -1 +0,0 @@ -# HEADING HELLO THERE