Skip to content

nandikajain/Shell

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

26 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Shell

Execute

Make command: make

Commands Implemented:-

cd

cd is used to change the current working directory to a specified folder.

Flags Implemented :-

  • -P
    This flag uses physical directory structure without following symbolic links.
  • -e
    When this flag is used, if the -P option is supplied, and the current working directory cannot be determined successfully, exit with a non-zero status.

Usage :-

To use relative or absolute paths, the command is used as it is with the flags required as cd [-P [-e]] path . You can also go directly to the shell home using the command as cd [-P [-e]]. The path can also be relative to shell home using the ~ prefix.

echo

Displays a line of text on the terminal.

Flags Implemented :-

  • -n
    This flag doesn’t append a new line.
  • -e
    This flag enables interpretation of backslash escapes.

Usage :-

The command can be called as echo [-e] [-n] text .

history

Maintains a history of all the commands used across all the sessions of the shell.

Flags Implemented :-

  • -c
    This flag clears the history list by deleting all of the entries.
  • -d
    This flag deletes the history entry at position OFFSET. Negative offsets count back from the end of the history list.

Usage :-

To view the entire history, use command history. To view the last OFFSET commands, use history OFFSET. To delete the command at OFFSET, use history -d OFFSET. To clear the entire history, use history -c.

pwd

This command gives the present working directory of the shell.

Flags Implemented :-

  • -L
    This flag uses PWD from the environment, even if it contains symlinks.
  • -P
    This flag avoids all symlinks.

Usage :-

To use this command, simply run it as pwd [-P] [-L].

exit

This command exits the user from the shell.

Usage :-

Use as exit.

date

Using this command, the user can print the system date and time.

Flags Implemented :-

  • -u
    Prints the coordinated universal time (UTC).
  • -R
    Outputs date and time in RFC 5322 format.

Usage :-

The command can be called as date [-u] [-R].

cat

This command concatenates file and prints on the standard output.

Flags Implemented :-

  • -E
    This flag displays $ at end of each line.
  • -n
    This flag numbers all output lines.

Usage :-

The command can be called as cat [-E] [-n] file1 file2 … to concatenate files in those order.

ls

This command is used to list directory contents.

Flags Implemented :-

  • -a
    Using this flag, the command does not ignore entries starting with .
  • -A
    Using this flag, the command does not list implied . and ..

Usage :-

The command can be called as ls [-a] [-A] path1 path2 ... to list the contents of files or directory in that order.

rm

This command can be used to remove files or directories.

Flags Implemented :-

  • -i
    This flag prompts before every removal.
  • -v
    This flag explains what is being done.

Usage :-

The command can be called as rm [-i] [-v] file1 file2 ....

mkdir

Using this command, we can make directories.

Flags Implemented :-

  • -p
    This flag creates all the directories recursively.
  • -v
    This flag prints a message for each created directory

Usage :-

The command can be called as mkdir [-p] [-v] file1 file2 ....

About

Linux shell implemented in C.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published