home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!olivea!spool.mu.edu!howland.reston.ans.net!usc!sdd.hp.com!hpscit.sc.hp.com!cupnews0.cup.hp.com!news1.boi.hp.com!hp-pcd!hpcvra!rnews!hpcvbbs!akcs.alistairl
- From: akcs.alistairl@hpcvbbs.cv.hp.com (Alistair S Lang)
- Newsgroups: comp.sys.hp48
- Subject: Filenames With Bad Characters
- Keywords: files bad characters
- Message-ID: <2b652703.2690comp.sys.hp48@hpcvbbs.cv.hp.com>
- Date: 26 Jan 93 12:40:02 GMT
- Lines: 39
-
- Recently there have been a few programs uploaded to seq. that have
- contained "silly" characters ; i.e., those that a Unix does not take too
- kindly to. This can be annoying as it may prevent you from viewing the
- file or downloading it or make renaming or purging of the file seem
- impossible. However I eventually found a command (in a Unix FAQ) that
- will permit purging and/or renaming of such files. There are probably
- a few commands that can do this but the one listed below seems to be
- quite "powerful" and can handle most things.
-
- ===============
- Part of the Biweekly Posted FQA form comp.unix.questions
- ---------------
-
- 2.2) How do I remove a file with funny characters in the filename ?
-
- find . -type f ... -ok rm '{}' \;
-
- where "..." is a group of predicates that uniquely identify the
- file. One possibility is to figure out the inode number of the
- problem file (use "ls -i .") and then use |
- |
- find . -inum 12345 -ok rm '{}' \; |
- ^^^^^ |
- \\\\\__________________________________/
- or
- find . -inum 12345 -ok mv '{}' new-file-name \;
-
- "-ok" is a safety check - it will prompt you for confirmation of
- the command it's about to execute. You can use "-exec" instead
- to avoid the prompting, if you want to live dangerously, or if
- you suspect that the filename may contain a funny character
- sequence that will mess up your screen when printed.
- ==================
-
- A couple of things to note:
- Use the first command to remove (rm) the file or use the second to
- rename (mv) the file.
- Use the on-line Unix manual for more info.
-
- Alistair
-