LinuxQuestions.org
Latest LQ Deal: Complete CCNA, CCNP & Red Hat Certification Training Bundle
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 05-03-2006, 05:40 PM   #1
Freestone
Member
 
Registered: Jan 2003
Location: Brighton, Michigan
Distribution: FC5
Posts: 114

Rep: Reputation: 15
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!
 
Old 05-03-2006, 05:51 PM   #2
gilead
Senior Member
 
Registered: Dec 2005
Location: Brisbane, Australia
Distribution: Slackware64 14.0
Posts: 4,125

Rep: Reputation: 164Reputation: 164
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
mv [[:lower:]]* 2-lower
Have a look in the man page for bash and search on character class.

Hope this helps.
 
Old 05-03-2006, 06:03 PM   #3
Freestone
Member
 
Registered: Jan 2003
Location: Brighton, Michigan
Distribution: FC5
Posts: 114

Original Poster
Rep: Reputation: 15
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.
 
Old 05-03-2006, 06:24 PM   #4
gilead
Senior Member
 
Registered: Dec 2005
Location: Brisbane, Australia
Distribution: Slackware64 14.0
Posts: 4,125

Rep: Reputation: 164Reputation: 164
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.
 
Old 05-04-2006, 04:43 AM   #5
muha
Member
 
Registered: Nov 2005
Distribution: xubuntu, grml
Posts: 451

Rep: Reputation: 37
@Freestone: what tutorial are you following? Just curious ..
 
Old 05-04-2006, 09:15 AM   #6
pixellany
LQ Veteran
 
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Arch/XFCE
Posts: 17,802

Rep: Reputation: 738Reputation: 738Reputation: 738Reputation: 738Reputation: 738Reputation: 738Reputation: 738
Quote:
Originally Posted by Freestone
The tutorial is for beginners. An intro to Linux. How is a beginner going to know about character classes in Bash? Geez.

LQ, please don't mind if I ask 8 million and one more questions.
You are already miles ahead of the average newbie. You asked a clear question and you followed up. Further, you elicited a response that allowed others to learn something (character classes).
Keep posting and you will be giving answers in no time.....
 
Old 05-04-2006, 11:23 AM   #7
Freestone
Member
 
Registered: Jan 2003
Location: Brighton, Michigan
Distribution: FC5
Posts: 114

Original Poster
Rep: Reputation: 15
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!
 
Old 05-04-2006, 11:55 AM   #8
muha
Member
 
Registered: Nov 2005
Distribution: xubuntu, grml
Posts: 451

Rep: Reputation: 37
Quote:
Originally Posted by Freestone
You can download the whole tutorial from here: http://www.tldp.org/guides.html
Thanks, i like to post these at http://bookmarks.linuxquestions.org so others can enjoy as well. Thanks
(this one was already linked but hey! you never know ..)
 
Old 05-04-2006, 10:04 PM   #9
Digital Surgeon
Member
 
Registered: Nov 2004
Location: Canada
Distribution: Ubuntu 7.10 - Gutsy Gibbon(Desktop Edition)
Posts: 184

Rep: Reputation: 30
check out the help file in linux some distros do not support mv as move some move is move type
mv --help
 
Old 05-05-2006, 02:35 AM   #10
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Centos 6.8, Centos 5.10
Posts: 17,240

Rep: Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324
I think you lost me there Digital Surgeon... ;-)
Freestone, you want to check this out, very popular: http://rute.2038bug.com/index.html.gz
 
Old 05-05-2006, 11:25 AM   #11
Freestone
Member
 
Registered: Jan 2003
Location: Brighton, Michigan
Distribution: FC5
Posts: 114

Original Poster
Rep: Reputation: 15
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.
 
Old 05-05-2006, 11:59 AM   #12
Freestone
Member
 
Registered: Jan 2003
Location: Brighton, Michigan
Distribution: FC5
Posts: 114

Original Poster
Rep: Reputation: 15
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!!
 
Old 05-07-2006, 11:30 AM   #13
Digital Surgeon
Member
 
Registered: Nov 2004
Location: Canada
Distribution: Ubuntu 7.10 - Gutsy Gibbon(Desktop Edition)
Posts: 184

Rep: Reputation: 30
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:
Originally Posted by Freestone
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.
 
Old 05-07-2006, 04:47 PM   #14
ioerror
Member
 
Registered: Sep 2005
Location: Old Blighty
Distribution: Slackware, NetBSD
Posts: 536

Rep: Reputation: 30
Quote:
Originally Posted by Freestone
Do the man or info pages on 'mv' contain information about moving files according to class, ie., upper case and lower
Of course not, character classes have nothing to do with mv, they are a feature of the shell (well, obviously lots of commands support regex but unquoted patterns on the command line are interpreted by the shell).

Quote:
Originally Posted by Freestone
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.
Dude, like, chill! This is a voluntary, public forum. It's a little unreasonable to expect a certain "quality" of answer. If that's what you want, you're gonna have to pay for it. There are plenty of consultants who will take your money.

Quote:
Originally Posted by Digital Surgeon
check out the help file in linux some distros do not support mv as move some move is move type
D.S., I can't make head or tail of that.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Command interpretation issue in Sed script file angel115 Programming 9 04-21-2006 08:26 PM
Change Directory Command Tabbing Issue sadarax Linux - General 3 01-17-2006 03:50 PM
mail command issue ...!!! balavignesh Linux - Newbie 2 12-27-2005 09:19 AM
date command manipulation issue tjtoed Red Hat 1 02-04-2004 11:10 AM
What command to issue to get KDE over SSH Saeven Linux - Networking 3 10-16-2002 09:24 PM


All times are GMT -5. The time now is 01:17 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration