A Simple File System Simulator for people wanting to learn some basic linux commands
By
Report Bug
·
Request Feature
Hello, this is a simple file simulation where people can learn how to use some of the basic linux commands.
- RAM-2GB
- Memory-500 MB
- HDD/SDD- 4 GB
- Install java
sudo apt update
sudo apt install default-jre
- Setup MySQL
sudo apt-get install sudo apt-get install mysql-server-8.0 mysql-client-core-8.0
sudo mysql
- Add new user with superuser capabilities
CREATE USER 'username'@'localhost' IDENTIFIED BY 'password';
GRANT ALL PRIVILEGES ON *.* TO 'username'@'localhost' WITH GRANT OPTION;
- Run the jar file given in the folder using
java -jar File_System_Simulator.jar
-
Install Java from https://www.java.com/en/
-
Download MySQL (mysql-installer-community-8.0.30.0.msi) server from https://dev.mysql.com/downloads/installer/ (Version)
-
In the select products to install select Server(Or Default option) and proceed with default options
-
For Types and Networking and Authentication method do next. In the next section Enter the new root password and in the add user section add useruser with username as 'username' and password as 'password'.
-
Now proceed to the next section and after the successfull installation open the MySQL 8.0 Command Line Client
-
Enter the root password and paste the below command
GRANT ALL PRIVILEGES ON . TO 'username'@'localhost';
Note: If the user 'username' doesn't exist type the below command before grating privilages
CREATE USER 'username'@'localhost' IDENTIFIED BY 'password';
mkdir is used to make a new directory
Usage
mkdir dirname
cd is a command can be used to change a directory
Usage
cd dirname
ls command is used to list all files of an directory
Usage
ls
or
ls dirname
touch is used to create a regular file
Usage
touch filename
cat is used to display contents of a file
Usage
cat filename
rmdir is used to delete a directory
Usage
rmdir filename
rm is used to delete a file
Usage
rm file
link is used to create shortcuts of a file or directory
Usage
lnk srcname destname
mv is used to move a file from one location to another. If the srcname is the same as destname then it is similar to renaming
Usage
mv srcname destname
grep can be used for pattern matching
Usage
grep pattern text
Multilevel traversal is possible using '/' to specify the path as we go from each outer directory to inner directory.
The name for the root folder is '/' which can be accessed from any folder. The parent can be accessed using '..' meanwhile
the current folder by '.' .This can be used for any command where path is used
Some Example Usages
cd /
- Make a directory in parent directory
mkdir ../dirname
- Make a in a inner directory from root (Note that all the directory except the outer ones must exist)
mkdir /dir1/dir2/dir3/dirname
Piping can be used here to send the output of one command as a parameter to the next
one
Usage (Here the content of the file is given as the 2nd parameter to the grep command)
cat filename | grep pattern