Note: Don't use asterisks, backslashes, or question marks in Linux file names--these characters have special meaning to the shell and could cause your commands to do something quite different from what you intended. Also avoid using a dash as the first character of a file name, since most Linux commands will treat it as a switch.
Files starting with a dot are hidden files. They behave just like any other file, except that the ls (list files) command will not display them unless you explicitly request it to do so. Your .profile file is an example of a hidden file.
Also remember that Linux file names are case sensitive, which can be difficult to get used to if you have a DOS background. Linux allows you to have unique files named goodstuff, GOODSTUFF, and GoodStuff in the same directory.
It's best to always use lowercase in Linux unless you can think of a good reason to use uppercase or mixed case. Most Unix people use lowercase almost exclusively, but aside from this "cultural" point, there's another good reason to use lowercase. If you're sharing or accessing a DOS file system with Linux, DOS will not be able to see the files that have uppercase or mixed-case file names.
Unlike under DOS, the dot character (.) has no special meaning. You're not limited to the eight dot three (xxxxxxxx.yyy) style of naming because Linux treats the dot just like any other character; you can name a file Some.Yummy.CHEESECAKE.Recipes if you're so inclined.
Along these lines, Linux executables do not need or use a special extension such as .exe or .bat. Linux will happily run a program file named zippity just as readily as it will run DOODAH.EXE.
And here's another slight difference between Linux and DOS filesystems. Linux uses the forward slash (/) in path names, and DOS uses the backslash (\). Don't blame this little quirk on Linux though . . . the DOS filesystem was originally modeled after Unix! In fact, the popular rumor is that Bill Gates and Company implemented the DOS filesystem just differently enough from the Unix filesystem to avoid being criticized for stealing the idea. The same charge is made about the DOS batch file (.BAT) utility, since it bears striking similarities to the Unix shell scripting languages, but I digress. . . .
Previous Lesson: The Linux File System
Next Lesson: Linux Directories
Comments (most recent first)
kumar (26 Aug 2010, 04:39)
does any one know the link where i can get
"Programming the world wide web 4th edition by Robert W.Sebesta"
Bob Rankin (08 Jun 2010, 06:11)
@Graeme - It's an amazing thing... I'm meeting more and more people who can
TYPE, but they cannot READ! :-)
Graeme (08 Jun 2010, 03:58)
I find it very ignorant that so many people think that they can demand that
you teach them linux on a one to one basis. Is it not enough for them that
you have given them this website? They seem to think you have all the time
in the world to commit to them. They should try and learn it themselves as
everything they need to do so is right here but they are just too lazy to
teach themselves! Thanks for this great piece of work!
Bob Rankin (14 May 2010, 06:01)
Is the ^M at the end of the filename, or at the end of each line INSIDE the
file?
nazc (12 May 2010, 23:06)
Hi there...
I am trying to have this simple script run by cron... It's basically a dump file of my MySQL database... The problem is, though the output file gets successfully created, I cannot ftp it to my local directory. Upon inspection, I notice a ^M character at the end of the filename... What I did was to use mv command to copy/move the contents of the same file (but this time, minus the ^M characters at the end) to the same filename... It works fine... However, I was wondering if say, I include the same mv command on the script, will it work - or mv will work but it will also append ^M characters to the end of the new output file?? |
|
|
![]() |
|
| <Send This Link to a Friend> <Bookmark This Page> | ||