05-23-2002
Below is an example of what's happening. The first 2 commands display the umask output and directory permissions. Afterwards is an example of what's happening. There is only one file in the "project 3" directory, called "bko.fnl". I copy the this file to a new file called "bko.dos". The file is created but is "hidden" when using the "ls" command, and the contents can be viewed with the "more" command. It can also be removed. But when the new file has the name "testfile" it's not "hidden" and can be seen using "ls". I should also note that I can see the "bko.dos" file when I'm using the desktop file manager.
user55@gamera> umask
0022
user55@gamera> ls -la
total 14
total 14
drwxr-xr-x 7 user55 staff 512 May 22 17:05 .
drwxr-xr-x 5 user55 staff 048 May 23 14:38 ..
drwxr-xr-x 2 user55 staff 1024 May 23 14:38 project3
drwxr-xr-x 2 user55 staff 3072 May 23 12:09 project4
user55@gamera> cd project3
user55@gamera> ls -la
total 4
total 4
drwxr-xr-x 2 user55 staff 512 May 23 14:42 .
drwxr-xr-x 7 user55 staff 512 May 22 17:05 ..
-rw-r--r-- 1 user55 staff 32 May 23 14:42 bko.fnl
user55@gamera> more bko.fnl
Test file, contents of bko.fnl.
user55@gamera> cp bko.fnl bko.dos
user55@gamera> ls -la
total 4
total 4
drwxr-xr-x 2 user55 staff 512 May 23 14:42 .
drwxr-xr-x 7 user55 staff 512 May 22 17:05 ..
-rw-r--r-- 1 user55 staff 32 May 23 14:42 bko.fnl
user55@gamera> more bko.dos
Test file, contents of bko.fnl.
user55@gamera> rm bko.dos
user55@gamera> cp bko.fnl testfilename
user55@gamera> ls -la
total 4
total 4
drwxr-xr-x 2 user55 staff 512 May 23 14:51 .
drwxr-xr-x 7 user55 staff 512 May 22 17:05 ..
-rw-r--r-- 1 user55 staff 32 May 23 14:42 bko.fnl
-rw-r--r-- 1 user55 staff 32 May 23 14:51 testfilename
user55@gamera> more testfilename
Test file, contents of bko.fnl.
user55@gamera>
10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
Haveing an issue. Anytime a file is created with "01" (zero one) in the name - it cannot be viewed by LS or any other file listing command. Although the file is there, it cannot be seen. I can edit it, run it, anything, except see it.....
What happened? Any ideas? (8 Replies)
Discussion started by: n9ninchd
8 Replies
2. Shell Programming and Scripting
Hi,
Consider a flat file abc.conf contains some rows. Each row contains the directory name with full path. now I want to find a particular file in every directory which are mentioned in the abc.conf file. How it can be done through unix shell script. (2 Replies)
Discussion started by: surjyap
2 Replies
3. UNIX for Dummies Questions & Answers
Hi,
If I have a directory full of say 100 random files, and I would like to organize them, for example: FILE001, FILE002, FILE003, FILE004, etc.
How would I do this from Terminal, instead of manually changing each file? I'm using Mac OS X, if that makes a difference.
Thank you in advance... (8 Replies)
Discussion started by: andou
8 Replies
4. UNIX for Dummies Questions & Answers
Hi ,
I have a list of files in the directory I want to sort based on the file name.
But in the middle of filename contains the number based on that I need to sort.Could you suggest me on the same?
Example filenames:
/user1$ls
RS.DEV.ISV.F1.RS.REFDATA.DATA... (1 Reply)
Discussion started by: praveen.thumati
1 Replies
5. Shell Programming and Scripting
Sun Solaris Unix Question
Haven't been able to find any solution for this situation. Let's just say the file names listed below exist in a directory. I want the find command to find all files in this directory but at the same time I want to eliminate certain file names or files with certain... (2 Replies)
Discussion started by: 2reperry
2 Replies
6. UNIX for Advanced & Expert Users
I want to backup all the directory tress, including hidden directories, without copying any files.
find . -type d gives the perfect list.
When I tried tar, it won't work for me because it tars all the files.
find . -type d | xargs tar -cvf a.tar
So i tried rsync.
On my own test box, the... (4 Replies)
Discussion started by: fld2007
4 Replies
7. Shell Programming and Scripting
got it figured out :) (1 Reply)
Discussion started by: sHockz
1 Replies
8. UNIX for Dummies Questions & Answers
Hi All,
Can any one help me to list out the directory names which contain the specified file.
See for example
File name : file.201307014.LKT
Have the directory structure as below.
/app/work/data/INDIA/file.201307014.LKT
/app/work/data/AMERICA/file.201307014.KTP... (5 Replies)
Discussion started by: Balasankar
5 Replies
9. Shell Programming and Scripting
Dears,
Would you please help on following bash script:
I want to get the most recent file named alfaYYYYMMDD.gz in one directory:
for example:
in directory /tmp/
ls -ltr
alfa20130715.gz
holding.gz
alfa20130705.gz
sart.txt
merge.txt.gz
alfa20130802.gz
my result shoud be... (1 Reply)
Discussion started by: maxsub
1 Replies
10. UNIX for Beginners Questions & Answers
Hi, I have about 60 files in a directory and need to rename those files. For example the file names are
i_can_phone_yymmdd.txt (where yymmdd is the date. i.e 170420 etc)
i_usa_phone_1_yymmdd.txt
i_eng_phone_4_yymmdd.txt
The new file names should be
phone.txt
phone_1.txt
phone_4.txt
I am... (4 Replies)
Discussion started by: naveed
4 Replies
CHGRP(1) User Commands CHGRP(1)
NAME
chgrp - change group ownership
SYNOPSIS
chgrp [OPTION]... GROUP FILE...
chgrp [OPTION]... --reference=RFILE FILE...
DESCRIPTION
Change the group of each FILE to GROUP. With --reference, change the group of each FILE to that of RFILE.
-c, --changes
like verbose but report only when a change is made
-f, --silent, --quiet
suppress most error messages
-v, --verbose
output a diagnostic for every file processed
--dereference
affect the referent of each symbolic link (this is the default), rather than the symbolic link itself
-h, --no-dereference
affect symbolic links instead of any referenced file (useful only on systems that can change the ownership of a symlink)
--no-preserve-root
do not treat '/' specially (the default)
--preserve-root
fail to operate recursively on '/'
--reference=RFILE
use RFILE's group rather than specifying a GROUP value
-R, --recursive
operate on files and directories recursively
The following options modify how a hierarchy is traversed when the -R option is also specified. If more than one is specified, only the
final one takes effect.
-H if a command line argument is a symbolic link to a directory, traverse it
-L traverse every symbolic link to a directory encountered
-P do not traverse any symbolic links (default)
--help display this help and exit
--version
output version information and exit
EXAMPLES
chgrp staff /u
Change the group of /u to "staff".
chgrp -hR staff /u
Change the group of /u and subfiles to "staff".
AUTHOR
Written by David MacKenzie and Jim Meyering.
REPORTING BUGS
GNU coreutils online help: <http://www.gnu.org/software/coreutils/>
Report chgrp translation bugs to <http://translationproject.org/team/>
COPYRIGHT
Copyright (C) 2017 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>.
This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law.
SEE ALSO
chown(1), chown(2)
Full documentation at: <http://www.gnu.org/software/coreutils/chgrp>
or available locally via: info '(coreutils) chgrp invocation'
GNU coreutils 8.28 January 2018 CHGRP(1)