Navigating the File System
There are several commands that are easy to use and provide a great deal of flexibility when navigating a Linux system.
A directory listing can be displayed using the [ls] command. This command lists all non-hidden files and provides no file details. Linux uses a color coding system to indicate file type. Although this can vary from system to system, blue generally means directory, with green being an executable file.
Two additional switches can provide file information. The –a switch will display hidden files. On Linux, filename starting with a . is hidden from regular directory listings. If you change the name of a file to include a period as the first character, that file is hidden. The –l switch displays a “long” listing of files, including file size, permissions, owner and date information. [ls –al] is perhaps the most common command you will use. [ll] is a shortcut to this command that is defined on most systems.
Tip – Command aliasing is used to change the default behavior of commands. [ll] is an example of an alias. You can alias any command by typing [alias command=”new command”]. For example, [alias l=”ls –alh”] will produce an easier to read directory listing whenever [l] is typed. You can display information on current alias entries by typing [alias]. Aliased commands are persistent for the current logon session only, unless stored in the users’ logon script.
Here are some commands that can be used to navigate through your filesystem.
pwd: Parse Working Directory – Displays your current position in the file system.
cd: Change Directory – Changes you to a new directory, can use relative or absolute paths. Example: [cd /usr/bin]
mkdir: Make Directory – Creates a new directory
rmdir: Remove Directory
touch: Creates a file, or updates the last modified time on a file. Example: [touch mynewfile]