Skip to main content
gamedev.net
🔒 Locked

Linux: mv command

Started by Instigator Dec 21, 2006 at 7:18 PM 3 replies 6.1k views
Original Post
Instigator
Instigator
I'm trying to move everything in a directory to another directory. normally to move 'file.txt' to '/etc/somefolder' I would just do: 'mv file.txt /etc/somefolder' // simple enough However, my problem is that I have like 50 files in a directory and I have to move it into a folder at '/etc/somefolder'. Any ideas for moving all file to a directory?
DakeDesu
DakeDesu
I would like to note that some schools of thought, believe that the configuration should be stored in the home directory of those responsibible for modifying them, such as /root.

Then once something like xorg.conf is to be mv'd to /etc instead the following command is ln -s /root/xorg.conf.curr /etc/X11/xorg.conf

This is merely a school of thought to avoid moving things around in your /etc, and allow for easier backup, and modification of files in /etc--you may choose to follow it or you may not.

-=-

Also you can move entire folders using mv

So mv folder/ /etc/somefolder would move the entire folder 'folder/' into '/etc/somefolder'

Just keep in mind other commands like 'cp' tend to have different behaviour

One example is the -R flag that is require for recursive copying. Now be careful. On some systems (I have no idea if this is an unintentional glitch or if it is intented) cp -R folder/ /path/to/dest will copy the contents of folder, rather than the directory folder. Generally it is best, to avoid this glitch, you simply do not include the slat(/) cp -R folder /path/to/dest (which means you should careful with tab completion (about the only decent tab completion I've found in my conquests is ksh))
pulpfist
pulpfist
I personally use the -r option to both mv and cp and never had a problem with it.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.