Escape Characters in File Named

If you download files from the Web, they may have been created under Windows, with names inconsistent with Unix. 

Here are a couple of tips for handling this:

The most common problem is file names with embedded spaces, say a file named before July. To reference such a file from a C shell command line, simply precede each space by a backslash. For instance, to remove the file before July, type 

rm  before\  July

Suppose you have a file whose name begins with the character ‘-’. The problem here is that most Unix commands use that character to signify options to the commands. 

For example:

ls  -ul

is the command to list the files and their latest access times.

Say you have a file named -trendy, which you want to copy to xyz. You could not simply type

cp  -trendy  xyz

but could type

cp  --  -trendy  xyz

The double hyphen tells the shell that there will be no more options on this line.

Have a Unix Problem
Unix Forum - Do you have a UNIX Question?

Unix Books :-
UNIX Programming, Certification, System Administration, Performance Tuning Reference Books

Return to : - Unix System Administration Hints and Tips

(c) www.gotothings.com All material on this site is Copyright.
Every effort is made to ensure the content integrity.  Information used on this site is at your own risk.
All product names are trademarks of their respective companies.
The site www.gotothings.com is in no way affiliated with or endorsed by any company listed at this site.
Any unauthorised copying or mirroring is prohibited.