Download your favorite Linux distribution at LQ ISO.
Go Back > Forums > Linux Forums > Linux - General
User Name
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.


  Search this Thread
Old 09-25-2002, 12:59 AM   #1
Registered: Sep 2002
Location: fdas
Posts: 100

Rep: Reputation: 15
Disable error message

When use 'ls' to list a not available file (eg. `ls testfile` ) , then it would pop up error message `testfile not found ' , how can i disable such error message (except output the error to null value ( 2 > /dev/null ) ? Thanks.
Old 09-25-2002, 01:45 AM   #2
Registered: Sep 2002
Location: somewhere
Distribution: gentoo
Posts: 123

Rep: Reputation: 15
if test -x [filename]
ls [filename]

if you are doing something else, other than just no enjoying seeing the ls: asdf: No such file or directory message display, such as piping data from tither to thither, like

ls foo | grep -e "bar"

ls foo 2>/dev/null | grep -e "bar"

will still display error messages from grep
if you are just using ls to test if a file is there, there is a better away...


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 On
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Disable the error message pop to screen ust Linux - Distributions 1 04-15-2005 07:30 AM
QMAIL error:554 Transaction failed: message format error mpk25 Linux - Software 1 10-15-2004 12:53 PM
error message when run MRTG: SNMP error zhgalaxy Linux - Newbie 0 02-18-2004 12:08 PM
Disable SSH access but show a message fr0st Linux - General 6 12-16-2003 07:50 AM
how to disable the "you have new mail" message? ry Linux - General 9 04-23-2003 06:18 AM > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 04:32 AM.

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