Sponsored Content
Top Forums UNIX for Beginners Questions & Answers How to ignore No such file or directory on the output? Post 303046292 by MadeInGermany on Thursday 30th of April 2020 01:35:20 AM
Old 04-30-2020
That globally suppresses all error messages.
You can suppress them for specific commands only, for example
Code:
df -kP 2> /dev/null

Suppress the expected.
If unexpected things happen then error messages are helpful, otherwise you might get wrong output silently.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Need help with a sh script to spool directory and modify the output (Oracle cnt file)

Hi, I'm creating a shell script to dynamically create a recreate controlfile for an Oracle database. I need to read a cold backup file system, and make some changes to these files. Let's say for argument sake the directory name is /ebsprod_c/oradata and it looks like this:... (6 Replies)
Discussion started by: exm
6 Replies

2. UNIX for Dummies Questions & Answers

Noob questions.. Append output to a file in different directory

Noob question! I know almost nothing so far, and I'm trying to teach myself from books, on a typical command line without using scripts how would I append output from a sort to a file in a completely different directory? example: If I'm sorting a file in my documents directory but I... (2 Replies)
Discussion started by: Byrang
2 Replies

3. Shell Programming and Scripting

Find: ignore directory completely

Hello, I know find can be prevented from recursing into directories with something like the following... find . -name .svn -prune -a type d But how can I completely prevent directories of a certain name (.svn) from being displayed at all, the top level and the children? I really... (2 Replies)
Discussion started by: nwb123
2 Replies

4. Shell Programming and Scripting

Need some Help for file filteration and saving the output in other directory using grep....plz ...

Hi all........ Plss do help me.......in a big trouble... :wall::wall::wall: I have 3 directories named as :1. /home/shuchi/source 2./home/shuchi/destination 3./home/shuchi/filter now the problem is /home/shuchi/source has say 2 files with extension .txt as given below : A.txt Code: ... (0 Replies)
Discussion started by: ektubbe
0 Replies

5. Shell Programming and Scripting

Need some Help for file filteration and saving the output in other directory

Hi all........ Plss do help me.......in a big trouble... :wall::wall::wall: I have 3 directories named as :1. /home/shuchi/source 2./home/shuchi/destination 3./home/shuchi/filter now the problem is /home/shuchi/source has say 2 files with extension .txt as given below : A.txt msisdn ... (5 Replies)
Discussion started by: ektubbe
5 Replies

6. Shell Programming and Scripting

Find command with ignore directory

Dear All, I am using find command find /my_rep/*/RKYPROOF/*/*/WDM/HOME_INT/PWD_DATA -name rk*myguidelines*.pdf -print The problem i am facing here is find /my_rep/*/ the directory after my_rep could be mice001, mice002 and mice001_PO, mice002_PO i want to ignore mice***_PO directory... (3 Replies)
Discussion started by: yadavricky
3 Replies

7. Shell Programming and Scripting

Ignore garbage output file

Hi All, below is my shell script #!/bin/sh set -x echo "test for multiple values" UIDPSWD=`cat /projects/feeds/twest/uidpswd` echo "oracle connection test" full=/projects/feeds/twest/test_file values=`cut -d'|' -f1 $full|sed -e "s/.*/'&'/" -e 's/$/,/g' -e '$s/,$//'` sqlplus $UIDPSWD... (2 Replies)
Discussion started by: krupasindhu18
2 Replies

8. Shell Programming and Scripting

Wget - how to ignore files in immediate directory?

i am trying to recursively save a remote FTP server but exclude the files immediately under a directory directory1 wget -r -N ftp://user:pass@hostname/directory1 I want to keep these which may have more files under them directory1/dir1/file.jpg directory1/dir2/file.jpg... (16 Replies)
Discussion started by: vanessafan99
16 Replies

9. Shell Programming and Scripting

Applying the same awk over a directory of files with individual file output

I am trying to apply an awk action over multiple files in a directory. It is a simple action, I want to print out the 1st 2 columns (i.e. $1 and $2) in each tab-separated document and output the result in a new file *.pp This is the awk that I have come up with so far, which is not giving me a... (6 Replies)
Discussion started by: owwow14
6 Replies

10. UNIX for Advanced & Expert Users

AIX find ignore directory

I am using aix. I would like to ignore the /u directory. I tried this but it is not working. find / -type f -type d \( -path /u \) -prune -o -name '*rpm*' 2>/dev/null /u/appx/ls.rpm /u/arch/vim.rpm (4 Replies)
Discussion started by: cokedude
4 Replies
rmdir(1)						      General Commands Manual							  rmdir(1)

NAME
rmdir - remove directories SYNOPSIS
dir ... DESCRIPTION
removes the directory entry for each dir operand that refers to an empty directory. Directories are removed in the order specified. Consequently, if a directory and a subdirectory of that directory are both specified as arguments, the subdirectory must be specified before the parent directory so that the parent directory will be empty when tries to remove it. Removal of a directory requires write and search (execute) permission in its parent directory, but no permissions on the directory itself; but if the sticky bit is set on the parent directory, only the owner of the directory, the owner of the parent directory, or a user having appropriate privileges can remove the directory. Options recognizes the following options: Force each directory to be removed without prompting for confirmation, regardless of the presence of the option. This option also suppresses diagnostic messages regarding non-exis- tent operands. This option does not suppress any diagnostic messages other than those regarding non-existent operands. To suppress all error message and interactive prompts, the option should be used while redirecting the standard error output to This option ignores any previous occurrence of the option. Write a prompt to the standard error output requesting confirmation before removing each directory. This option ignores any previous occurrence of the option. Path removal. If, after removing a directory with more than one pathname component, the parent directory of that directory is now empty, removes the empty parent directory. This continues until encounters a non-empty parent directory, or until all components of the original pathname have been removed. When used in conjunction with the option, asks whether to remove each directory component of a path. EXTERNAL INFLUENCES
Environment Variables provides a default value for the internationalization variables that are unset or null. If is unset or null, the default value of "C" (see lang(5)) is used. If any of the internationalization variables contains an invalid setting, will behave as if all internationalization variables are set to "C". See environ(5). If set to a non-empty string value, overrides the values of all the other internationalization variables. determines the interpretation of dir names as single and/or multi-byte characters, the classification of characters as printable, and the characters matched by character class expressions in regular expressions. determines the locale that should be used to affect the format and contents of diagnostic messages written to standard error and informa- tive messages written to standard output. determines the location of message catalogues for the processing of International Code Set Support Single- and multi-byte character code sets are supported. DIAGNOSTICS
Generally self-explanatory. Note that the option does not suppress all diagnostic messages. EXAMPLES
To remove directories with a prompt for verification: directories To remove as much as possible of a path, type: SEE ALSO
rm(1), rmdir(2), stat(2). STANDARDS CONFORMANCE
rmdir: SVID2, XPG2, XPG3, XPG4 rmdir(1)
All times are GMT -4. The time now is 03:37 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy