Have rm not report when a file is missing?
Clash Royale CLAN TAG#URR8PPP
up vote
14
down vote
favorite
I have a bash script that I want to remove files from various directories. Frequently, they won't be there because they weren't generated and that's fine. Is there a way to get the script not to report that error, but if rm has some other output to report that?
Alternately, is there a better command to use to remove the file that'll be less noisy?
rm
add a comment |Â
up vote
14
down vote
favorite
I have a bash script that I want to remove files from various directories. Frequently, they won't be there because they weren't generated and that's fine. Is there a way to get the script not to report that error, but if rm has some other output to report that?
Alternately, is there a better command to use to remove the file that'll be less noisy?
rm
add a comment |Â
up vote
14
down vote
favorite
up vote
14
down vote
favorite
I have a bash script that I want to remove files from various directories. Frequently, they won't be there because they weren't generated and that's fine. Is there a way to get the script not to report that error, but if rm has some other output to report that?
Alternately, is there a better command to use to remove the file that'll be less noisy?
rm
I have a bash script that I want to remove files from various directories. Frequently, they won't be there because they weren't generated and that's fine. Is there a way to get the script not to report that error, but if rm has some other output to report that?
Alternately, is there a better command to use to remove the file that'll be less noisy?
rm
rm
edited Apr 30 '16 at 13:54
Braiam
22.6k1972133
22.6k1972133
asked Apr 29 '16 at 18:40
flickerfly
3011310
3011310
add a comment |Â
add a comment |Â
8 Answers
8
active
oldest
votes
up vote
32
down vote
accepted
Use the -f
option. It will silently ignore nonexistent files.
From man rm
:
-f, --force
ignore nonexistent files and arguments, never prompt
[The "never prompt" part means that (a) -f
overrides any previously specified -i
or -I
option, and (b) write-protected files will be deleted without asking.]
Example
Without -f
, rm
will complain about missing files:
$ rm nonesuch
rm: cannot remove âÂÂnonesuchâÂÂ: No such file or directory
With -f
, it will be silent:
$ rm -f nonesuch
$
4
Oh, I new that didn't prompt for removal, didn't realize it also ignored nonexistents. I totally skipped over that when looking at man. :-) Thank you. I'll mark this as the answer soon as I'm allowed.
â flickerfly
Apr 29 '16 at 18:54
add a comment |Â
up vote
7
down vote
You stated that you still want to see other output from the rm
command when you run it, but using the -f
option will suppress those. You will need to filter STDERR for what you want, which is a little tricky, given you want everything else to show.
You will want to use a command like this:
rm -f filename 3>&1 1>&2 2>&3 3>&- | grep -v 'No such file or directory'
Command explained:
-f
argument is to force through and not prompt for confirmation or errors3>&1 1>&2 2>&3 3>&-
is to switch around STDOUT and STDERR for filtering (you can read more about this here if wanted| grep -v 'No such file or directory'
is filtering out the message you do not want to see
Now, if you just wanted to suppress error messages entirely, you could run the following command:
rm filename 2> /dev/null
This command redirects STDERR to /dev/null so you will not see it when you run the command.
1
(AFAICS)rm
without-v
never outputs to stdout, only stderr, so in this case you could just2>&1 | grep
without the dance which is useful more generally,
â dave_thompson_085
Apr 30 '16 at 11:20
add a comment |Â
up vote
7
down vote
If your requirement is that rm
does not complain about missing files, but that you also want any other output from rm
, my suggestion would be to first test for the target file's existence, and only call rm
(without the -f
flag) if the file actually exists.
# rest of script
# ...
[ -e "$file" ] && rm "$file"
# ...
# rest of script
Calling rm -f
on a file that, for example, doesn't have user-write permissions, will remove the file and also not emit the normal prompt for that scenario.
In case you wanted to use the same idea with multiple files, I would create a function definition, like:
qrm()
for f
do
[ -e "$f" ] && rm "$f"
done
Use it like: qrm file1 file2-does-not-exist *.txt etc here
1
It's worth being aware of the very slight chance of a race condition where the file is deleted (or created) between the test and the removal, but I can't imagine that being relevant in any typical situation where one would be using a shell script.
â David Z
May 1 '16 at 7:43
add a comment |Â
up vote
4
down vote
As an alternative, you can use the find
command with the -delete
option. This will (obviously) only delete the files it finds so it never warns if none are. An example might be:
find /var/log/triffids/ -name "*.log" -mtime 30 -delete
which would search the /var/log/triffids/
directory and delete all files with the .log
suffix which have not been modified for more than 30 days.
It is always a good idea to run these commands without the -delete
option first, to make sure it's finding the files you expect.
I like this option and will consider a change. Thanks for sharing it.
â flickerfly
Apr 30 '16 at 18:19
add a comment |Â
up vote
3
down vote
Check the --force
(-f
) option of rm
:
-f, --force
ignore nonexistent files and arguments, never prompt
add a comment |Â
up vote
2
down vote
This is a hack, but you could always touch
the file about to be removed. If it doesn't exist, it will be created so rm
can remove it.
I like this, except for the performance - how costly is it to touch several K's of files as opposed to only deleting the ones that don't exist?
â Dani_l
May 1 '16 at 15:12
add a comment |Â
up vote
0
down vote
You can use -f
as it will, according to the man page:
Attempt to remove the files without prompting for
confirmation, regardless of the file's permissions. If the file does
not exist, do not display a diagnostic message or modify the exit
status to reflect an error. also remember The -f option overrides any
previous -i options.
rm -f xyz-directory
will not prompt you anything, and will do exactly what you want.
add a comment |Â
up vote
-1
down vote
There are two main ways: If you add the -f option, it will not show the "doesn't exist" error and two: (works for almost any command) instead of just doing "thecommand" do "thecommand 2>/dev/null" where "thecommand" is the command you're doing.
1
I was avoiding the piping because I don't want to loose other errors that might come up. I don't know what they would be.
â flickerfly
Apr 29 '16 at 18:55
add a comment |Â
8 Answers
8
active
oldest
votes
8 Answers
8
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
32
down vote
accepted
Use the -f
option. It will silently ignore nonexistent files.
From man rm
:
-f, --force
ignore nonexistent files and arguments, never prompt
[The "never prompt" part means that (a) -f
overrides any previously specified -i
or -I
option, and (b) write-protected files will be deleted without asking.]
Example
Without -f
, rm
will complain about missing files:
$ rm nonesuch
rm: cannot remove âÂÂnonesuchâÂÂ: No such file or directory
With -f
, it will be silent:
$ rm -f nonesuch
$
4
Oh, I new that didn't prompt for removal, didn't realize it also ignored nonexistents. I totally skipped over that when looking at man. :-) Thank you. I'll mark this as the answer soon as I'm allowed.
â flickerfly
Apr 29 '16 at 18:54
add a comment |Â
up vote
32
down vote
accepted
Use the -f
option. It will silently ignore nonexistent files.
From man rm
:
-f, --force
ignore nonexistent files and arguments, never prompt
[The "never prompt" part means that (a) -f
overrides any previously specified -i
or -I
option, and (b) write-protected files will be deleted without asking.]
Example
Without -f
, rm
will complain about missing files:
$ rm nonesuch
rm: cannot remove âÂÂnonesuchâÂÂ: No such file or directory
With -f
, it will be silent:
$ rm -f nonesuch
$
4
Oh, I new that didn't prompt for removal, didn't realize it also ignored nonexistents. I totally skipped over that when looking at man. :-) Thank you. I'll mark this as the answer soon as I'm allowed.
â flickerfly
Apr 29 '16 at 18:54
add a comment |Â
up vote
32
down vote
accepted
up vote
32
down vote
accepted
Use the -f
option. It will silently ignore nonexistent files.
From man rm
:
-f, --force
ignore nonexistent files and arguments, never prompt
[The "never prompt" part means that (a) -f
overrides any previously specified -i
or -I
option, and (b) write-protected files will be deleted without asking.]
Example
Without -f
, rm
will complain about missing files:
$ rm nonesuch
rm: cannot remove âÂÂnonesuchâÂÂ: No such file or directory
With -f
, it will be silent:
$ rm -f nonesuch
$
Use the -f
option. It will silently ignore nonexistent files.
From man rm
:
-f, --force
ignore nonexistent files and arguments, never prompt
[The "never prompt" part means that (a) -f
overrides any previously specified -i
or -I
option, and (b) write-protected files will be deleted without asking.]
Example
Without -f
, rm
will complain about missing files:
$ rm nonesuch
rm: cannot remove âÂÂnonesuchâÂÂ: No such file or directory
With -f
, it will be silent:
$ rm -f nonesuch
$
edited Apr 29 '16 at 19:01
answered Apr 29 '16 at 18:44
John1024
44.7k4101117
44.7k4101117
4
Oh, I new that didn't prompt for removal, didn't realize it also ignored nonexistents. I totally skipped over that when looking at man. :-) Thank you. I'll mark this as the answer soon as I'm allowed.
â flickerfly
Apr 29 '16 at 18:54
add a comment |Â
4
Oh, I new that didn't prompt for removal, didn't realize it also ignored nonexistents. I totally skipped over that when looking at man. :-) Thank you. I'll mark this as the answer soon as I'm allowed.
â flickerfly
Apr 29 '16 at 18:54
4
4
Oh, I new that didn't prompt for removal, didn't realize it also ignored nonexistents. I totally skipped over that when looking at man. :-) Thank you. I'll mark this as the answer soon as I'm allowed.
â flickerfly
Apr 29 '16 at 18:54
Oh, I new that didn't prompt for removal, didn't realize it also ignored nonexistents. I totally skipped over that when looking at man. :-) Thank you. I'll mark this as the answer soon as I'm allowed.
â flickerfly
Apr 29 '16 at 18:54
add a comment |Â
up vote
7
down vote
You stated that you still want to see other output from the rm
command when you run it, but using the -f
option will suppress those. You will need to filter STDERR for what you want, which is a little tricky, given you want everything else to show.
You will want to use a command like this:
rm -f filename 3>&1 1>&2 2>&3 3>&- | grep -v 'No such file or directory'
Command explained:
-f
argument is to force through and not prompt for confirmation or errors3>&1 1>&2 2>&3 3>&-
is to switch around STDOUT and STDERR for filtering (you can read more about this here if wanted| grep -v 'No such file or directory'
is filtering out the message you do not want to see
Now, if you just wanted to suppress error messages entirely, you could run the following command:
rm filename 2> /dev/null
This command redirects STDERR to /dev/null so you will not see it when you run the command.
1
(AFAICS)rm
without-v
never outputs to stdout, only stderr, so in this case you could just2>&1 | grep
without the dance which is useful more generally,
â dave_thompson_085
Apr 30 '16 at 11:20
add a comment |Â
up vote
7
down vote
You stated that you still want to see other output from the rm
command when you run it, but using the -f
option will suppress those. You will need to filter STDERR for what you want, which is a little tricky, given you want everything else to show.
You will want to use a command like this:
rm -f filename 3>&1 1>&2 2>&3 3>&- | grep -v 'No such file or directory'
Command explained:
-f
argument is to force through and not prompt for confirmation or errors3>&1 1>&2 2>&3 3>&-
is to switch around STDOUT and STDERR for filtering (you can read more about this here if wanted| grep -v 'No such file or directory'
is filtering out the message you do not want to see
Now, if you just wanted to suppress error messages entirely, you could run the following command:
rm filename 2> /dev/null
This command redirects STDERR to /dev/null so you will not see it when you run the command.
1
(AFAICS)rm
without-v
never outputs to stdout, only stderr, so in this case you could just2>&1 | grep
without the dance which is useful more generally,
â dave_thompson_085
Apr 30 '16 at 11:20
add a comment |Â
up vote
7
down vote
up vote
7
down vote
You stated that you still want to see other output from the rm
command when you run it, but using the -f
option will suppress those. You will need to filter STDERR for what you want, which is a little tricky, given you want everything else to show.
You will want to use a command like this:
rm -f filename 3>&1 1>&2 2>&3 3>&- | grep -v 'No such file or directory'
Command explained:
-f
argument is to force through and not prompt for confirmation or errors3>&1 1>&2 2>&3 3>&-
is to switch around STDOUT and STDERR for filtering (you can read more about this here if wanted| grep -v 'No such file or directory'
is filtering out the message you do not want to see
Now, if you just wanted to suppress error messages entirely, you could run the following command:
rm filename 2> /dev/null
This command redirects STDERR to /dev/null so you will not see it when you run the command.
You stated that you still want to see other output from the rm
command when you run it, but using the -f
option will suppress those. You will need to filter STDERR for what you want, which is a little tricky, given you want everything else to show.
You will want to use a command like this:
rm -f filename 3>&1 1>&2 2>&3 3>&- | grep -v 'No such file or directory'
Command explained:
-f
argument is to force through and not prompt for confirmation or errors3>&1 1>&2 2>&3 3>&-
is to switch around STDOUT and STDERR for filtering (you can read more about this here if wanted| grep -v 'No such file or directory'
is filtering out the message you do not want to see
Now, if you just wanted to suppress error messages entirely, you could run the following command:
rm filename 2> /dev/null
This command redirects STDERR to /dev/null so you will not see it when you run the command.
edited Apr 30 '16 at 5:54
muru
34k578147
34k578147
answered Apr 29 '16 at 18:56
BriGuy
2,3011819
2,3011819
1
(AFAICS)rm
without-v
never outputs to stdout, only stderr, so in this case you could just2>&1 | grep
without the dance which is useful more generally,
â dave_thompson_085
Apr 30 '16 at 11:20
add a comment |Â
1
(AFAICS)rm
without-v
never outputs to stdout, only stderr, so in this case you could just2>&1 | grep
without the dance which is useful more generally,
â dave_thompson_085
Apr 30 '16 at 11:20
1
1
(AFAICS)
rm
without -v
never outputs to stdout, only stderr, so in this case you could just 2>&1 | grep
without the dance which is useful more generally,â dave_thompson_085
Apr 30 '16 at 11:20
(AFAICS)
rm
without -v
never outputs to stdout, only stderr, so in this case you could just 2>&1 | grep
without the dance which is useful more generally,â dave_thompson_085
Apr 30 '16 at 11:20
add a comment |Â
up vote
7
down vote
If your requirement is that rm
does not complain about missing files, but that you also want any other output from rm
, my suggestion would be to first test for the target file's existence, and only call rm
(without the -f
flag) if the file actually exists.
# rest of script
# ...
[ -e "$file" ] && rm "$file"
# ...
# rest of script
Calling rm -f
on a file that, for example, doesn't have user-write permissions, will remove the file and also not emit the normal prompt for that scenario.
In case you wanted to use the same idea with multiple files, I would create a function definition, like:
qrm()
for f
do
[ -e "$f" ] && rm "$f"
done
Use it like: qrm file1 file2-does-not-exist *.txt etc here
1
It's worth being aware of the very slight chance of a race condition where the file is deleted (or created) between the test and the removal, but I can't imagine that being relevant in any typical situation where one would be using a shell script.
â David Z
May 1 '16 at 7:43
add a comment |Â
up vote
7
down vote
If your requirement is that rm
does not complain about missing files, but that you also want any other output from rm
, my suggestion would be to first test for the target file's existence, and only call rm
(without the -f
flag) if the file actually exists.
# rest of script
# ...
[ -e "$file" ] && rm "$file"
# ...
# rest of script
Calling rm -f
on a file that, for example, doesn't have user-write permissions, will remove the file and also not emit the normal prompt for that scenario.
In case you wanted to use the same idea with multiple files, I would create a function definition, like:
qrm()
for f
do
[ -e "$f" ] && rm "$f"
done
Use it like: qrm file1 file2-does-not-exist *.txt etc here
1
It's worth being aware of the very slight chance of a race condition where the file is deleted (or created) between the test and the removal, but I can't imagine that being relevant in any typical situation where one would be using a shell script.
â David Z
May 1 '16 at 7:43
add a comment |Â
up vote
7
down vote
up vote
7
down vote
If your requirement is that rm
does not complain about missing files, but that you also want any other output from rm
, my suggestion would be to first test for the target file's existence, and only call rm
(without the -f
flag) if the file actually exists.
# rest of script
# ...
[ -e "$file" ] && rm "$file"
# ...
# rest of script
Calling rm -f
on a file that, for example, doesn't have user-write permissions, will remove the file and also not emit the normal prompt for that scenario.
In case you wanted to use the same idea with multiple files, I would create a function definition, like:
qrm()
for f
do
[ -e "$f" ] && rm "$f"
done
Use it like: qrm file1 file2-does-not-exist *.txt etc here
If your requirement is that rm
does not complain about missing files, but that you also want any other output from rm
, my suggestion would be to first test for the target file's existence, and only call rm
(without the -f
flag) if the file actually exists.
# rest of script
# ...
[ -e "$file" ] && rm "$file"
# ...
# rest of script
Calling rm -f
on a file that, for example, doesn't have user-write permissions, will remove the file and also not emit the normal prompt for that scenario.
In case you wanted to use the same idea with multiple files, I would create a function definition, like:
qrm()
for f
do
[ -e "$f" ] && rm "$f"
done
Use it like: qrm file1 file2-does-not-exist *.txt etc here
edited May 1 '16 at 15:04
answered Apr 30 '16 at 0:29
Jeff Schaller
33.8k851113
33.8k851113
1
It's worth being aware of the very slight chance of a race condition where the file is deleted (or created) between the test and the removal, but I can't imagine that being relevant in any typical situation where one would be using a shell script.
â David Z
May 1 '16 at 7:43
add a comment |Â
1
It's worth being aware of the very slight chance of a race condition where the file is deleted (or created) between the test and the removal, but I can't imagine that being relevant in any typical situation where one would be using a shell script.
â David Z
May 1 '16 at 7:43
1
1
It's worth being aware of the very slight chance of a race condition where the file is deleted (or created) between the test and the removal, but I can't imagine that being relevant in any typical situation where one would be using a shell script.
â David Z
May 1 '16 at 7:43
It's worth being aware of the very slight chance of a race condition where the file is deleted (or created) between the test and the removal, but I can't imagine that being relevant in any typical situation where one would be using a shell script.
â David Z
May 1 '16 at 7:43
add a comment |Â
up vote
4
down vote
As an alternative, you can use the find
command with the -delete
option. This will (obviously) only delete the files it finds so it never warns if none are. An example might be:
find /var/log/triffids/ -name "*.log" -mtime 30 -delete
which would search the /var/log/triffids/
directory and delete all files with the .log
suffix which have not been modified for more than 30 days.
It is always a good idea to run these commands without the -delete
option first, to make sure it's finding the files you expect.
I like this option and will consider a change. Thanks for sharing it.
â flickerfly
Apr 30 '16 at 18:19
add a comment |Â
up vote
4
down vote
As an alternative, you can use the find
command with the -delete
option. This will (obviously) only delete the files it finds so it never warns if none are. An example might be:
find /var/log/triffids/ -name "*.log" -mtime 30 -delete
which would search the /var/log/triffids/
directory and delete all files with the .log
suffix which have not been modified for more than 30 days.
It is always a good idea to run these commands without the -delete
option first, to make sure it's finding the files you expect.
I like this option and will consider a change. Thanks for sharing it.
â flickerfly
Apr 30 '16 at 18:19
add a comment |Â
up vote
4
down vote
up vote
4
down vote
As an alternative, you can use the find
command with the -delete
option. This will (obviously) only delete the files it finds so it never warns if none are. An example might be:
find /var/log/triffids/ -name "*.log" -mtime 30 -delete
which would search the /var/log/triffids/
directory and delete all files with the .log
suffix which have not been modified for more than 30 days.
It is always a good idea to run these commands without the -delete
option first, to make sure it's finding the files you expect.
As an alternative, you can use the find
command with the -delete
option. This will (obviously) only delete the files it finds so it never warns if none are. An example might be:
find /var/log/triffids/ -name "*.log" -mtime 30 -delete
which would search the /var/log/triffids/
directory and delete all files with the .log
suffix which have not been modified for more than 30 days.
It is always a good idea to run these commands without the -delete
option first, to make sure it's finding the files you expect.
edited Apr 30 '16 at 18:21
answered Apr 30 '16 at 18:17
seumasmac
1,343710
1,343710
I like this option and will consider a change. Thanks for sharing it.
â flickerfly
Apr 30 '16 at 18:19
add a comment |Â
I like this option and will consider a change. Thanks for sharing it.
â flickerfly
Apr 30 '16 at 18:19
I like this option and will consider a change. Thanks for sharing it.
â flickerfly
Apr 30 '16 at 18:19
I like this option and will consider a change. Thanks for sharing it.
â flickerfly
Apr 30 '16 at 18:19
add a comment |Â
up vote
3
down vote
Check the --force
(-f
) option of rm
:
-f, --force
ignore nonexistent files and arguments, never prompt
add a comment |Â
up vote
3
down vote
Check the --force
(-f
) option of rm
:
-f, --force
ignore nonexistent files and arguments, never prompt
add a comment |Â
up vote
3
down vote
up vote
3
down vote
Check the --force
(-f
) option of rm
:
-f, --force
ignore nonexistent files and arguments, never prompt
Check the --force
(-f
) option of rm
:
-f, --force
ignore nonexistent files and arguments, never prompt
answered Apr 29 '16 at 18:44
heemayl
33.6k36999
33.6k36999
add a comment |Â
add a comment |Â
up vote
2
down vote
This is a hack, but you could always touch
the file about to be removed. If it doesn't exist, it will be created so rm
can remove it.
I like this, except for the performance - how costly is it to touch several K's of files as opposed to only deleting the ones that don't exist?
â Dani_l
May 1 '16 at 15:12
add a comment |Â
up vote
2
down vote
This is a hack, but you could always touch
the file about to be removed. If it doesn't exist, it will be created so rm
can remove it.
I like this, except for the performance - how costly is it to touch several K's of files as opposed to only deleting the ones that don't exist?
â Dani_l
May 1 '16 at 15:12
add a comment |Â
up vote
2
down vote
up vote
2
down vote
This is a hack, but you could always touch
the file about to be removed. If it doesn't exist, it will be created so rm
can remove it.
This is a hack, but you could always touch
the file about to be removed. If it doesn't exist, it will be created so rm
can remove it.
answered Apr 30 '16 at 9:05
matega
1212
1212
I like this, except for the performance - how costly is it to touch several K's of files as opposed to only deleting the ones that don't exist?
â Dani_l
May 1 '16 at 15:12
add a comment |Â
I like this, except for the performance - how costly is it to touch several K's of files as opposed to only deleting the ones that don't exist?
â Dani_l
May 1 '16 at 15:12
I like this, except for the performance - how costly is it to touch several K's of files as opposed to only deleting the ones that don't exist?
â Dani_l
May 1 '16 at 15:12
I like this, except for the performance - how costly is it to touch several K's of files as opposed to only deleting the ones that don't exist?
â Dani_l
May 1 '16 at 15:12
add a comment |Â
up vote
0
down vote
You can use -f
as it will, according to the man page:
Attempt to remove the files without prompting for
confirmation, regardless of the file's permissions. If the file does
not exist, do not display a diagnostic message or modify the exit
status to reflect an error. also remember The -f option overrides any
previous -i options.
rm -f xyz-directory
will not prompt you anything, and will do exactly what you want.
add a comment |Â
up vote
0
down vote
You can use -f
as it will, according to the man page:
Attempt to remove the files without prompting for
confirmation, regardless of the file's permissions. If the file does
not exist, do not display a diagnostic message or modify the exit
status to reflect an error. also remember The -f option overrides any
previous -i options.
rm -f xyz-directory
will not prompt you anything, and will do exactly what you want.
add a comment |Â
up vote
0
down vote
up vote
0
down vote
You can use -f
as it will, according to the man page:
Attempt to remove the files without prompting for
confirmation, regardless of the file's permissions. If the file does
not exist, do not display a diagnostic message or modify the exit
status to reflect an error. also remember The -f option overrides any
previous -i options.
rm -f xyz-directory
will not prompt you anything, and will do exactly what you want.
You can use -f
as it will, according to the man page:
Attempt to remove the files without prompting for
confirmation, regardless of the file's permissions. If the file does
not exist, do not display a diagnostic message or modify the exit
status to reflect an error. also remember The -f option overrides any
previous -i options.
rm -f xyz-directory
will not prompt you anything, and will do exactly what you want.
edited Apr 30 '16 at 19:54
garethTheRed
23.3k35978
23.3k35978
answered Apr 30 '16 at 19:09
Ankit Jain
13
13
add a comment |Â
add a comment |Â
up vote
-1
down vote
There are two main ways: If you add the -f option, it will not show the "doesn't exist" error and two: (works for almost any command) instead of just doing "thecommand" do "thecommand 2>/dev/null" where "thecommand" is the command you're doing.
1
I was avoiding the piping because I don't want to loose other errors that might come up. I don't know what they would be.
â flickerfly
Apr 29 '16 at 18:55
add a comment |Â
up vote
-1
down vote
There are two main ways: If you add the -f option, it will not show the "doesn't exist" error and two: (works for almost any command) instead of just doing "thecommand" do "thecommand 2>/dev/null" where "thecommand" is the command you're doing.
1
I was avoiding the piping because I don't want to loose other errors that might come up. I don't know what they would be.
â flickerfly
Apr 29 '16 at 18:55
add a comment |Â
up vote
-1
down vote
up vote
-1
down vote
There are two main ways: If you add the -f option, it will not show the "doesn't exist" error and two: (works for almost any command) instead of just doing "thecommand" do "thecommand 2>/dev/null" where "thecommand" is the command you're doing.
There are two main ways: If you add the -f option, it will not show the "doesn't exist" error and two: (works for almost any command) instead of just doing "thecommand" do "thecommand 2>/dev/null" where "thecommand" is the command you're doing.
edited May 1 '16 at 22:29
community wiki
3 revs
John
1
I was avoiding the piping because I don't want to loose other errors that might come up. I don't know what they would be.
â flickerfly
Apr 29 '16 at 18:55
add a comment |Â
1
I was avoiding the piping because I don't want to loose other errors that might come up. I don't know what they would be.
â flickerfly
Apr 29 '16 at 18:55
1
1
I was avoiding the piping because I don't want to loose other errors that might come up. I don't know what they would be.
â flickerfly
Apr 29 '16 at 18:55
I was avoiding the piping because I don't want to loose other errors that might come up. I don't know what they would be.
â flickerfly
Apr 29 '16 at 18:55
add a comment |Â
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f280067%2fhave-rm-not-report-when-a-file-is-missing%23new-answer', 'question_page');
);
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password