Please use ***[code][/code] tags
*** around your code and data, to preserve formatting and to improve readability. Please do not
use quote tags, bolding, colors, or other fancy formatting.
When a pathname starts with "/
" it signifies the absolute path
to the file, starting from the system root. So this is looking for the file in "rootdir > downloads
", not "rootdir > home > user > Downloads
", the directory it's actually in.
If you are already in the directory with the file, you don't need to use the full path. Just use the relative
path. Naming the file itself alone is usually enough, or alternately you can prefix it with ".
", which means the current directory (and "..
" means the parent directory).
" is a pathname shortcut for your home dir, so you can include it instead of the "/home/user
" part of the pathname. You could also use the $HOME
variable, which contains the same string.
So any of these should work to move the file, assuming you are currently in the Downloads directory:
mv Downloads/binutils-2.22.tar.bz2 /mnt/lfs/sources
mv ./Downloads/binutils-2.22.tar.bz2 /mnt/lfs/sources
mv ~/Downloads/binutils-2.22.tar.bz2 /mnt/lfs/sources
mv $HOME/Downloads/binutils-2.22.tar.bz2 /mnt/lfs/sources
mv /home/user/Downloads/binutils-2.22.tar.bz2 /mnt/lfs/sources
To work with multiple files at once, have a look at globbing:
Finally, it's also vital to understand how the shell handles arguments and whitespace. If a filename contains whitespace you'll need to quote or backslash it: