Little Girl's Mostly Linux Blog

ChangeDirectory

Change directory

This page was last updated on October 10, 2013.

It’s not recommended to use special meta-characters (like *, ?, $, &, brackets, etc.) in file names or directory names because they have special meaning to the Linux shell.

Go home

  1. Type this command in a terminal window, replacing username with your user name:
    cd /home/username

    Or type this command in a terminal window:

    cd ~

    Or type this command in a terminal window:

    cd
  2. Press the Enter key.

Change to a directory up one level

  1. Type this command in a terminal window:
    cd ..
  2. Press the Enter key.

Change to the previous directory

  1. Type this command in a terminal window:
    cd -
  2. Press the Enter key.

Change to a directory with spaces in its name

  1. Type this command in a terminal window, replacing My\ Stuff with the name of your directory with backslashes before each space:
    cd My\ Stuff

    Or type this command in a terminal window, replacing My Stuff with the name of your directory:

    cd "My Stuff"

    Or type this command in a terminal window, replacing My with the first word of your directory name:

    cd My*
  2. Press the Enter key.

Obligatory Happy Ending

And they all lived happily ever after. The end.

Advertisements

Leave a Comment »

No comments yet.

RSS feed for comments on this post. TrackBack URI

Comment:

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Blog at WordPress.com.

%d bloggers like this: