-
-
Notifications
You must be signed in to change notification settings - Fork 1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
type,man,help,history added #44
base: master
Are you sure you want to change the base?
Changes from 3 commits
d16c0fd
7122fea
1436c6b
b81c3bd
b48b08c
d94e3f4
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -22,7 +22,94 @@ | |
|
||
# 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... | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Output is not necessary only example is enough. |
||
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` | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. the man command is already present, please complete this one |
||
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 +126,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 +137,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 +148,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 +159,10 @@ $ which php | |
/c/xampp/php/php | ||
``` | ||
|
||
### e. clear | ||
### i. `history` | ||
History prints previous exicuted commands. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. typo on executed here |
||
|
||
### h. `clear` | ||
Clears content on window. | ||
|
||
## 1.1. File Operations | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove the details of cd command. Only what help command is and how to use it and a example is ok. All below lines create confusion.