From d16c0fda719d5b0adb2fd9d01043697e85fff63a Mon Sep 17 00:00:00 2001 From: root Date: Tue, 11 Apr 2017 22:17:29 +0530 Subject: [PATCH 1/6] type,help,man,history added --- README.md | 101 +++++++++++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 96 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 0ffa121..5e83e0a 100644 --- a/README.md +++ b/README.md @@ -22,7 +22,95 @@ # 1. Basic Operations -### a. `export` +### a. `type` +Displays the kind of command the shell will execute, given a particular command name. +```bash +type command +``` +Example: +```bash +$ type cp +cp is /bin/cp +``` +### b. `help` +It is used to get information about each of the shell builtin commands. +```bash +help command +``` +Optionally, the -m option is added to change the format of the output. +Example: +```bash +$ help -m cd +NAME + cd - Change the shell working directory. + +SYNOPSIS + cd [-L|-P] [dir] + +DESCRIPTION + Change the shell working directory. + + Change the current directory to DIR. The default DIR is the value of the + HOME shell variable. + + The variable CDPATH defines the search path for the directory containing + DIR. Alternative directory names in CDPATH are separated by a colon (:). + A null directory name is the same as the current directory. If DIR begins + with a slash (/), then CDPATH is not used. + + If the directory is not found, and the shell option `cdable_vars' is set, + the word is assumed to be a variable name. If that variable has a value, + its value is used for DIR. + + Options: + -L force symbolic links to be followed + -P use the physical directory structure without following symbolic + links + + The default is to follow symbolic links, as if `-L' were specified. + + Exit Status: + Returns 0 if the directory is changed; non-zero otherwise. + +SEE ALSO + bash(1) + +IMPLEMENTATION + GNU bash, version 4.1.5(1)-release (i486-pc-linux-gnu) + Copyright (C) 2013 Free Software Foundation, Inc. +``` + +### c. `--help` +Many executable programs support a “--help” option that displays a description of the command's supported syntax and options. +```bash +command --help +``` +Example: +```bash +$ mkdir --help +Usage: mkdir [OPTION] DIRECTORY... +Create the DIRECTORY(ies), if they do not already exist. + + -Z, --context=CONTEXT (SELinux) set security context to CONTEXT +Mandatory arguments to long options are mandatory for short options +too. + -m, --mode=MODE set file mode (as in chmod), not a=rwx – umask + -p, --parents no error if existing, make parent directories as + needed + -v, --verbose print a message for each created directory + --help display this help and exit + --version output version information and exit +``` +### d. `man` +Most executable programs intended for command line use provide a formal piece of documentation called a manual or man page. +```bash +man command +``` +Example: +```bash +$ man ls +``` +### e. `export` Displays all environment variables. If you want to get details of a specific variable, use `echo $VARIABLE_NAME`. ```bash export @@ -39,7 +127,7 @@ $ echo $AWS_HOME /Users/adnanadnan/.aws ``` -### b. `whatis` +### f. `whatis` whatis shows description for user commands, system calls, library functions, and others in manual pages ```bash whatis something @@ -50,7 +138,7 @@ $ whatis bash bash (1) - GNU Bourne-Again SHell ``` -### c. `whereis` +### g. `whereis` whereis searches for executables, source files, and manual pages using a database built by system automatically. ```bash whereis name @@ -61,7 +149,7 @@ $ whereis php /usr/bin/php ``` -### d. `which` +### h. `which` which searches for executables in the directories specified by the environment variable PATH. This command will print the full path of the executable(s). ```bash which program_name @@ -72,7 +160,10 @@ $ which php /c/xampp/php/php ``` -### e. clear +### i. `history` +history prints previous exicuted commands. + +### h. `clear` Clears content on window. ## 1.1. File Operations From 7122feaffb084294513e2fe8a16c335e231019b3 Mon Sep 17 00:00:00 2001 From: Chinmoy Debnath Date: Tue, 11 Apr 2017 22:25:13 +0530 Subject: [PATCH 2/6] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 5e83e0a..0496ad2 100644 --- a/README.md +++ b/README.md @@ -161,7 +161,7 @@ $ which php ``` ### i. `history` -history prints previous exicuted commands. +History prints previous exicuted commands. ### h. `clear` Clears content on window. From 1436c6bff730e606a57e493c944525952d1eda42 Mon Sep 17 00:00:00 2001 From: Chinmoy Debnath Date: Tue, 11 Apr 2017 22:27:34 +0530 Subject: [PATCH 3/6] type,history,help,man added --- README.md | 1 - 1 file changed, 1 deletion(-) diff --git a/README.md b/README.md index 0496ad2..8023301 100644 --- a/README.md +++ b/README.md @@ -74,7 +74,6 @@ DESCRIPTION SEE ALSO bash(1) - IMPLEMENTATION GNU bash, version 4.1.5(1)-release (i486-pc-linux-gnu) Copyright (C) 2013 Free Software Foundation, Inc. From b81c3bde7c34907da64617a94afc381ae4d5c928 Mon Sep 17 00:00:00 2001 From: Chinmoy Debnath Date: Wed, 12 Apr 2017 12:44:16 +0530 Subject: [PATCH 4/6] Update README.md --- README.md | 25 ++++++++----------------- 1 file changed, 8 insertions(+), 17 deletions(-) diff --git a/README.md b/README.md index 8023301..0f921d0 100644 --- a/README.md +++ b/README.md @@ -100,16 +100,7 @@ too. --help display this help and exit --version output version information and exit ``` -### d. `man` -Most executable programs intended for command line use provide a formal piece of documentation called a manual or man page. -```bash -man command -``` -Example: -```bash -$ man ls -``` -### e. `export` +### d. `export` Displays all environment variables. If you want to get details of a specific variable, use `echo $VARIABLE_NAME`. ```bash export @@ -126,7 +117,7 @@ $ echo $AWS_HOME /Users/adnanadnan/.aws ``` -### f. `whatis` +### e. `whatis` whatis shows description for user commands, system calls, library functions, and others in manual pages ```bash whatis something @@ -137,7 +128,7 @@ $ whatis bash bash (1) - GNU Bourne-Again SHell ``` -### g. `whereis` +### f. `whereis` whereis searches for executables, source files, and manual pages using a database built by system automatically. ```bash whereis name @@ -148,7 +139,7 @@ $ whereis php /usr/bin/php ``` -### h. `which` +### g. `which` which searches for executables in the directories specified by the environment variable PATH. This command will print the full path of the executable(s). ```bash which program_name @@ -159,10 +150,10 @@ $ which php /c/xampp/php/php ``` -### i. `history` -History prints previous exicuted commands. +### h. `history` +History prints previous executed commands. -### h. `clear` +### i. `clear` Clears content on window. ## 1.1. File Operations @@ -896,7 +887,7 @@ last yourUsername ``` ### l. `man` -Shows the manual for specified command. +Most executable programs intended for command line use provide a formal piece of documentation called a manual or man page. ```bash man command ``` From b48b08c1a199e57117a593ba222ed2f6b934e6c5 Mon Sep 17 00:00:00 2001 From: Chinmoy Debnath Date: Tue, 18 Apr 2017 10:44:57 +0530 Subject: [PATCH 5/6] Help examples output removed --- README.md | 48 ------------------------------------------------ 1 file changed, 48 deletions(-) diff --git a/README.md b/README.md index 0f921d0..951c769 100644 --- a/README.md +++ b/README.md @@ -41,42 +41,6 @@ Optionally, the -m option is added to change the format of the output. Example: ```bash $ help -m cd -NAME - cd - Change the shell working directory. - -SYNOPSIS - cd [-L|-P] [dir] - -DESCRIPTION - Change the shell working directory. - - Change the current directory to DIR. The default DIR is the value of the - HOME shell variable. - - The variable CDPATH defines the search path for the directory containing - DIR. Alternative directory names in CDPATH are separated by a colon (:). - A null directory name is the same as the current directory. If DIR begins - with a slash (/), then CDPATH is not used. - - If the directory is not found, and the shell option `cdable_vars' is set, - the word is assumed to be a variable name. If that variable has a value, - its value is used for DIR. - - Options: - -L force symbolic links to be followed - -P use the physical directory structure without following symbolic - links - - The default is to follow symbolic links, as if `-L' were specified. - - Exit Status: - Returns 0 if the directory is changed; non-zero otherwise. - -SEE ALSO - bash(1) -IMPLEMENTATION - GNU bash, version 4.1.5(1)-release (i486-pc-linux-gnu) - Copyright (C) 2013 Free Software Foundation, Inc. ``` ### c. `--help` @@ -87,18 +51,6 @@ command --help Example: ```bash $ mkdir --help -Usage: mkdir [OPTION] DIRECTORY... -Create the DIRECTORY(ies), if they do not already exist. - - -Z, --context=CONTEXT (SELinux) set security context to CONTEXT -Mandatory arguments to long options are mandatory for short options -too. - -m, --mode=MODE set file mode (as in chmod), not a=rwx – umask - -p, --parents no error if existing, make parent directories as - needed - -v, --verbose print a message for each created directory - --help display this help and exit - --version output version information and exit ``` ### d. `export` Displays all environment variables. If you want to get details of a specific variable, use `echo $VARIABLE_NAME`. From d94e3f4f967eb040d3b46c636d513bc4c5b59ee0 Mon Sep 17 00:00:00 2001 From: Chinmoy Debnath Date: Tue, 18 Apr 2017 10:46:29 +0530 Subject: [PATCH 6/6] help examples removed --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 951c769..df49b66 100644 --- a/README.md +++ b/README.md @@ -38,6 +38,7 @@ It is used to get information about each of the shell builtin commands. help command ``` Optionally, the -m option is added to change the format of the output. + Example: ```bash $ help -m cd