I can't find an immediate and obvious reason for that behaviour. Please remove the 2>/dev/null so we might get a hint on a possible problem. man xargs:
Quote:
If any invocation of the command exits with a status of 255, xargs will stop immediately without reading any further input. An error message is issued on stderr when this happens.
---------- Post updated at 19:08 ---------- Previous update was at 19:06 ----------
drwxr-x--- 2 root system 96 Jun 28 2012 nfs_aing_tmp might give a problem as it won't be accessible to UG92222:tava.
¡Hola José Luis! Si me lo permites me gustaría señalarte algunos detalles.
ls -1 is never of good use in a for loop, the same can be achieved by shell expansion as
The if checks that the variable $dir has an existing directory. ls -1 will send a list of files as well, which it will not do if passed to the find command. Variables should be "quoted" when passed to another commands. Inside a if [[ ]] is not necessary because of the double [[ ]] but I chose to do so, since it doesn't harm. Inside a single if [ ] you should do quote.
The find command can do recursively by itself what you are trying to do in the for loop.
There's a highlighted red dot.
Espero que te ayude.
Last edited by Aia; 01-27-2016 at 12:28 AM..
Reason: red dot
Hello,
I have a main directory called /test123
/test123 has lot of sub-directories and files.
drwxr-x--- 21 root system 4096 Jan 25 10:20 /test123
Here, "other" does not have any access to /test123 folder.
How can we provide read-only access to others on /test123... (1 Reply)
My git post-update has the following lines in it to make sure the permissions are set right:
find /usr/local/apache/htdocs -type d -print0 | xargs -0 chmod 755
find /usr/local/apache/htdocs -type f -print0 | xargs -0 chmod 644
chown -R apache:apache /usr/local/apache/htdocsThe only problem is... (5 Replies)
Hello All,
I am in the process of finding the permissions on all the files that exists in two directories:
Dir1: PROD_Scripts/*
Dir2: STAGE_Scripts/*
Both the Directories have some shell and perl scripts respectively.
Step1: Finding all the Scripts that exists in PROD but Not in STAGE.... (2 Replies)
Hi all,
Using grep command, i want to find the pattern of text in all directories and sub-directories.
e.g: if i want to search for a pattern named "parmeter", i used the command
grep -i "param" ../*
is this correct? (1 Reply)
Hi all,
I need to create duplicate directories and sub directories (only the directories not the files or file contents) with the same permissions. Can some one guide me in doing this. I could able to create but here the permissions should be the same how can i do this in linux.
Thanks in... (5 Replies)
Hi,
I'm looking to combine the two commands find and sed together for the work that i'm worknig on.
I need to find the ip addresse in any file from current directory and below, once is found i need to replace it with new ip addresse. Here is what i have but not complete.
Find IP from... (4 Replies)
Hi,
I am really new to unix, any help is much appreciated.
I need to change permissions of all files under several subdirectories to 700 but keep directories readable (755). Why ? Because I need a FTP user to only list his files and can't read them. But to browse to subfolder, the directories... (3 Replies)
Basicly im trying to edit a file for apache2 in /var/etc/apache2 and i dont have permissions, my login name is associated with root but i still can't do anything, Does anyone have any ideas?
Thanks in advance! (3 Replies)
Hi All
I need to create a script which would change Permissions to 775
All the Files and directories will be mentioned in the Paramter files
Can anyone give a Hint how to proceed in this ??
THanks (1 Reply)
Is it possible to have a directory owned (by root) with permissions drwx------
and then have a sub directory of rwxrwxrwx.
I know that this may be soo simple but I had no luck googling it.
Thanks for your help (1 Reply)