mv command issue
Here we go again!
I'm working my way through a tutorial so I can learn Linux a lot better. I feel like I'm getting somewhere and then I get to something that seems should be easy, and then it stumps me. I don't want to post in here unnecessarily and I read man and info pages, but to be honest, there are times that man pages seem a bit cryptic to me and I've found that even though they provide a lot of useful information, they don't always have the answer. So, here goes.... This tutorial says to make a new directory in my home directory. No problem there. mkdir -p /home/bob/etc2 Theres a reason I named it etc2. Then it says to copy ALL the files from /etc into the directory I created. No problem there cp -aR /etc/* /home/bob/etc2 Then.... Change into etc2 and make a directory for files starting with an upper case character and one for files starting with a lower case character. Move all the files to the appropriate directories. Use as few commands as possible. Making the two directories isn't the problem. How do you move files that are designated by an uppercase and lowercase letter? I have no clue on this one. Thanks to all! Freestone Learning Linux....Eating an elephant one bite at a time! |
You can use character classes to build a pattern. For example, if you are in etc2 and you have directories called 1-upper and 2-lower (I prefixed them with numbers so the following doesn't pick them up by mistake):
Code:
mv [[:upper:]]* 1-upper Hope this helps. |
Gilead,
I read your reply and scratched my head. I thought you've gotta be kidding me....that won't work as I laughed to myself. It worked. The tutorial is for beginners. An intro to Linux. How is a beginner going to know about character classes in Bash? Geez. Thank you for your help! LQ, please don't mind if I ask 8 million and one more questions. |
How is a beginner going to know about something? Exactly the way you did - by trying it, reading man pages, asking for help... ;)
Ask away, there are plenty of people here willing to help - I still learn more from the posts than I contribute. |
@Freestone: what tutorial are you following? Just curious ..
|
Quote:
Keep posting and you will be giving answers in no time.....;) |
Muha,
The tutorial is: Introduction to Linux A Hands on Guide Machtelt Garrels I found it at the following url: http://tille.xalasys.com/training/tldp/ You can download the whole tutorial from here: http://www.tldp.org/guides.html There are some other tutorials at tldp that may be worth looking into. I downloaded the Bash Guide for Beginners also but I thought I'd better back up and do some fundamental things first, so, I humbled myself ~grin~ and started in on the Intro to Linux. To be honest, I don't even know why I'm trying so darned hard to become proficient in Linux. I don't need it for work, I guess its just a hobby...kind of Man conquering machine. Just for fun I guess. Even though I haven't established a solid reason for learning this fascinating OS, I'm in too deep now to stop. I can relate to some of the people in here that say, "I'm giving up and going back to that 'other OS', because there have been times that I felt the same way. But, with healthy pride I can say that I have one computer, a laptop, that has ONE OS on it, and that is FC5. No cross breezes here. ( No windows!) And thats the only computer that I own. So, to any of you out there that happen to read this post and are struggling with learning Linux, just keep at it and learn one thing a day if you can, even if its just a simple command from terminal (or your preffered CLI ). You don't have to learn it all in one week! ( Read my signature!!!) Thanks to all who have helped and I'll continue to help if I can. Linux is so darned frustrating that its.....fun! |
Quote:
(this one was already linked but hey! you never know ..) |
check out the help file in linux some distros do not support mv as move some move is move type
mv --help |
I think you lost me there Digital Surgeon... ;-)
Freestone, you want to check this out, very popular: http://rute.2038bug.com/index.html.gz |
Digital Surgeon,
I don't think you read my post clearly. I read the man pages and info pages concerning 'mv' -----they don't provide an answer to my question. People get PO'd when you ask a question in here and the answer is clearly in a man or info page. I get PO'd when someone replies without clearly reading the original post. Read my post again and, for that matter, read the whole thread!!!--- then come up with a better answer. It clearly states that I read the man and info pages on that command. Do the man or info pages on 'mv' contain information about moving files according to class, ie., upper case and lower case? No, they don't. Please, before you reply with a flippant, know-it-all response, consider what the person is asking. Anybody can say, "Read the man page!" They don't always spell it out for people. Cheers. |
Chrism01,
Geez, I just took a look at the link you directed me to and WOW. That looks like what I've been looking for! Talk about depth. Maybe I can learn it all in a week! ~grin~ Thanks!! |
Was just trying to help you by giving you info that I know thought youd appreciate it, jeeze wheres the spirit of linux in u.
Quote:
|
Quote:
Quote:
Quote:
|
All times are GMT -5. The time now is 01:25 AM. |