Review your favorite Linux distribution.
Go Back > Forums > Linux Forums > Linux - General
User Name
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.


Search this Thread
Old 10-18-2013, 07:13 PM   #1
LQ Newbie
Registered: Aug 2013
Posts: 15

Rep: Reputation: Disabled
copying files from home dir to another dir from another dir in a lower dir

Seems a little crazy but that's the question in a quizz I am taking at one of the tutorials I found in the virtual machine I am working with. I have tried so many options like:

[demo@host-7-89 ~]$ls root dir
work letters misc: directories bigfile firstfile yearfile

cd misc
vimrc (file)

The riddle is: copy bigfile from home directory to misc directory and name it big file2

Please help, I have already tried all the options I could think of and now I am stuck.

Any help would be really appreciated and rewarded by the Linux Goddess.

Old 10-18-2013, 07:43 PM   #2
Senior Member
Registered: Oct 2008
Distribution: Debian Jessie / sid
Posts: 1,471

Rep: Reputation: 444Reputation: 444Reputation: 444Reputation: 444Reputation: 444
no riddle, it is an instruction

cp ~/bigfile /misc/big\ file2
cp = copy command
~/ = short for $HOME/ , which is 'short' for /home/<user>/ ,, or whatever is stated in the /etc/passwd file for home dir of the user

/misc/ is your target dir, big\ file2 is target filename
the \ , 'escapes' the space, spaces are 'special'
another way to 'protect' the space would be
cp ~/bigfile "/misc/big file2"
but your description is full of holes, I do not believe your ls output

and you may run into permission issues if /misc is not owned by the user

read manuals for cp and ls

man cp
man ls

use the ls to display more 'info' ( details are in the manual )
Old 10-18-2013, 07:54 PM   #3
Registered: Feb 2006
Distribution: distrohopper
Posts: 40

Rep: Reputation: 11
cp ~/bigfile ~/misc/bigfile2 worked for me

open a terminal and type info cp
Old 10-18-2013, 09:37 PM   #4
Senior Member
Registered: Nov 2010
Location: Colorado
Distribution: OpenSUSE, CentOS
Posts: 3,222

Rep: Reputation: 1155Reputation: 1155Reputation: 1155Reputation: 1155Reputation: 1155Reputation: 1155Reputation: 1155Reputation: 1155Reputation: 1155
Riddle? That's just a basic copy, nothing special about it.

Copy a file from one dir to another dir from a 3rd dir. Just use absolute paths to reference the source and destination and it doesn't matter where "you" are. I would recommend looking up basic filesystem navigation in your search engine of choice to learn more about how you would do this. This operation is actually no different than working on the command line in any other operating system...osx, windows, etc.

Last edited by suicidaleggroll; 10-18-2013 at 09:39 PM.
Old 10-19-2013, 02:23 AM   #5
LQ Newbie
Registered: Aug 2013
Posts: 15

Original Poster
Rep: Reputation: Disabled
Well, I appreciate some of your criticism and ironic comments. I am absolutely positive that it is not too complicated, I just haven't had enough time to do my homework lately and I can very well learn anything on my own, just like everything else. I am out of this "geniuses" forums for good. Have a good life all of you.
Old 10-19-2013, 07:18 PM   #6
Senior Member
Registered: Oct 2008
Distribution: Debian Jessie / sid
Posts: 1,471

Rep: Reputation: 444Reputation: 444Reputation: 444Reputation: 444Reputation: 444
apologies for offending you, this was not my intention

however, what you. "described" is very basic,
so basic it will be covered in your study notes

if you do not have time for your homework I can not help you
not sure anyone can/will


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 On
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Move files contained in source dir to destination dir, but not source dir itself unixunderground Linux - Software 3 09-20-2013 12:17 PM
tar dir and sub dir removing files but not existing not empty dir j-me Linux - General 2 08-12-2013 12:37 PM
cp help, copying multiple doc files from multiple dir to one dir. How do i do that? w@m Linux - Newbie 5 02-03-2010 10:56 AM
Command to display /dir, /dir/sub, /dir/sub/files knockout_artist Linux - Newbie 9 10-25-2007 03:57 PM
howto make a dir shared that is not in my home dir Schmurff Linux - Newbie 2 06-19-2004 08:54 PM

All times are GMT -5. The time now is 06:16 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 @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration