You are not logged in.
Movie file called jarhead.mkv, folder called "Movies". I run
sudo cp jarhead.mkv Movies
to get one into the other. In doing so, I "lose" the entire contents of the "Movies" folder. Should I have run
sudo cp jarhead.mkv Movies/
or something?
Last edited by snafle (2008-04-27 00:32:18)
Offline
Yes indeed I should. Lucky I still have the DVDs. Can anyone explain how a single / can make it possible to molest my files, and possibly give a tiny amount of sympathy?
Offline
That's terrible.
I haven't made that mistake (yet). But only because I always stuck the / at the end of the directory. I didn't know what it did, but I thought it couldn't hurt to put it there...
You may get some consolation from this thread: http://bbs.archlinux.org/viewtopic.php?id=11728.
Offline
Cp exhibits similar behaviour . Normally, if you use shell (bash) expansion, it will put a slash at the end automatically. Nevertheless, you cannot create a file and directory with the same name in the same folder (ie ~/Movies folder and ~/Movies file), so it still looks a bit awkward. Did you set any aliases for mv?
Hmm...
Works fine right here:
[stijn@hermes ~]$ mkdir test
[stijn@hermes ~]$ mv 18\ Don\'t\ Ask\,\ Don\'t\ Tell.avi test
'18 Don\'t Ask, Don\'t Tell.avi' -> 'test/18 Don\'t Ask, Don\'t Tell.avi'
Got Leenucks? :: Arch: Power in simplicity :: Get Counted! Registered Linux User #392717 :: Blog thingy
Offline
Movie file called jarhead.mkv, folder called "Movies". I run
sudo cp jarhead.mkv Movies
to get one into the other. In doing so, I "lose" the entire contents of the "Movies" folder. Should I have run
sudo cp jarhead.mkv Movies/
or something?
uh?
> touch jarhead.mkv
> mkdir Movies
> cp jarhead.mkv Movies
> ls *
jarhead.mkv
Movies:
jarhead.mkv
>
pacman roulette : pacman -S $(pacman -Slq | LANG=C sort -R | head -n $((RANDOM % 10)))
Offline
snafle, are you really sure the directory was already there when you copied the file?
and now, is Movies really a directory or is it a file?
Offline
It was a folder with about a hundred movies in it, now it's a folder with a movie called jarhead.mkv
I'm pretty certain this is just one of the "learning experiences" that'll teach me to understand the commands I use first.
Shining: Why use the "touch" comand there.
Offline
touch creates a new empty file. It was just for the example.
Besides that why do you use sudo?
Offline
Strange:
$ touch test1
$ mkdir dir
$ touch dir/{test2,test3}
$ ls dir/
test2 test3
$ cp test1 dir
$ ls dir/
test1 test2 test3
$
I have no aliases for cp in my bashrc.
Offline
the files were in /mnt, not my home dir.
Offline
That doesn't change anything...
edit: yay, 1000st post
Last edited by Sigi (2008-04-27 17:04:34)
Haven't been here in a while. Still rocking Arch.
Offline
NAME
cp - copy files and directoriesSYNOPSIS
cp [OPTION]... [-T] SOURCE DEST
cp [OPTION]... SOURCE... DIRECTORY
cp [OPTION]... -t DIRECTORY SOURCE...DESCRIPTION
Copy SOURCE to DEST, or multiple SOURCE(s) to DIRECTORY.
See the second possibility. When the last argument is really a directory, the file(s) is just copied in. Also, you say that now 'Movies' is a dir with jarhead.mkv in it - so cp did exactly what it should have done. The deletion of the other movies is in my opinion not in any way connected with cp. Also, the particular shell used (bash, ksh, tcsh,...) should have no effect on this.
Offline
are you sure that your media was mounted? that would make sense. you were thinking there was a directory called movies, when really there was nothing. now your jarhead.mkv is named movies. just my $.02.
archlinux - please read this and this — twice — then ask questions.
--
http://rsontech.net | http://github.com/rson
Offline
Is is mounted now? If not maybe your data are not lost, but on an unmounted usbstick.
Offline
No, it's mounted. I know it is, because it's a 400 gigabyte disc mounted to a filesystem that resides on a 20 gigabyte partition. I couldn't fit the stuff on there if it wasn't there. And I know it is mounted, because I just ripped 70 gigs of movies onto it and queued up the conversions to x264.
@sigi: It should make a difference, since I don't have write permissions anywhere other than my home dir? At least I thought that's how it worked.
I ran this:
ls /mnt/video/movies
and it returned
jarhead.mkv
Offline
Have you modified your ~/.bashrc ? Please post it...
The day Microsoft makes a product that doesn't suck, is the day they make a vacuum cleaner.
--------------------------------------------------------------------------------------------------------------
But if they tell you that I've lost my mind, maybe it's not gone just a little hard to find...
Offline
Was actually anybody else than snafle able to reproduce this behavior? (Now don't take me wrong, I want to get to the bottom of this, it's just that it sounds completely unbelievable for me - for instance my zsh actually *strips* the slashes from the end of directories when I press enter to execute a command like ls .. or cp ..).
And snafle: to check if it's mounted, just run 'mount'
Offline
@sigi: It should make a difference, since I don't have write permissions anywhere other than my home dir? At least I thought that's how it worked.
If you have write permissions in a subfolder of /mnt depends on your settings in /etc/fstab. I'm quite sure someone already posted the answer to this whole thread: Could it be that the target of your copy command wasn't mounted by the time you tried to copy jarhead.mkv? You would end up with exactly this situation: /mnt/wherever/jarhead.mkv is there but all the files who have been in /mnt/wherever are gone. Isn't this your problem? Could you explain a little more detail about the medium and filesystem of the target?
Haven't been here in a while. Still rocking Arch.
Offline
My .bashrc is stock:
PS1='[\u@\h \W]\$ '
My video, music and backups folder are LVM partitions on a RAID 5'd disk- this is them in the fstab:
/dev/array/music /mnt/music jfs defaults 0 0
/dev/array/video /mnt/video jfs defaults 0 0
/dev/array/backups /mnt/backups jfs defaults 0 0
Running mount gives me
[snafle@server ~]$ mount
/dev/md3 on / type jfs (rw)
none on /dev type ramfs (rw)
none on /proc type proc (rw)
none on /sys type sysfs (rw)
none on /proc/bus/usb type usbfs (rw)
none on /dev/pts type devpts (rw)
none on /dev/shm type tmpfs (rw)
/dev/md1 on /boot type ext2 (rw)
/dev/mapper/array-music on /mnt/music type jfs (rw)
/dev/mapper/array-video on /mnt/video type jfs (rw)
/dev/mapper/array-backups on /mnt/backups type jfs (rw)
I've noticed that if I run "ls" in the directory, it shows jarhead as a different colour to other things I just copied over from my desktop. Jarhead was encoded on the machine and copied into the folder. The other files are listed as green, jardhead in the standard putty color (greyish).
At the moment, I have jarhead, and a bunch of other video files (200gigs+) in the folder. The jarhead is the same one I copied into the folder that started this whole thing. I can access them to watch both over the network and on the server. The disc is mounted and all the files are on it.
Could I have got the syntax wrong, and made a new blank folder where Movies was?
Offline
You've mentioned "movies" and "Movies". To linux, these are two different folders. Could this be the problem?
Offline
I'm pretty certain the lower case was just a typo on the transferal from screen to keys.. It's "Movies".
Last edited by snafle (2008-04-28 17:21:27)
Offline
I've edited my fstab to take into account what sigi said (letting me use it no-sudo'd). If anything, that's useful- thanks mate
Offline
Maybe jarhead is a folder where the rest of your movies went ? It's outrageous, I know....
The day Microsoft makes a product that doesn't suck, is the day they make a vacuum cleaner.
--------------------------------------------------------------------------------------------------------------
But if they tell you that I've lost my mind, maybe it's not gone just a little hard to find...
Offline
It's a video file, I can play it. It's about 1.13 gigs and loads in VLC.
Offline