Review your favorite Linux distribution.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!


  Search this Thread
Old 06-11-2008, 05:24 AM   #1
LQ Newbie
Registered: Apr 2008
Location: Melbourne, Australia
Distribution: Arch, Ubuntu 8.04
Posts: 27

Rep: Reputation: 15
how do I specify the current directory on the command line

I'm trying to figure out how to specify the current directory on the command line. For example, now, when I'm in a directory that I want to copy something into I would do something like this:
user@host:~/Documents/Uni$ cp /mnt/sda2/path/file ~/Documents/Uni
Is there a shortcut to specify the current directory?

Edit: BTW I am using bash

Last edited by powerpleb; 06-11-2008 at 05:26 AM.
Old 06-11-2008, 05:26 AM   #2
LQ Addict
Registered: Jul 2003
Location: London, UK
Distribution: Slackware
Posts: 7,464

Rep: Reputation: Disabled
Yes, it's a dot: .
Also, ".." is short for the parent directory.

Last edited by Nylex; 06-11-2008 at 05:29 AM.
Old 06-11-2008, 05:27 AM   #3
LQ Guru
Registered: Nov 2003
Location: N. E. England
Distribution: Fedora, CentOS, Debian
Posts: 16,298

Rep: Reputation: 75
Use a dot e.g.
cd ~/Documents/Uni
cp /mnt/sda2/path/file .
Old 06-11-2008, 05:28 AM   #4
LQ Newbie
Registered: Apr 2008
Location: Melbourne, Australia
Distribution: Arch, Ubuntu 8.04
Posts: 27

Original Poster
Rep: Reputation: 15

Originally Posted by Nylex View Post
Yes, it's a dot: .
LOL. It's so simple, thanks a lot!


command, current, directory, line

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
move all files in current directory into a subdirectory in the current directory jakykong Linux - Newbie 8 07-16-2013 11:46 PM
Opening a directory in command line Yash Pal Linux - Newbie 8 07-27-2007 03:45 AM
change user home directory from command line cccc Debian 1 03-23-2006 05:07 PM
how do I copy a whoel folder form one directory to another form the command line? zwyrbla Linux - Newbie 8 08-24-2004 06:40 PM
share a samba directory with the command line Mugatu Linux - Software 2 01-08-2004 01:44 PM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 11:23 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration