Sponsored Content
Top Forums UNIX for Dummies Questions & Answers Question about UNIX file rights Post 302799857 by mike_bn on Sunday 28th of April 2013 05:05:49 AM
Old 04-28-2013
Question about UNIX file rights

Hello experts,

i am a Unix beginner and to test the rules of file rights (rwx)
i created the file

/root/testdir/subdir/test.sh

and set the rights of testdir,subdir, test.sh (using chmod) to various configurations in order to get an idea
in which case you need which rights. Test commands were

- ls ('Can i read the directory in certain change-mod configurations?')
- less test.sh ('What are the requirements in terms of rights to be able to read a file?')
- test.sh ('When can i execute a file?')

My question is, when testing unix access rights, is there a difference
between referencing test.sh by

./tests. and /root/testdir/subdir/test.sh?

I know that for the first command, i need to be in the directory, but in terms of
access rights, are these to ways of referencing the file test.sh totally equivalent? In other words, does
'less ./test.sh' always work when 'less /root/testdir/subdir/test.sh' and vice versa?
Or is there a configuration for the rights of testdir and/or subdir where one works, and the other not? Same question with executing.

Thands in advance for your help!
Mike
mike_bn
 

8 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

File Oput question in Unix?

Just curious in Unix BSD lpr customer would result in the printing of the file customers to a printer but I also came across this command pr| customer| lpr which suppose to prepare the file by formatting before printing. My question is what type of formatting is done to the file for example what... (1 Reply)
Discussion started by: wmosley2
1 Replies

2. SuSE

UNIX - Linux NFS Rights need Help

Hello, I am running a Suse Linux server and I want to set up a NFS Server for a few Unix machines. For the root account at the unix client it works fine but it doesn't work for other users who have no root rights. I've used the no_root_squash and the rw option in the etc/export file. My folder... (7 Replies)
Discussion started by: Ald-Edv
7 Replies

3. UNIX for Dummies Questions & Answers

Unix access rights

Hi, Is it true that if I am not the root I can not select access permissions to a file that I own so that my friend (who also isn't the root) can access that file? And is it true that the only way to accomplish it is to ask the root to "put" my friend into "my" group? Then I could simply set... (1 Reply)
Discussion started by: rudo
1 Replies

4. UNIX for Dummies Questions & Answers

file access rights?

Hi, I want to execute a customised process like rating engine using a shell script from a directory other than the directory where the customizes process is placed. I have tried it in the following way...and faced a issue when shell script is available in directory /dir1/ and customized... (1 Reply)
Discussion started by: vkishore.btw
1 Replies

5. UNIX for Dummies Questions & Answers

question about unix file system

Hi, The file system unix use a multilevel indexes access to disk, 12 direct blocks, 1 single indirect block, 1 double indirect block, 1 triple indirect block: Assuming a: block = 512 bytes, pointer = 4 byte, and there is a file of 200 blocks, how many disk access is needed to read the block... (1 Reply)
Discussion started by: blob84
1 Replies

6. Solaris

New user question regarding admin rights

I'm trying to install OpenOffice on Solaris 11 but when I click on the setup icon I get an error message telling me that I need to have admin rights. I've tried logging on as SU or ROOT but cannot. I don't see how to grant myself admin rights. How is it done ? I know there are many many... (7 Replies)
Discussion started by: stansaraczewski
7 Replies

7. Shell Programming and Scripting

Management application user rights on the files in a Unix / Linux

good evening .. I have a plea, who I can help me with a management application user rights on the files in a Unix / Linux I need for college .. .. and not told us no clue .. thank you (1 Reply)
Discussion started by: alex90
1 Replies

8. Shell Programming and Scripting

Convert UNIX rights in a number in a sh script

Hello, i'm trying to write a script sh to convert the rights of a folder or file in a number. Explain: ls -l = rwxrwxrwx so i must display 777. Do you known where i can find so convert script Thanks Use code tags, thanks. (11 Replies)
Discussion started by: steiner
11 Replies
nistest(1)                                                         User Commands                                                        nistest(1)

NAME
nistest - return the state of the NIS+ namespace using a conditional expression SYNOPSIS
nistest [-ALMP] [-a rights | -t type] object nistest [-ALMP] [-a rights] indexedname nistest -c dir1 op dir2 DESCRIPTION
nistest provides a way for shell scripts and other programs to test for the existence, type, and access rights of objects and entries. Entries are named using indexed names. See nismatch(1). With the -c option, directory names can be compared to test where they lie in rela- tion to each other in the namespace. OPTIONS
The following options are supported: -a rights This option is used to verify that the current process has the desired or required access rights on the named object or entries. The access rights are specified in the same way as the nischmod(1) command. -A All data. This option specifies that the data within the table and all of the data in tables in the initial table's con- catenation path be returned. This option is only valid when using indexed names or following links. -L Follow links. If the object named by object or the tablename component of indexedname names a LINK type object, the link is followed when this switch is present. -M Master server only. This option specifies that the lookup should be sent to the master server of the named data. This guar- antees that the most up to date information is seen at the possible expense that the master server may be busy. -P Follow concatenation path. This option specifies that the lookup should follow the concatenation path of a table if the initial search is unsuccessful. This option is only valid when using indexed names or following links. -t type This option tests the type of object. The value of type can be one of the following: D Return true if the object is a directory object. G Return true if the object is a group object. L Return true if the object is a link object. P Return true if the object is a private object. T Return true if the object is a table object. -c Test whether or not two directory names have a certain relationship to each other, for example, higher than (ht) or lower than (lt). The complete list of values for op can be displayed by using the -c option with no arguments. EXAMPLES
Example 1: Using the nistest Command When testing for access rights, nistest returns success (0) if the specified rights are granted to the current user. Thus, testing for access rights: example% nistest -a w=mr skippy.domain Tests that all authenticated NIS+ clients have read and modify access to the object named skippy.domain. Testing for access on a particular entry in a table can be accomplished using the indexed name syntax. The following example tests to see if an entry in the password table can be modified: example% nistest -a o=m '[uid=99],passwd.org_dir' To test if a directory lies higher in the namespace than another directory, use the -c option with an op of ht (higher than) as in the fol- lowing example (which would return true): example% nistest -c dom.com. ht lower.dom.com. ENVIRONMENT VARIABLES
NIS_PATH If this variable is set, and the NIS+ name is not fully qualified, each directory specified will be searched until the object is found. See nisdefaults(1). EXIT STATUS
The following exit values are returned: 0 Successful operation. 1 Failure due to object not present, not of specified type, and/or no such access. 2 Failure due to illegal usage. ATTRIBUTES
See attributes(5) for descriptions of the following attributes: +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +-----------------------------+-----------------------------+ |Availability |SUNWnisu | +-----------------------------+-----------------------------+ SEE ALSO
nis+(1), nischmod(1), nisdefaults(1), nismatch(1), attributes(5) NOTES
NIS+ might not be supported in future releases of the SolarisTM Operating Environment. Tools to aid the migration from NIS+ to LDAP are available in the Solaris 9 operating environment. For more information, visit http://www.sun.com/directory/nisplus/transition.html. SunOS 5.10 10 Dec 2001 nistest(1)
All times are GMT -4. The time now is 09:26 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy