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 |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
|
08-22-2012, 12:05 PM
|
#1
|
Member
Registered: Dec 2009
Distribution: Slackware 14
Posts: 282
Rep:
|
Question about creating files, and upper and lower case letters
What is the programme that writes files on to the hard drive? and then writes the filename to creates the inodes (?)
To give an example, say Im downloading a file called 'Match Of The Day.avi. Is there an option to the programme that is handling the writing of the file to the hard drive to write all the letters in the filename to lower-case?
|
|
|
08-22-2012, 12:57 PM
|
#2
|
Senior Member
Registered: Nov 2004
Location: Texas
Distribution: RHEL, Scientific Linux, Debian, Fedora
Posts: 3,935
Rep:
|
Your first question ultimately refers to system calls and filesystem operations. Not going to speak to that, when I think your real (much simpler) question is:
Quote:
Originally Posted by clifford227
To give an example, say Im downloading a file called 'Match Of The Day.avi. Is there an option to the programme that is handling the writing of the file to the hard drive to write all the letters in the filename to lower-case?
|
It depends on the program you're using to download the file. If you're using wget(1), for instance, there is an -O (that's a capital "o") option that can be used like so:
Code:
$ wget -O good-sneaky-name.html 'http://google.com/index.html'
|
|
1 members found this post helpful.
|
08-22-2012, 01:00 PM
|
#3
|
Member
Registered: Jun 2012
Location: USA
Distribution: Ubuntu
Posts: 424
Rep:
|
You can name a downloaded file anything you want.
|
|
|
08-22-2012, 01:02 PM
|
#4
|
Senior Member
Registered: Nov 2004
Location: Texas
Distribution: RHEL, Scientific Linux, Debian, Fedora
Posts: 3,935
Rep:
|
@clifford227: At second read, I think you're actually asking whether you can keep the name, but convert it to lower case. I can only think of contrived scripting methods for doing so. Don't know of any tidy program option.
wget(1)'s --restrict-file-names may be promising, but I've never tested it.
|
|
3 members found this post helpful.
|
08-22-2012, 04:25 PM
|
#5
|
Member
Registered: Dec 2009
Distribution: Slackware 14
Posts: 282
Original Poster
Rep:
|
First let me apologise for this late reply.
I dont have my desktop system up and running yet (Im waiting for Slack 14), and in the meantime I am having to borrow a laptop from someone else.
Unfortunatley, almost immediately after creating this thread, I had to give the laptop back, and I am only now able to reply.
Quote:
Originally Posted by anomie
@clifford227: At second read, I think you're actually asking whether you can keep the name, but convert it to lower case.
|
Yes, thats correct.
The reason I wanted to do that was because I was having problems with the 'find' command, which has been driving me up the wall.
I have now stumbled upon a partial solution, the ls and grep commands which I then use in an alias:
Code:
alias search='ls | grep -i'
When given a search word in either upper or lower case, the alias returns both upper and lower case matches.
Last edited by clifford227; 08-22-2012 at 04:31 PM.
|
|
|
08-22-2012, 04:44 PM
|
#6
|
Moderator
Registered: Dec 2009
Location: Germany
Distribution: Whatever fits the task best
Posts: 17,148
|
If you use find with the -iname option instead of the -name option you have the same effect: a case-insensitive search.
|
|
|
08-22-2012, 06:22 PM
|
#7
|
Member
Registered: Dec 2009
Distribution: Slackware 14
Posts: 282
Original Poster
Rep:
|
Quote:
Originally Posted by TobiSGD
If you use find with the -iname option instead of the -name option you have the same effect: a case-insensitive search.
|
I did try the -iname option, but I was getting some strange results.
(Although it is possible that I wasnt using the find command properly. I had a hard time following the man page.)
If I remember, if there was only one file with a name containing a search word, find would find it and print it to the screen, but if there were two files that contained the search word, find wouldnt list either, or it would only find a case-sensitive match (I cant quite remember exactly, but find wasnt giving me the results I expected).
Last edited by clifford227; 08-22-2012 at 06:27 PM.
|
|
|
08-22-2012, 06:27 PM
|
#8
|
LQ Guru
Registered: Aug 2004
Location: Sydney
Distribution: Rocky 9.2
Posts: 18,397
|
find with case IN-sensitive search
Code:
find /somedir -iname '*.dat' -print
It really does work as TobiSGD said
|
|
|
08-22-2012, 06:40 PM
|
#9
|
Member
Registered: Dec 2009
Distribution: Slackware 14
Posts: 282
Original Poster
Rep:
|
Chris,
I'll take another look at find tomorrow, and see if I can reproduce the problem.
|
|
|
08-23-2012, 02:18 AM
|
#10
|
Senior Member
Registered: Jan 2005
Location: Roodepoort, South Africa
Distribution: Ubuntu 12.04, Antix19.3
Posts: 3,797
|
The 'iname' option is not always available; depends on the implementation of 'find' in the distro. I ran into that problem last night while using DSL. And the error message in this case left a lot to be desired
|
|
|
08-23-2012, 05:02 AM
|
#11
|
Moderator
Registered: Dec 2009
Location: Germany
Distribution: Whatever fits the task best
Posts: 17,148
|
Quote:
Originally Posted by Wim Sturkenboom
The 'iname' option is not always available; depends on the implementation of 'find' in the distro. I ran into that problem last night while using DSL. And the error message in this case left a lot to be desired
|
That is because DSL uses the find program that is inbuilt to Busybox, for space reasons. Most Busybox versions of commands come with a reduced feature set, otherwise they would take the same space as the GNU and BSD versions.
|
|
|
All times are GMT -5. The time now is 11:38 AM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|