Root-Server Tutorial

ROOT-SERVER TUTORIAL

How to Navigate the Linux File System using the Command Line Interface

This is a detailed tutorial on how to navigate the Linux file system using basic command line interface commands.

Author:

Peter Mesiha

Last updated:

19/04/2023

Introduction

In Linux, the file system is organized in a hierarchical structure, with directories (folders) containing files and other directories. Navigating the file system is an essential skill for any Linux user. In this tutorial, we will cover basic command line interface commands to navigate the Linux file system.

Requirements

To follow this tutorial, you will need:

A Linux machine (or virtual machine) with a terminal or console interface Basic knowledge of Linux command line interface

Step 1 - The pwd command

The pwd (print working directory) command is used to display the current working directory.

pwd

The output will show the full path of the current directory.

Step 2 - The cd command

The cd (change directory) command is used to change the current working directory.

To change to a directory, simply type cd followed by the directory name:

cd directory_name

To go up one directory level, use cd ..:

cd ..

Step 3 - The ls command

The ls (list) command is used to list the contents of a directory.

To list the files and directories in the current working directory, type:

ls

To list the contents of a specific directory, type ls followed by the directory name:

ls directory_name

Step 4 - The mkdir command

The mkdir (make directory) command is used to create a new directory.

To create a new directory, type mkdir followed by the directory name:

mkdir directory_name

Step 5 - The rmdir command

The rmdir (remove directory) command is used to remove an empty directory.

To remove a directory, type rmdir followed by the directory name:

rmdir directory_name

Conclusion

In this tutorial, we have covered basic command line interface commands to navigate the Linux file system. With these commands, you can navigate, list, create, and remove directories in the Linux file system. Practice using these commands to become more comfortable with the Linux file system.

License

MIT

Copyright (c) 2021 netcup

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicence, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Contributor's Certificate of Origin

By making a contribution to this project, I certify that:

  1. The contribution was created in whole or in part by me and I have the right to submit it under the license indicated in the file; or

  2. The contribution is based upon previous work that, to the best of my knowledge, is covered under an appropriate license and I have the right under that license to submit that work with modifications, whether created in whole or in part by me, under the same license (unless I am permitted to submit under a different license), as indicated in the file; or

  3. The contribution was provided directly to me by some other person who certified (a), (b) or (c) and I have not modified it.

  4. I understand and agree that this project and the contribution are public and that a record of the contribution (including all personal information I submit with it, including my sign-off) is maintained indefinitely and may be redistributed consistent with this project or the license(s) involved.

Published 19/04/2023 by Peter Mesiha

Submit your tutorial

Get 60€ netcup vouchers for every published tutorial.