Linux Security Debian Slax Tiny Core Health

Linux

If a Computer Won't Start from a CD, DVD or USB Drive

Filesystems

Partitioning

Live CDs for Partitioning

Grub

Master Boot Record

Root Terminal

Root File Manager

Root Text Editor

File Ownership

File Permissions

List the Contents of a Directory

Change Directory

Mount a Drive or Partition

Mount an ISO Image Without Writing it to a CD or DVD

Download Large Files

Other Commands

Dial Up Modems

Linux Links


Other Links


Contact Details

Linux

Change Directory

Root Directory or Current Directory

If the name of a directory or file is written with a forward slash at the beginning, this indicates its location in relation to the root directory. It does not matter which directory you are in.

If the name of a directory or file is written without a forward slash at the beginning, this indicates its location in relation to the current directory.

For example, if you were in the directory /home/ron/, for the same file, you could use:

/home/ron/pictures/house.jpg

or

pictures/house.jpg

List the Contents of a Directory

To list the contents of a directory, type:

ls

For more details, type:

ls -l

Change to Another Directory

To change to another directory, type:

cd (directory name)

For example, if you were in the directory /home/ron/, to change to the directory pictures, type:

cd pictures

From any location you could also type:

cd /home/ron/pictures

To change to a directory within a directory, type:

cd (directory name)/(directory name)

You can go as many levels as you like.


Change Up to the Directory Containing the One You are In

To change up to the directory containing the one you are in, type:

cd ..

For example, you could use this to change up to /home/, if you were in the directory /home/ron/.

To change up two levels, type:

cd ../..

You can go as many levels as you like. For three levels, type:

cd ../../..

To change to a directory in the one up from where you are, type:

cd ../(directory name)

Change to Root Directory

To change to the root directory, type:

cd /

To change to a directory within the root directory, type:

cd /(directory name)

Change to Home Directory

To change to the home directory, type:

cd ~

Be aware, if you are using the Root Terminal, this takes you to root's home, not your home.

To change to a directory within the home directory, type:

cd ~/(directory name)

Execute a Command

To execute a command, you can either execute it from where you are, and include the path, or use the cd command to change to that directory, then execute it. For example, if you were in the directory /home/ron/, to list the directories and files in the directory pictures, you could type:

ls pictures

or

cd pictures
ls

From anywhere you could type:

ls /home/ron/pictures

or

cd /home/ron/pictures
ls

This applies when executing any command.


< List the Contents of a Directory

Mount a Drive or Partition >


© Copyright Guy Shipard 2008 - 2009