Sponsored Content
Top Forums Shell Programming and Scripting Paramater list too long while chmod Post 302335045 by lathavim on Friday 17th of July 2009 06:15:08 AM
Old 07-17-2009
See if this works. Make sure you are in the required directory.


Code:
 
ls filename*.txt | xargs chmod 777

 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

arg list too long

I do ls -l ABC*, I get arg list too long message. This will not happen if ABC* has small no of files I believe 4000 files is limit. Any way of avoiding this. I even tried like this for i in `ls -l ABC*` do echo $i done Same problem. Any solution would be great. I am on HP-UX... (5 Replies)
Discussion started by: vingupta
5 Replies

2. Shell Programming and Scripting

Cp All But Some Files, paramater for cp command?

I'm creating a shell script, part of which has a cp command.So far i've got: cp --recursive --reply=yes /development/myProgram/* /somewhere/else I need to add something that says to not copy certain files, in this case all directories named "CVS" and files named ".project" and... (2 Replies)
Discussion started by: allelopath
2 Replies

3. UNIX for Dummies Questions & Answers

ls -t arg list too long

echo dirname/filename* | xargs ls -t As a substitute doesn't give the results desired when I exceed the buffer size. I still want the files listed in chronological order, unfortunately xargs releases the names piecemeal...does anyone have any ideas? :( (4 Replies)
Discussion started by: CSU_Ram
4 Replies

4. Shell Programming and Scripting

parameter list too long

This is one of shell things I guess. I have a directory in a production server that contains about 20,000 files. It gets cleaned up every week and is kept in check that it does not get out of hand. Here is my problem. When I perform a ls -ltr, I get the listing. However should I parameterize... (4 Replies)
Discussion started by: jerardfjay
4 Replies

5. UNIX for Dummies Questions & Answers

-r paramater with chown and rmdir

If I am root user, and trying to chown everything in a directory and it's subdirectories (e.g. httpdocs and everything inside that directory, including it's sub directories), how would I do that? I tried it with -r but it didnt seem to work...can someone help with the correct syntax? Also, if I... (3 Replies)
Discussion started by: Eman619
3 Replies

6. UNIX and Linux Applications

What is the difference between chmod in solaris and chmod in Linux?

i think it is the same in both... Iam i right? (1 Reply)
Discussion started by: sumaiya
1 Replies

7. Shell Programming and Scripting

Argument list too long!!

Dear Experts, I have a list of 10K files in a directory. I am not able to execute any commands lile ls -lrt, awk, sed, mv, etc........ I wanna execute below command and get the output. How can I achieve it?? Pls help. root# awk -F'|' '$1 == 1' file_20120710* | wc -l /bin/awk: Argument list... (2 Replies)
Discussion started by: Naga06
2 Replies

8. Shell Programming and Scripting

Chmod list of files

Hi, I have a list of files in a text file. I want to change the mode of every one of those files, but am having difficulty in doing so. #!/bin/bash files=/home/david/files.txt for $item in $files { chmod 640 $item } .. doesn't cut it. Can anyone help? Thanks. (7 Replies)
Discussion started by: davidm123SED
7 Replies

9. UNIX for Dummies Questions & Answers

Arg list too long

Hello All, I am trying to find a file name with .sh exention from a list of .dat files inside a directory. find /app/folder1/* -name '*.dat'| xargs grep '.sh' ksh: /usr/local/bin/find: arg list too long Please help me finding the command. Thanks (3 Replies)
Discussion started by: tkhan9
3 Replies

10. Shell Programming and Scripting

Argument list too long

Hi Team, Here's the situation. I have approximately 300000 to 500000 jpg files in /appl/abcd/work_dir mv /appl/abcd/work_dir /appl/abcd/process_dir The above move command will work if the jpg files count is close to 50000 (not sure). If the count is less this mv command holds good. But if... (14 Replies)
Discussion started by: kmanivan82
14 Replies
LCHMOD(3)						   BSD Library Functions Manual 						 LCHMOD(3)

NAME
lchmod -- change mode of file SYNOPSIS
#include <sys/stat.h> #include <unistd.h> int lchmod(const char *path, mode_t flags); DESCRIPTION
The function lchmod() sets the file permission bits of the file specified by the pathname path to mode. See chmod(2) for the values of the flags. The lchmod() call is like chmod() except when the named file is a symbolic link, in which case lchmod() will change the flags of the link itself, rather than the file it points to. NOTE
Instead of being a system call, lchmod() is emulated using setattrlist(2). Not all file systems support setattrlist(2). RETURN VALUES
Upon successful completion, a value of 0 is returned. Otherwise, -1 is returned and the global variable errno is set to indicate the error. ERRORS
The lchmod() call may return the same errors as chmod(2) and setattrlist(2). SEE ALSO
chmod(2), setattrlist(2) BSD
Oct 31, 2005 BSD
All times are GMT -4. The time now is 04:46 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy