Linux Commands for Navigating and Viewing Directories

Linux has hundreds of commands available, but to get around the system, view and edit text files we only need a handful. We’ll take a look here at the basic commands that are essential in setting up the dedicated server (download a free copy of Linux to test drive it). Notice the convention of the $ sign in the examples given. This means that you are logged in to your Linux server and at the command prompt. From this point, simply type in the command and press enter. Anything in square brackets represents an instance that you’ll substitute with an appropriate value – so for instance [username] will be substituted with your username. Linux Commands: Navigating $ pwd Use this command to find out where you are in the directory structure. When you log on to Linux, your starting directory is always your home directory, so you’ll be in /home/[your username] as any other user than root, or /root if you’re logged in as root. But, this can be useful if you ever lose track! $ cd [directory] A workhorse command, this is used to change the current directory. The directory named can be relative to the current directory, or absolute. To move relatively, using .. will move you up one level, or typing a directory name will move you into a subdirectory of the current. So, for example, if you’re in the directory /home/[username] and want to move to the directory /etc, you can do it in a couple of ways. If you type: $ cd .. You’ll be moved up one directory, so you’ll now be in...

Pin It on Pinterest