Published May 15th, 2007 by admin

Linux Commands – Working with Directories

As much as I hate to say it, there will be times in your Linux usage that you will need to use the command line or terminal as it’s called in the Linux world.

Don’t look at this as a bad or scary thing. The terminal is actually a great way to accomplish things very quickly compared to navigating via the graphical user interface (GUI).

To get you started in your terminal endeavors, I have listed some of the more common commands you will be using below.


Let’s start off easy. Once we have the terminal open, (Applications -> Accessories -> Terminal), type the following command:

ls

This will list all the files in the current working directory. What is the current working directory? Well that is the folder or directory on the system that you are currently viewing or working with. Want to find out the path to the current working directory you are viewing? Type:

pwd

Let’s navigate around a little bit now. Type the following:

cd /var/

This command will take us to the var directory in the root folder. Linux is organized a little bit differently than Windows. First of all there is no C, D, E, etc drive. Everything is organized under the “root” directory, simply called “the root directory”. This is written as “/”. Type the following:

cd /

This will take you to the root directory. An “ls” command will list all the folders and files in the root directory (your current working directory). To see more details about files in a directory such as date last modified and ownership permissions type the following:

ls -l

To show hidden files type:

ls -a

You can also combine these two to show the details of (all) hidden files:

ls -la

This is part 1 of a multi-part series. Stop by again tomorrow for part 2!

Technorati Tags: , , ,


2 Responses to “Linux Commands – Working with Directories”

Feed for this Entry Trackback Address
  1. 1

    Linux Commands - Working with Files | Ubuntu Hacker

    Pingback on Jun 21st, 2007 at 11:15 am
  2. 2

    Linux Commands - Permissions | Ubuntu Hacker

    Pingback on Jun 21st, 2007 at 11:16 am

Leave a Reply

XHTML: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>