Sponsored Content
Top Forums UNIX for Dummies Questions & Answers suppressing an error message using the "ls" command Post 67989 by basher400 on Wednesday 30th of March 2005 02:30:07 AM
Old 03-30-2005
suppressing an error message using the "ls" command

hi

I'm new here so my question maybe be retarded or out of place:

Is there a way to suppress the "No such file or directory" error message when using the "ls" command ?

thanks
 

8 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

"syntax error at line 21 :'done' unexpected." error message"

I am trying to run the script bellow but its given me "syntax error at line 20 :'done' unexpected." error message" can someone check to see if the script is ok? and correct me pls. Today is my first day with scripting. Gurus should pls help out #!/bin/ksh # Purpose: Check to see if file... (3 Replies)
Discussion started by: ibroxy
3 Replies

2. Forum Support Area for Unregistered Users & Account Problems

Cannot register due to "spam" error message

Hi all, I am trying to register but it seems my IP address is being seen or black listed as a spam address. I get the following message: "Registration denied. Sorry, The UNIX and Linux Forums runs an active policy of not allowing spammers. Please contact us via by posting in this forum if... (0 Replies)
Discussion started by: codenjanod
0 Replies

3. Shell Programming and Scripting

Suppressing the automatic output of "script"

Is there a way to suppress the output that script command displays - "Script command started..." (4 Replies)
Discussion started by: ggayathri
4 Replies

4. UNIX for Dummies Questions & Answers

ls command gives "Not a directory" error message

The operating system is Solaris. There is a perl interpreter that is located at /opt/perl5.10.0/perl. when i give ls -ltr /opt/perl5.10.0/perl I get an error message saying that "/opt/perl5.10.0/perl Not a directory" At the next instant when i give the same command it lists the properties of... (5 Replies)
Discussion started by: sreeharshasn
5 Replies

5. Shell Programming and Scripting

awk command to replace ";" with "|" and ""|" at diferent places in line of file

Hi, I have line in input file as below: 3G_CENTRAL;INDONESIA_(M)_TELKOMSEL;SPECIAL_WORLD_GRP_7_FA_2_TELKOMSEL My expected output for line in the file must be : "1-Radon1-cMOC_deg"|"LDIndex"|"3G_CENTRAL|INDONESIA_(M)_TELKOMSEL"|LAST|"SPECIAL_WORLD_GRP_7_FA_2_TELKOMSEL" Can someone... (7 Replies)
Discussion started by: shis100
7 Replies

6. UNIX for Dummies Questions & Answers

Unix "look" Command "File too large" Error Message

I am trying to find lines in a text file larger than 3 Gb that start with a given string. My command looks like this: $ look "string" "/home/patrick/filename.txt" However, this gives me the following message: "look: /home/patrick/filename.txt: File too large" So, I have two... (14 Replies)
Discussion started by: shishong
14 Replies

7. UNIX for Dummies Questions & Answers

Using "mailx" command to read "to" and "cc" email addreses from input file

How to use "mailx" command to do e-mail reading the input file containing email address, where column 1 has name and column 2 containing “To” e-mail address and column 3 contains “cc” e-mail address to include with same email. Sample input file, email.txt Below is an sample code where... (2 Replies)
Discussion started by: asjaiswal
2 Replies

8. Red Hat

Postfix keeps returning "Command time limit exceeded" message

We are having issues with our Postfix. The POP and IMAP services randomly stops working an sent e-mails return a "Command time limit exceeded". We've found out that running these command fix the problem: service cyrus-imapd stop rm /var/lib/imap/tls_sessions.db* rm... (2 Replies)
Discussion started by: GustavoAlvarado
2 Replies
rm(1)								   User Commands							     rm(1)

NAME
rm, rmdir - remove directory entries SYNOPSIS
/usr/bin/rm [-f] [-i] file... /usr/bin/rm -rR [-f] [-i] dirname... [file]... /usr/xpg4/bin/rm [-fiRr] file... /usr/bin/rmdir [-ps] dirname... ksh93 /usr/bin/rmdir [-eps] dirname... DESCRIPTION
/usr/bin/rm /usr/xpg4/bin/rm The rm utility removes the directory entry specified by each file argument. If a file has no write permission and the standard input is a terminal, the full set of permissions (in octal) for the file are printed followed by a question mark. This is a prompt for confirmation. If the answer is affirmative, the file is deleted, otherwise the file remains. If file is a symbolic link, the link is removed, but the file or directory to which it refers is not deleted. Users do not need write per- mission to remove a symbolic link, provided they have write permissions in the directory. If multiple files are specified and removal of a file fails for any reason, rm writes a diagnostic message to standard error, do nothing more to the current file, and go on to any remaining files. If the standard input is not a terminal, the utility operates as if the -f option is in effect. /usr/bin/rmdir The rmdir utility removes the directory entry specified by each dirname operand, which must refer to an empty directory. Directories are processed in the order specified. If a directory and a subdirectory of that directory are specified in a single invocation of rmdir, the subdirectory must be specified before the parent directory so that the parent directory is empty when rmdir tries to remove it. ksh93 The rmdir built-in in ksh93 is associated with the /bin and /usr/bin paths. It is invoked when rmdir is executed without a pathname prefix and the pathname search finds a /bin/rmdir or /usr/bin/rmdir executable. rmdir deletes each given directory. The directory must be empty and contain no entries other than . or ... If a directory and a subdirec- tory of that directory are specified as operands, the subdirectory must be specified before the parent, so that the parent directory is empty when rmdir attempts to remove it. OPTIONS
The following options are supported for /usr/bin/rm and /usr/xpg4/bin/rm: -r Recursively removes directories and subdirectories in the argument list. The directory is emptied of files and removed. The user is normally prompted for removal of any write-protected files which the directory contains. The write-protected files are removed with- out prompting, however, if the -f option is used, or if the standard input is not a terminal and the -i option is not used. Symbolic links that are encountered with this option is not traversed. If the removal of a non-empty, write-protected directory is attempted, the utility always fails (even if the -f option is used), resulting in an error message. -R Same as -r option. /usr/bin/rm The following options are supported for /usr/bin/rm only: -f Removes all files (whether write-protected or not) in a directory without prompting the user. In a write-protected directory, how- ever, files are never removed (whatever their permissions are), but no messages are displayed. If the removal of a write-protected directory is attempted, this option does not suppress an error message. -i Interactive. With this option, rm prompts for confirmation before removing any files. It overrides the -f option and remains in effect even if the standard input is not a terminal. /usr/xpg4/bin/rm The following options are supported for /usr/xpg4/bin/rm only: -f Does not prompt for confirmation. Does not write diagnostic messages or modify the exit status in the case of non-existent operands. Any previous occurrences of the -i option is ignored. -i Prompts for confirmation. Any occurrences of the -f option is ignored. /usr/bin/rmdir The following options are supported for /usr/bin/rmdir only: -p Allows users to remove the directory dirname and its parent directories which become empty. A message is printed to standard error if all or part of the path could not be removed. -s Suppresses the message printed on the standard error when -p is in effect. ksh93 The following options are supported for the rmdir built-in for ksh93: -e Ignore each non-empty directory failure. --ignore-fail-on-non-empty -p Remove each explicit directory argument directory that becomes empty after its child directories are removed. --parents -s Suppress the message printed on the standard error when -p is in effect. --suppress OPERANDS
The following operands are supported: file Specifies the pathname of a directory entry to be removed. dirname Specifies the pathname of an empty directory to be removed. USAGE
See largefile(5) for the description of the behavior of rm and rmdir when encountering files greater than or equal to 2 Gbyte ( 2^31 bytes). EXAMPLES
The following examples are valid for the commands shown. /usr/bin/rm, /usr/xpg4/bin/rm Example 1 Removing Directories The following command removes the directory entries a.out and core: example% rm a.out core Example 2 Removing a Directory without Prompting The following command removes the directory junk and all its contents, without prompting: example% rm -rf junk /usr/bin/rmdir Example 3 Removing Empty Directories If a directory a in the current directory is empty, except that it contains a directory b, and a/b is empty except that it contains a directory c, the following command removes all three directories: example% rmdir -p a/b/c ENVIRONMENT VARIABLES
See environ(5) for descriptions of the following environment variables that affect the execution of rm and rmdir: LANG, LC_ALL, LC_COLLATE, LC_CTYPE, LC_MESSAGES, and NLSPATH. Affirmative responses are processed using the extended regular expression defined for the yesexpr keyword in the LC_MESSAGES category of the user's locale. The locale specified in the LC_COLLATE category defines the behavior of ranges, equivalence classes, and multi-character collating elements used in the expression defined for yesexpr. The locale specified in LC_CTYPE determines the locale for interpretation of sequences of bytes of text data a characters, the behavior of character classes used in the expression defined for the yesexpr. See locale(5). EXIT STATUS
The following exit values are returned: 0 If the -f option was not specified, all the named directory entries were removed; otherwise, all the existing named directory entries were removed. >0 An error occurred. ksh93 The following exit values are returned: 0 Successful completion. All directories deleted successfully. >0 An error occurred. One or more directories could not be deleted. ATTRIBUTES
See attributes(5) for descriptions of the following attributes: /usr/bin/rm, /usr/bin/rmdir +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +-----------------------------+-----------------------------+ |Availability |SUNWcsu | +-----------------------------+-----------------------------+ |CSI |Enabled | +-----------------------------+-----------------------------+ /usr/xpg4/bin/rm +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +-----------------------------+-----------------------------+ |Availability |SUNWxcu4 | +-----------------------------+-----------------------------+ |CSI |Enabled | +-----------------------------+-----------------------------+ |Interface Stability |Committed | +-----------------------------+-----------------------------+ |Standard |See standards(5). | +-----------------------------+-----------------------------+ ksh93 +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +-----------------------------+-----------------------------+ |Availability |SUNWcsu | +-----------------------------+-----------------------------+ |Interface Stability |See below. | +-----------------------------+-----------------------------+ The ksh93 built-in binding to /bin and /usr/bin is Volatile. The built-in interfaces are Uncommitted. SEE ALSO
ksh93(1), rmdir(2), rmdir(2), unlink(2), attributes(5), environ(5), largefile(5), standards(5) DIAGNOSTICS
All messages are generally self-explanatory. It is forbidden to remove the files "." and ".." in order to avoid the consequences of inadvertently doing something like the following: example% rm -r .* It is forbidden to remove the file "/" in order to avoid the consequences of inadvertently doing something like: example% rm -rf $x/$y or example% rm -rf /$y when $x and $y expand to empty strings. NOTES
A - permits the user to mark explicitly the end of any command line options, allowing rm to recognize file arguments that begin with a -. As an aid to BSD migration, rm accepts -- as a synonym for -. This migration aid may disappear in a future release. If a -- and a - both appear on the same command line, the second is interpreted as a file. SunOS 5.11 20 Nov 2007 rm(1)
All times are GMT -4. The time now is 03:35 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy