LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
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!

Notices

Reply
 
Search this Thread
Old 11-30-2010, 10:07 AM   #1
grob115
Member
 
Registered: Oct 2005
Posts: 528

Rep: Reputation: 32
Exclude "Permission denied" files for "ls -al"


Sometimes when I do "ls -al" I am given a list of files with Permission Denied messages. If I do "ls -al | grep -v 'Permission'" it'd still list them on the screen. Is there anyway to stop this?

I want to be able to do this ultimately but not when it keeps giving me these Permission Denied file names.
find . -user 'username' -exec rm -rf '{}'\;
 
Old 11-30-2010, 10:09 AM   #2
GrapefruiTgirl
Guru
 
Registered: Dec 2006
Location: underground
Distribution: Slackware64
Posts: 7,594

Rep: Reputation: 550Reputation: 550Reputation: 550Reputation: 550Reputation: 550Reputation: 550
Maybe dump the error messages to /dev/null (outer space!):
Code:
la -al 2>/dev/null
Of course, this will hide errors that you may be interested in too (it will toss all errors in the trash).
 
Old 11-30-2010, 10:10 AM   #3
grail
Guru
 
Registered: Sep 2009
Location: Perth
Distribution: Manjaro
Posts: 7,562

Rep: Reputation: 1939Reputation: 1939Reputation: 1939Reputation: 1939Reputation: 1939Reputation: 1939Reputation: 1939Reputation: 1939Reputation: 1939Reputation: 1939Reputation: 1939
Well the question you have to ask yourself is where are the error messages being delivered to, remembering that a pipe by default delivers stdout to the stdin of the next command.
 
Old 12-03-2010, 09:45 AM   #4
grob115
Member
 
Registered: Oct 2005
Posts: 528

Original Poster
Rep: Reputation: 32
Ah thanks thought the pipe command sends everything (both stdout and error) to the next command.
 
  


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
[SOLVED] du says "cannot read directory" and "permission denied", but I have rwx permissions mrtwice Linux - Software 14 04-21-2010 12:38 PM
"Permission Denied" when using Ubuntu live cd to recover thunderbird files. gkhoward Linux - Newbie 5 06-04-2009 11:12 AM
"Permission denied" and "recursive directory loop" when searching for string in files mack1e Linux - Newbie 5 06-12-2008 07:38 AM
"Permission denied" when trying to copy files into mounted windows with all rights twist3r Linux - Newbie 14 05-06-2008 05:30 PM
Keep getting "Permission Denied" when trying to write files dunnd40 Debian 2 02-01-2004 10:29 AM


All times are GMT -5. The time now is 07:29 AM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration