Zero Shell is a shell clone written in rust. If you have any suggestions to improve the project let me know
Clone the project
git clone [email protected]:NRK-group/0-shell.git
Go to the project directory
cd ./shell
Start the application and install the dependecies
cargo run
the result should be like:
β shell git:(main) β cargo run
Finished dev [unoptimized + debuginfo] target(s) in 0.43s
Running `target/debug/0shell`
π οΈβοΈ π€ shell git:(main) β
- echo
The echo command is used to display a message or output data. It's commonly used to display strings directly on the terminal or to generate messages in scripts.
π οΈβοΈ π€ shell git:(main) β echo "Hello"
Hello
- cd
The cd command stands for "change directory." It's used to navigate between directories in the file system.
π οΈβοΈ π€ target git:(main) β pwd
example/0-shell/shell/
π οΈβοΈ π€ shell git:(main) β cd target
π οΈβοΈ π€ target git:(main) β pwd
example/0-shell/shell/target
- ls
The ls command lists the contents of a directory.
π οΈβοΈ π€ shell git:(main) β ls
Cargo.toml
target
Cargo.lock
README.md
src
- pwd
The pwd command, standing for "print working directory," displays the full path to the current directory.
π οΈβοΈ π€ shell git:(main) β pwd
example/0-shell/shell
- cat
The cat command is used to display the contents of a file.
π οΈβοΈ π€ shell git:(main) β cat Cargo.toml
[package]
name = "shell"
version = "0.1.0"
edition = "2021"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[lib]
path = "src/lib.rs"
[[bin]]
path = "src/main.rs"
name = "0shell"
[dependencies]
ansi_term = "0.12.1"
rustyline = "11.0.0"
chrono = "0.4.19"
- cp
The cp command is used to copy files or directories from one location to another.
- rm
The rm command is used to remove files or directories.
- mv
The mv command stands for "move," and it's used to move or rename files and directories.
- mkdir
The mkdir command stands for "make directory," and it's used to create a new directory.
π οΈβοΈ π€ shell git:(main) β ls
Cargo.toml
target
Cargo.lock
README.md
src
π οΈβοΈ π€ shell git:(main) β mkdir hello
π οΈβοΈ π€ shell git:(main) β ls
Cargo.toml
target
Cargo.lock
README.md
hello <- new file directory
src
- exit
The exit command is used to exit the current shell session.
- Ctrl + D
Ctrl + D is a keyboard shortcut used to send an End-of-File (EOF) character, which usually signals the end of input or terminates the current process in many shell environments.