Sponsored Content
Top Forums Shell Programming and Scripting Command to check the user's permission in UNIX ?? Post 302338787 by suigion on Wednesday 29th of July 2009 12:02:18 AM
Old 07-29-2009
Command to check the user's permission in UNIX ??

Hi,

What is the command to check the user's permission in UNIX ?
e.g: user in UNIX is "myuser"

The result should be number format. e.g: 755, 644, etc...

Thanks.. Smilie
 

10 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

Running a Unix command as a different user

hi, I wrote a C program (runas.c) that runs a command as a different user. The problem I'm having is that the new user's group membership isn't going into effect. Take the following scenario: I login as "kirk". I need to run some commands as "spock". kirk and spock belong to these... (4 Replies)
Discussion started by: Andrewkl
4 Replies

2. UNIX for Dummies Questions & Answers

Limit Unix command to user

Is it possible to limit a user account to only several commands. For security reasons, i would like for some users given accounts to only execute commands limited to them. If possible, how can it be done? tyvm. (1 Reply)
Discussion started by: coolphilboy
1 Replies

3. AIX

run which command to check the actual user

hi gurus, i have a question: when run which javac under a user account I got the following results: PROD DB Server: /usr/java14/bin/javac DR DB Server: /usr/java14/bin/javac DEV DB Server: /usr/java5_64/bin/javac The .profile in all environments are same. so how do know who is the... (1 Reply)
Discussion started by: lweegp
1 Replies

4. UNIX for Dummies Questions & Answers

Command to check unix have web server

Hye All Any body know what is command to check whether unix have web server. (3 Replies)
Discussion started by: mastercar
3 Replies

5. Shell Programming and Scripting

Command to check the CPU usage for particular user

Hi All, Can anybody knows, how to check the CPU usage in percentage for a particular process along with its user and PID? Thanks in advance!! (3 Replies)
Discussion started by: AB10
3 Replies

6. UNIX for Dummies Questions & Answers

PERL/UNIX - SVN check in command

I am working in perl. I need to do some svn check in from my server. I need to install svn in my server. I have the package "svn" in my server path How can I install that in my server. I tried , but this doesnt work. Can you please help with the command to be used. Thanks in... (0 Replies)
Discussion started by: irudayaraj
0 Replies

7. Shell Programming and Scripting

set only some command & scripts permission to a particular user

hi, i am new in unix.......i am using bash and i want to create a user which has only some command and scripts permission.........is it possible? thanx (1 Reply)
Discussion started by: rakeshtomar82
1 Replies

8. UNIX for Advanced & Expert Users

Command to check java file in UNIX

Guys, i need to check whether java file can be executed in my current unix system or not. Can anyone please help me to get the correct command to check this. My Unix system is HP-UX. Thanks, (1 Reply)
Discussion started by: AraR87
1 Replies

9. Shell Programming and Scripting

Check for file permission

Hi, I have an array that has several directory paths and file paths. I use a for loop to traverse through the array and check for files and not directories using the if condition. I wish to display all files that have permissions lesser than what the user has specified. For example: ... (14 Replies)
Discussion started by: mohtashims
14 Replies

10. UNIX for Beginners Questions & Answers

How to run root level command , if user has "su -" permission in sudoers provided?

I am looking t run root level command on multiple servers, but all servers have only "su - " permission available in sudoers. please help me if any way that I can run command using help of "su -" My script for hosts in `cat hosts.txt`; do echo "###########################Server Name-... (5 Replies)
Discussion started by: yash_message
5 Replies
write(1)						      General Commands Manual							  write(1)

NAME
write - Sends messages to other users SYNOPSIS
write [-r] [-n node] user [line] write user@node [line] write -h handle,reply write -q [-n node] The write command allows you to converse with another user who is logged in. [Tru64 UNIX] The write -r command allows you to send messages to users on other hosts (usually from a shell script) and to wait for replies; use write -h to reply to such messages. STANDARDS
Interfaces documented on this reference page conform to industry standards as follows: write: XCU5.0 Refer to the standards(5) reference page for more information about industry standards and associated tags. OPTIONS
[Tru64 UNIX] Replies to a message sent by a utility or shell script with write -r. The value to be used for handle is generated inter- nally and supplied to you in the text of the original message. [Tru64 UNIX] The reply can be ok, cancel, or query. (See EXAMPLES and EXIT STATUS.) [Tru64 UNIX] Specifies a remote host. The node field may be a nickname or a node ID. This option is used in place of the user@node argument; the two cannot be specified together. [Tru64 UNIX] Queries all messages awaiting replies from users on a node and displays them with their handles. [Tru64 UNIX] Generates a message handle, places it in the message header, sends the message, and waits for a reply. This option can be used for operator messages and can be put in shell scripts. It is not used for interactive conversations. (See EXAMPLES and EXIT STATUS). OPERANDS
Login name of the user with whom you wish to converse. This operand is in the form written by the who utility. [Tru64 UNIX] You may append an optional @node if the user is on a different host. The format of @node is as much of the remote hostname and domainname as may be required by your system. The terminal identification of the terminal where the other user is logged in. You only need to specify this parameter if the other user has several sessions operating on the target host. See DESCRIPTION for a further explanation. DESCRIPTION
When two users converse with write, each user alternately sends and receives short messages from their respective terminals. [Tru64 UNIX] For another user to receive your message, that user must be logged in and must not have refused message permission. When a person you are trying to reach is not logged in, you get the message user is not logged on. When the person you are trying to reach has refused message permission, you get the message Write: Permission denied. When you run the write command, it immediately sends the following message to the person whose login name you entered. Message from sender on node (ttynn) [date]... [Tru64 UNIX] The message is accompanied by attention-getting sound (three ASCII BEL characters). After successful connection, the write command then sends two ASCII BEL characters to your terminal to alert you that whatever you enter now is being sent to the other user. Sending continues until you enter the End-of-File key sequence, at which point write sends an End-of- Text sequence to the other terminal and exits. At any point, the other user can respond by sending a write message back. [Tru64 UNIX] For this type of exchange, the following convention is useful. When you first write to others, wait for them to write back before sending any text. End a message with a prearranged signal (such as o for over) to alert the other user to reply. [Tru64 UNIX] If the ! (exclamation point) character is found at the beginning of an input line, write calls the shell to execute the rest of the line as a command. When you use the write command to contact a user logged in at more than one terminal, write uses the first login instance found in the /var/adm/utmp file as the message delivery point, and you get the message: user is logged on more than one place. You are connected to tty. Other locations are: tty ... You can contact this user at another location by specifying the line. The parameter line indicates to which terminal (tty00, for example) the message should be sent. Permission to use the write command to contact another user is granted or denied by the other user with the mesg command. Some commands deny message permission while they are running to prevent interference with their output. [Tru64 UNIX] If you have superuser authority, you can write to any terminal regardless of the terminal's message permission. [Tru64 UNIX] The write command filters nonprintable characters and transmits them in their printed form (that is, ASCII sequence 001 is transmitted as ^A). [Tru64 UNIX] When the write -r command is used to send you a message, you can send a reply of ok, cancel, or query with write -h. (See OPTIONS, EXAMPLES and EXIT STATUS). [Tru64 UNIX] An argument of a - (dash) following the write command allows you to specify a specific terminal to which you want to write as the second argument. Typing characters from LC_TYPE classifications print or space causes those characters to be sent to the recipient's terminal. NOTES
The talk utility is considered to be a more usable utility on full-screen terminals. RESTRICTIONS
[Tru64 UNIX] The writesrv daemon must be running on the target host in order for any of the options to work. If you are not using either the -n option or @host, but using -h, -q, or -r, the writesrv daemon must be running on your host. [Tru64 UNIX] See writesrv(8) for information on how to start or stop the writesrv daemon. EXIT STATUS
[Tru64 UNIX] The write -r command is used to send messages to users and to wait for replies. Their responses determine the exit value: [Tru64 UNIX] Exit status 0 (zero). [Tru64 UNIX] Exit status 1. [Tru64 UNIX] Message for handle redisplays; write does not exit. An exit status of 2 indicates that the user could not be contacted. EXAMPLES
The following examples assume that the End-of-File key sequence is <Ctrl-d>. The actual key sequence may be different. lucy on tty3 writes a message to sue on the same node: write sue Meet me in the computer room at 12:30. <Ctrl-d> sue sees: Message from lucy on node (tty3) [Thu Aug 17 11:55:24 1990] Meet me in the computer room at 12:30. <EOT> Holding a con- versation: write sue Meet me in the computer room at 12:30. over lucy then waits for a response from sue, who replies: write lucy I'm running tests at 12:30. Can we meet at 3? over sue then waits for lucy, who replies and terminates: OK--the computer room at 3. bye <Ctrl-d> sue then terminates their side of the conversation. To write someone a prepared message, enter: write sue <message.text This writes the contents of the file message.text to sue's terminal. To write to the person using a certain terminal, enter: write - console The printer in building 998 has jammed. Please send help. <Ctrl-d> This writes the message to the person logged in on the system console. To send a message to user sue at node, enter: write -n node sue or write sue@node To get a reply to a message, lucy might enter the following: write -r sue console Please insert next tape. sue terminates lucy's message with write -h 12345,ok <Ctrl-d> or write -h 12345,cancel or write -h 12345,query sue then terminates as usual. Note that with the -h option, there is no need to supply the hostname or user ID. ENVIRONMENT VARIABLES
The following environment variables affect the execution of write: Provides a default value for the internationalization variables that are unset or null. If LANG is unset or null, the corresponding value from the default locale is used. If any of the internationalization vari- ables contain an invalid setting, the utility behaves as if none of the variables had been defined. If set to a non-empty string value, overrides the values of all the other internationalization variables. Determines the locale for the interpretation of sequences of bytes of text data as characters (for example, single-byte as opposed to multibyte characters in arguments). If the recipient's locale does not use an equivalent LC_CTYPE, the results are undefined. Determines the locale for the format and contents of diagnostic messages written to standard error. Determines the location of message catalogues for the processing of LC_MESSAGES. FILES
Contains user and accounting information. SEE ALSO
Commands: mesg(1), login(1), sh(1b), sh(1p), talk(1), wall(1), who(1), writesrv(8) Files: utmp(4) Standards: standards(5) write(1)
All times are GMT -4. The time now is 02:28 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy