Sponsored Content
Full Discussion: $pwd
Top Forums UNIX for Beginners Questions & Answers $pwd Post 302974362 by MadeInGermany on Sunday 29th of May 2016 05:47:58 AM
Old 05-29-2016
If any of the some/where argument of the cd command goes to a symbolic link, then the real path from pwd command will differ.
This User Gave Thanks to MadeInGermany For This Post:
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

help on PWD

Hi, We all know that pwd (or echo $PWD) gives us the present working dir as output.... but my doubt is that I'ld like to know how to get the present working folder - I mean - name of the current folder alone.. using pwd command I get the full folder name (right from root path)... I need to know... (2 Replies)
Discussion started by: mohanprabu
2 Replies

2. UNIX for Dummies Questions & Answers

pwd

Home directory mounted on one local system as /home/username, same directory mounted on a remote system as /home/engr/username. How to use command to use remote host pwd. For example rsh <remote host> ls -l ~pwd (2 Replies)
Discussion started by: bugsandbunny
2 Replies

3. UNIX for Advanced & Expert Users

echo ${PWD#${PWD%/*/*}/}

Can anyone explain this in detail ... echo ${PWD#${PWD%/*/*}/} Thanks in Advance (1 Reply)
Discussion started by: sakthi.abdullah
1 Replies

4. UNIX for Advanced & Expert Users

console '# ' with {PWD} ??

Hi people... i recently installed AIX 5.3 on a server... but now when i login with root it only shows '# ' without the location where i am... for example: if im in /usr/local it continues to show only '# ' and i want to see the path like 'root@server:/usr/local#' someone can help me? ... (2 Replies)
Discussion started by: gfca
2 Replies

5. UNIX for Dummies Questions & Answers

how to connect to /etc/pwd

i've been searching the way to connect to pwd.db file located in /etc/ directory.. since i'm not the root and only one of the users of the server, i need to connect to the database so that i can make a login page for all users of the server.. the file is readable by all users and the permission... (1 Reply)
Discussion started by: meggae
1 Replies

6. UNIX for Dummies Questions & Answers

PWD COMMAND

Hi, Can you tell me if there is a command such as pwd which does not give me the absolute NFS pathname i.e. it starts with .autofs? At the moment on the unix when I use the 'pwd' command it always gives me the nfs pathname rather thanthe local pathname of which is what i want, is there an... (4 Replies)
Discussion started by: cyberfrog
4 Replies

7. AIX

sync samba pwd with aix5.3 pwd

currently, my samba login works just fine. i want my clients to use aix5.3 account to login to samba so they don't have to change samba pwd and aix pwd. i googled, and vi /usr/lib/smb.conf per some of knowledge base, but i could not get to work. aix5.3 and samba 3.0.24.0 thanks in advace..... (2 Replies)
Discussion started by: tjmannonline
2 Replies

8. UNIX for Dummies Questions & Answers

pwd help

Dear users, One more question, In unix when i use pwd the following I get: pwd /Users/username/src/directory name Is there a way to get the out put like this in which the if there is a space in the directory eg directory name it should show as directory\ name:... (2 Replies)
Discussion started by: kevincobain2000
2 Replies

9. UNIX for Dummies Questions & Answers

$PWD vs `pwd`

Hi, can anyone expalin the real importance of PWD as a variable. However pwd command and $PWD is going to give the same result, then why do we have 2 different things. Please give some example which illustrates the difference between both. Thanks (9 Replies)
Discussion started by: pandeesh
9 Replies

10. Shell Programming and Scripting

Help with 'pwd' command

Dear all, I am trying to use 'pwd' command in following way. current_directory == /dirA/dirB/test/dirC if ; then do this fi I am not sure how to pass this in command way. Please help! thanking you, emily (10 Replies)
Discussion started by: emily
10 Replies
LCHOWN(3P)						     POSIX Programmer's Manual							LCHOWN(3P)

PROLOG
This manual page is part of the POSIX Programmer's Manual. The Linux implementation of this interface may differ (consult the correspond- ing Linux manual page for details of Linux behavior), or the interface may not be implemented on Linux. NAME
lchown - change the owner and group of a symbolic link SYNOPSIS
#include <unistd.h> int lchown(const char *path, uid_t owner, gid_t group); DESCRIPTION
The lchown() function shall be equivalent to chown(), except in the case where the named file is a symbolic link. In this case, lchown() shall change the ownership of the symbolic link file itself, while chown() changes the ownership of the file or directory to which the sym- bolic link refers. RETURN VALUE
Upon successful completion, lchown() shall return 0. Otherwise, it shall return -1 and set errno to indicate an error. ERRORS
The lchown() function shall fail if: EACCES Search permission is denied on a component of the path prefix of path. EINVAL The owner or group ID is not a value supported by the implementation. ELOOP A loop exists in symbolic links encountered during resolution of the path argument. ENAMETOOLONG The length of a pathname exceeds {PATH_MAX} or a pathname component is longer than {NAME_MAX}. ENOENT A component of path does not name an existing file or path is an empty string. ENOTDIR A component of the path prefix of path is not a directory. EOPNOTSUPP The path argument names a symbolic link and the implementation does not support setting the owner or group of a symbolic link. EPERM The effective user ID does not match the owner of the file and the process does not have appropriate privileges. EROFS The file resides on a read-only file system. The lchown() function may fail if: EIO An I/O error occurred while reading or writing to the file system. EINTR A signal was caught during execution of the function. ELOOP More than {SYMLOOP_MAX} symbolic links were encountered during resolution of the path argument. ENAMETOOLONG Pathname resolution of a symbolic link produced an intermediate result whose length exceeds {PATH_MAX}. The following sections are informative. EXAMPLES
Changing the Current Owner of a File The following example shows how to change the ownership of the symbolic link named /modules/pass1 to the user ID associated with "jones" and the group ID associated with "cnd". The numeric value for the user ID is obtained by using the getpwnam() function. The numeric value for the group ID is obtained by using the getgrnam() function. #include <sys/types.h> #include <unistd.h> #include <pwd.h> #include <grp.h> struct passwd *pwd; struct group *grp; char *path = "/modules/pass1"; ... pwd = getpwnam("jones"); grp = getgrnam("cnd"); lchown(path, pwd->pw_uid, grp->gr_gid); APPLICATION USAGE
On implementations which support symbolic links as directory entries rather than files, lchown() may fail. RATIONALE
None. FUTURE DIRECTIONS
None. SEE ALSO
chown(), symlink(), the Base Definitions volume of IEEE Std 1003.1-2001, <unistd.h> COPYRIGHT
Portions of this text are reprinted and reproduced in electronic form from IEEE Std 1003.1, 2003 Edition, Standard for Information Technol- ogy -- Portable Operating System Interface (POSIX), The Open Group Base Specifications Issue 6, Copyright (C) 2001-2003 by the Institute of Electrical and Electronics Engineers, Inc and The Open Group. In the event of any discrepancy between this version and the original IEEE and The Open Group Standard, the original IEEE and The Open Group Standard is the referee document. The original Standard can be obtained online at http://www.opengroup.org/unix/online.html . IEEE
/The Open Group 2003 LCHOWN(3P)
All times are GMT -4. The time now is 06:18 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy