When it comes to changing to a different directory inside Linux this can simply be done by using the simple # cd and # ls commands.
To check which folder you are in type in # ls
As you can see on the screen we see our home dir, if you are not home use the # cd / command to return to your home location if you need to.
Then we will simply go inside our test folder and make 2 folders within our test folder.
To do this we will type in # cd testfolder which will move us out from our current working position and inside the testfolder
to check that we are inside this testfolder which should be empty, we can test by using command # ls again, which should show empty feedback.
When there is nothing shown on our screen we know that this folder is now empty
Then we will create our 2 new folders inside this testfolder which will be located at root/testfolder/”our new folders”
So we will create a test1 and test2 inside “testfolder” to do this we will type in
# mkdir test1
then simply hit enter and type in again “# mkdir test2”
# mkdir test2
Now we should have made 2 subfolders in our main folder named “testfolder”, this is “test1” and “test2”
Let’s check using the GUI file/folder layout on our server
we can also view check this by using the commands
- Type in # cd / to go to the main home directory
- Then use # cd testfolder to move inside the testfolder
- Then to read files or folder inside the test folder type # dir
- You will now see 2 folder came back which we made “test1” and “test2”
We hope you guys have learned something from this tutorial
Please leave a comment if you have any questions, thanks and see you again soon.
More Linux Tutorials on directories with Linux UNIX commands
- Listing Files and Directories in Linux Tutorial Guide
- Making Directories in Linux Tutorial (the mkdir command)
- Checking Current Dir & Parent Directory in Linux Tutorial
- URL Pathnames & Path Directory in Linux