LinuxQuestions.org
Latest LQ Deal: Linux Power User Bundle
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
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!

Notices


Reply
  Search this Thread
Old 08-20-2012, 06:59 PM   #1
Pompous
LQ Newbie
 
Registered: Aug 2012
Posts: 4

Rep: Reputation: Disabled
How do I move a file on my desktop to another directory using terminal?


I'm asking because the file needs root access, so I can't just copy it in. Any help would be much appreciated.
 
Old 08-20-2012, 07:04 PM   #2
kindofabuzz
Member
 
Registered: Mar 2010
Location: There
Distribution: Linux Mint 17.1
Posts: 237

Rep: Reputation: 45
man mv
 
Old 08-20-2012, 07:13 PM   #3
Pompous
LQ Newbie
 
Registered: Aug 2012
Posts: 4

Original Poster
Rep: Reputation: Disabled
How would I structure the command using mv?
 
Old 08-20-2012, 08:09 PM   #4
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Centos 6.9, Centos 7.3
Posts: 17,362

Rep: Reputation: 2377Reputation: 2377Reputation: 2377Reputation: 2377Reputation: 2377Reputation: 2377Reputation: 2377Reputation: 2377Reputation: 2377Reputation: 2377Reputation: 2377
Examples
Code:
cp /path/to/file/filename /new/path/filename

mv /path/to/file/filename /new/path/filename
cp just copies, mv actually moves it ie original is 'deleted'.
However(!) in either case you need sufficient rights to do this.
Who are you trying to do this as and what do the ownerships/perms look like on the file?
Code:
ls -l /path/to/file/filename
That's a lowercae L switch there & substitute the actual path & filename of the real file...
 
  


Reply


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
[SOLVED] make a folder for each file in a directory then move the file into it genderbender Programming 14 12-02-2010 10:59 AM
Move old file to other directory elainelaw Linux - Newbie 1 02-02-2010 02:25 AM
terminal command to move a file to another directory vipjag2 Linux - Newbie 7 05-11-2009 10:37 PM
how do i get permission to move file into directory timalan SUSE / openSUSE 2 08-24-2005 09:25 PM
Is it possible to move file from /dev to other directory? raindrop Linux - Hardware 2 11-13-2002 05:37 PM


All times are GMT -5. The time now is 02:46 PM.

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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration