Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

When I move files with a GUI file manager, I navigate to the source and destination directory in 2 different windows, and then drag and drop. Is there a way to do this in BASH (move a file to a directory, but be able to navigate to the new directory rather than needing to know the full path right away to put in the argument)

I know how to use commands like mv, and cp, but both of these take one full path as the argument, and I want to be able to navigate to the new destination separate from navigating to the source file... if that makes sense

share|improve this question
    
I'm not sure if I understood correctly what you want to achieve. You can use two different terminal windows(or tabs) , or VTs if you are in console mode. Then you can move and/or copy files with mv and cp as you said, and connect to a directory with cd and list the files with ls. –  NikTh Sep 18 '13 at 22:42
1  
You have a current directory and you navigate using .. as previous directory and tab to complete. Eg mv test* ../../otherdir/private/ will move all files whose names start with test to the private directory of the otherdir directory of the second parent of the source. –  Sylwester Sep 18 '13 at 23:31
    
You can use the Tab key to complete paths and "navigate" directories while building the arguments to cp and mv. For example: type cp /ho and press the Tab key. –  Andrea Corbellini Sep 19 '13 at 17:47

2 Answers 2

I'm not sure if I understood, but you want a console file manager so you could navigate your folders in two panels. You could try with Midnight commander.

Install it with:

sudo apt-get install mc
share|improve this answer
    
Great answer. this is what i do now, but i really want to try to move into just using the terminal. I feel like knowledge like this will be especially handy when im ssh'd onto machines –  chasemc67 Oct 2 '13 at 15:38

You could use the tab feature that comes with ubuntu's terminal (ctrl + shift + t). This way you could search for your destination directory in the second tab using the cd and ls commands. then once in the desired directory you could use the pwd command (print working directory) to get the full path to said directory. Once you have that, copy and paste the path over to your first terminal tab where you are executing your cp or mv command.

enter image description here

If you are not familiar with cd and ls, here is a great little tutorial for some of the basic bash commands.

The Command Line Crash Course

I hope this is of some use to you.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.