Download your favorite Linux distribution at LQ ISO.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
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!


  Search this Thread
Old 10-04-2007, 11:42 AM   #1
LQ Newbie
Registered: Sep 2003
Location: Illinois
Posts: 4

Rep: Reputation: 0
Finding Files or Directories with Apostrophe in name

I'm not 100% sure where I should look for an answer to this, so I'll create a new thread... I am having an issue with CMS (Joomla) and possibly some file/directory names under my "images" directory... Looking through the Joomla forums, they said my problem could be because of any file or directory with an apostrophe in the name... but I have SEVERAL sub-directories and more files/sub-directories in those...

Is there a command I can type in that will search for all file and/or directory names and print the ones out that have an apostrophe in their name? It has taken me about an hour to sort through 5 of the sub-directories as it is and I have about 25-30 to go... so this would make my job a LOT easier.

Life would be great if it weren't for end-users!!!
Old 10-04-2007, 12:22 PM   #2
LQ Guru
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 11,761

Rep: Reputation: 1587Reputation: 1587Reputation: 1587Reputation: 1587Reputation: 1587Reputation: 1587Reputation: 1587Reputation: 1587Reputation: 1587Reputation: 1587Reputation: 1587
find /path/to/images -name "*'*"
to search from /path/to/images downwards.

Old 10-04-2007, 12:25 PM   #3
LQ Veteran
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Arch/XFCE
Posts: 17,802

Rep: Reputation: 738Reputation: 738Reputation: 738Reputation: 738Reputation: 738Reputation: 738Reputation: 738
ls -R|grep \'
Works for me

To test this, I also learned how to MAKE a file with "'" in the name:
touch asd\'f
creates file named "asd'f"
Old 10-04-2007, 01:44 PM   #4
LQ Newbie
Registered: Sep 2003
Location: Illinois
Posts: 4

Original Poster
Rep: Reputation: 0
Thanks a bunch! I found 13 files and 4 directories with an apostrophe in the name... hopefully this will fix the problem I am having!!!


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
finding empty directories with bash Iriel Solaris / OpenSolaris 10 02-18-2016 03:59 AM
wine not finding directories dasy2k1 Linux - Software 2 06-01-2007 05:59 AM
Finding files and directories ihatecomputers Linux - Software 1 03-24-2005 09:29 AM
finding directories w/ certain permissions secular Linux - Security 1 12-28-2004 04:36 PM
finding empty directories... PokerFace Linux - General 2 10-16-2002 08:23 AM

All times are GMT -5. The time now is 08:54 PM.

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