LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
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.

Notices


Reply
  Search this Thread
Old 10-18-2013, 06:13 PM   #1
chomito44
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 linuxzoo.net 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.

Thanks
 
Old 10-18-2013, 06:43 PM   #2
Firerat
Senior Member
 
Registered: Oct 2008
Distribution: Debian sid
Posts: 2,683

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

Code:
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
Code:
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, 06:54 PM   #3
buttugly
Member
 
Registered: Feb 2006
Distribution: distrohopper
Posts: 58

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

open a terminal and type info cp
 
Old 10-18-2013, 08:37 PM   #4
suicidaleggroll
LQ Guru
 
Registered: Nov 2010
Location: Colorado
Distribution: OpenSUSE, CentOS
Posts: 5,573

Rep: Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142
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 08:39 PM.
 
Old 10-19-2013, 01:23 AM   #5
chomito44
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, 06:18 PM   #6
Firerat
Senior Member
 
Registered: Oct 2008
Distribution: Debian sid
Posts: 2,683

Rep: Reputation: 783Reputation: 783Reputation: 783Reputation: 783Reputation: 783Reputation: 783Reputation: 783
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
 
  


Reply



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 11:17 AM
tar dir and sub dir removing files but not existing not empty dir j-me Linux - General 2 08-12-2013 11:37 AM
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 09:56 AM
Command to display /dir, /dir/sub, /dir/sub/files knockout_artist Linux - Newbie 9 10-25-2007 02:57 PM
howto make a dir shared that is not in my home dir Schmurff Linux - Newbie 2 06-19-2004 07:54 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 09:53 AM.

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