Skip to content
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

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
100 changes: 95 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Copy link
Contributor

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.

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...
Copy link
Contributor

Choose a reason for hiding this comment

The 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`

Choose a reason for hiding this comment

The 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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -72,7 +159,10 @@ $ which php
/c/xampp/php/php
```

### e. clear
### i. `history`
History prints previous exicuted commands.

Choose a reason for hiding this comment

The 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
Expand Down