Lenadi
Posts: 4
Joined: Tue Jun 18, 2013 1:47 am

Moving Files

Sun Dec 01, 2013 11:22 am

Hi All

I'm new to Linux (very new) and am currently stuck on moving a file. Everytime I try to move my newemail.wav file to the /var/lib/mpd/music directory, I get knocked back as having no permissions. I'm logged in as pi and have both sudo and admin permissions - what am I missing?

DBryant
Posts: 281
Joined: Sat Feb 02, 2013 12:41 pm
Location: Berkshire, UK

Re: Moving Files

Mon Dec 02, 2013 12:00 pm

You're not explicit about what comand you actually execute, the following should do it, where we're running the mv command as the superuser:

Code: Select all

sudo mv newemail.wav /var/lib/mpd/music
This assumes newemail.wav is in your current directory and /var/lib/mpd/music is a directory (if it's a file, then music will be overwritten). You will have to enter your password unless you've previously sudo-ed in the not to distant past.

If this fails then check the exact permissions of source and destination (ls -al); files might be something like "-rw-r--r--" and directories "drwxr-xr-x". Things like "----------" can be troublesome. Verify that the fileystem is mounted rw with

Code: Select all

mount
which will list all devices mounted , the fileysystem type and its attributes, noting the rw in the following example:

Code: Select all

/dev/sda1 on /backup1 type ext3 (rw,relatime)
Obviously you will have different devices (or not) but you want the one on which /var/lib/mpd/music is located ('df /var/lib/mpd/music' will tell you this, see 'man df')

Hope this helps

Return to “Beginners”