From 92d88c401e94a2344fef5a57b3c73cdfdaf83398 Mon Sep 17 00:00:00 2001 From: Simas Janusas Date: Sun, 28 Oct 2018 03:44:10 +0000 Subject: [PATCH] Added a 'grep' command. (#19924) * Added a 'grep' command. Added a 'grep' command to the basic linux command list. * Fixed formatting --- guide/english/linux/basic-linux-commands/index.md | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/guide/english/linux/basic-linux-commands/index.md b/guide/english/linux/basic-linux-commands/index.md index 51e62eb898..6f07ec8319 100644 --- a/guide/english/linux/basic-linux-commands/index.md +++ b/guide/english/linux/basic-linux-commands/index.md @@ -47,7 +47,17 @@ When starting out with linux, there are some basic commands everyone should know - Use `clear` to simply clear all output from your terminal. 14. **cp** - copy files and directories -- Use 'cp' to copy a file or a direcotry with files inside it to another location using command 'cp CURRENT_FILE-LOCATION DESTINATION_FOLDER'. Add '-r' flag to copy a directory that is not empty. +- Use `cp` to copy a file or a direcotry with files inside it to another location using command 'cp CURRENT_FILE-LOCATION DESTINATION_FOLDER'. Add '-r' flag to copy a directory that is not empty. + +15. **grep** - The grep searches any given input files, selecting lines that match one or more patterns. +- use `grep` to find a file, a directory, some text in the file/directory. +**Example:** +```sh + $ ps ax | grep -w login + 25291 s000 Ss 0:00.11 login -pf + 25467 s000 R+ 0:00.00 grep -w login + 25409 s004 Ss 0:00.04 login -pf +``` 15. **df -h** Checks disk space in human readable form - Shows the size, amount used, amount available and capacity percentage of mounted drives/partitions.