LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 12-07-2007, 07:30 AM   #1
sandeshsk007
LQ Newbie
 
Registered: Oct 2007
Posts: 14

Rep: Reputation: 0
Help with listing files


Hi All,

I have a certain requirement where in , when i list all files with the hyphen a option , i must not get certain files. How would you do this .That is what should be the name to be given to the file if it has to be hidden from this command ? Please help me in this regard.


Thanks
Santosh
 
Old 12-07-2007, 07:53 AM   #2
farslayer
LQ Guru
 
Registered: Oct 2005
Location: Northeast Ohio
Distribution: linuxdebian
Posts: 7,249
Blog Entries: 5

Rep: Reputation: 191Reputation: 191
Please do not tag threads as urgent, all responses here are made by volunteers in their own free time. I don't see anything urgent about your request to begin with.. Not like you have a server that crashed or something, not that that would make a difference..

so it looks like you want to sort based on a pattern of some kind ? Like list all the files that begin with abc ? heres a command for you apropos. Apropos searches the manual pages descriptions for the term specified and returns commands that meet that search criteria.. then you can view their man pages for further info..

apropos pattern will give you a list of commands used for pattern matching. Things such as grep, awk, etc..

more detail on what you are trying to show in your results, would be helpful to get a more useful answer..
 
Old 12-07-2007, 08:33 AM   #3
ehawk
Senior Member
 
Registered: Jul 2003
Posts: 1,257

Rep: Reputation: 48
look at the --ignore flag on the following man page:

http://linux.die.net/man/1/ls

unlike the --hide flag, --ignore is not overridden by -a

Last edited by ehawk; 12-07-2007 at 08:34 AM. Reason: terminology correction
 
Old 12-07-2007, 11:26 AM   #4
reddazz
LQ Guru
 
Registered: Nov 2003
Location: N. E. England
Distribution: Fedora, CentOS, Debian
Posts: 16,298

Rep: Reputation: 77
I've edited the thread title. In the future please avoid using "urgent", "help me" and other titles that do not describe or summarise your problem. Good thread titles help increase the exposure of your thread.
 
Old 12-07-2007, 12:12 PM   #5
sandeshsk007
LQ Newbie
 
Registered: Oct 2007
Posts: 14

Original Poster
Rep: Reputation: 0
What i have asked is different, what i mentioned was how do i rename a file such that its not listed in the listing all options. ie wen i use ls with the a option , the file must not be listed.how do i do that ?

Thanks and Sorry about the topic of the mail.
 
Old 12-07-2007, 01:20 PM   #6
farslayer
LQ Guru
 
Registered: Oct 2005
Location: Northeast Ohio
Distribution: linuxdebian
Posts: 7,249
Blog Entries: 5

Rep: Reputation: 191Reputation: 191
I don't see the purpose in making a filename hidden to the point it can't be seen by ls -a, unless you are working on writing a rootkit...


What exactly are you trying to accomplish and why ???
 
Old 12-07-2007, 01:54 PM   #7
sandeshsk007
LQ Newbie
 
Registered: Oct 2007
Posts: 14

Original Poster
Rep: Reputation: 0
I am trying to implement a new function to retrieve the files which are deleted, trying to sort of use a trash bin for the deleted files and retrieve it back.the files in the bin should not be visible to user so im implementing it.

Thanks
 
Old 12-07-2007, 03:06 PM   #8
Tinkster
Moderator
 
Registered: Apr 2002
Location: earth
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
Blog Entries: 11

Rep: Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928
http://homepage.esoterica.pt/~nx0yew/delsafe/

Of course I can't stop you from re-inventing wheels, but unless
you're very good they may turn out square, or with an off-centre
axil ... oh well. Anyway: you can't hide a file from ls' all-together
unless you hack ls in a way that makes it ignore files e.g. with
a special non-printable character. Bad idea, though.



Cheers,
Tink
 
Old 12-07-2007, 03:32 PM   #9
sandeshsk007
LQ Newbie
 
Registered: Oct 2007
Posts: 14

Original Poster
Rep: Reputation: 0
Ok thanks ...i ll try that implementation.
On the same note, to Tinkster my question is what would be tht spl character? i cud try tht too ...

Thanks
 
Old 12-07-2007, 03:52 PM   #10
Tinkster
Moderator
 
Registered: Apr 2002
Location: earth
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
Blog Entries: 11

Rep: Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928
Quote:
Originally Posted by sandeshsk007 View Post
Ok thanks ...i ll try that implementation.
On the same note, to Tinkster my question is what would be tht spl character? i cud try tht too ...

Thanks
man ascii
anything smaller 0x1F, for example ... of course there's
not just 'ls' you'd need to hack. There's bash (with it's
TAB expansion and globbing), there's 'mc', maybe some GUI
tools like Konqueror, Nautilus, .... if I were you I'd
abandon the idea rather quickly :} and move on to known
tools and some user training ;}


Cheers,
Tink
 
Old 12-07-2007, 04:04 PM   #11
sandeshsk007
LQ Newbie
 
Registered: Oct 2007
Posts: 14

Original Poster
Rep: Reputation: 0
Yeah may be i will follow suite :}
Thanks a lot
 
  


Reply


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
listing files and burning files - just a question radiodee1 Debian 1 11-26-2006 07:29 AM
listing all files of a certain user X-GhoSt Linux - General 1 10-22-2005 03:22 AM
listing files in to an array sujith_deva Programming 1 12-12-2004 02:14 PM
listing files in a directory Linh Programming 7 05-17-2004 04:35 AM
listing large files fintan Linux - Newbie 7 11-06-2003 11:40 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 03:59 AM.

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