How to Navigate Directories in Linux
Linux is one of the more popular Unix like operating systems in use today. It is simple to use, even for casual computer users, thanks to some amazing desktops and GUIs (graphical user interface). Directories are the backbone of the OS, sorting your data into manageable sections. It's easy to navigate directories in Linux, whether you use the GUI or just the Linux shell terminal.
Instructions
-
-
1
Create directories using the "mkdir" command. The mkdir command is essentially a code standing for "make directory" and is accessed through the console/shell. An example of usage of the mkdir command is: "mkdir testdirectory." This would create a directory on your hard drive named "testdirectory."
-
2
Use the "cd" command to navigate from one directory to the next. For example, you could enter "cd business" to navigate to your "business" directory. You could also use the cd command to move up in a directory chain. For example if you wanted to get from the "usr/games/chess" directory to just the "usr/games" directory, you would type "cd .." which is the shortcut for moving up one directory level.
-
-
3
See a list of files in a specific directory using the "ls" command. Some files will be hidden within a folder for protection, so in order to see those files you will need to use the "-a" command line switch, like this: "ls -a."
-
4
Changes the names of directories and subdirectories using the "mv" command. The mv command syntax includes the command and the original name of the directory followed by the new name. For example, to change the "chess_beginner" directory to the "chess_expert" directory you would type: "mv chess_beginner chess_expert," followed by "Enter."
-
5
Remind yourself which directory you are currently active in using "pwd." The pwd command stands for "print working directory" and will simply display the name of the current directory.
-
1
Tips & Warnings
Spell the names of your directories correctly as it can become a hassle to navigate to or locate those directories later. Double check your typing when creating or searching for directories, and try to use names for your directories that are easy to remember.
Find and download a good GUI like KDE or Gnome. In many cases, this eliminates the need to navigate directories using console commands.
Remember that you can't remove/delete directories that contain files using the rmdir command. You will need to remove or move each file individually, or opt to use the rm -r command instead of rmdir.