1830657 Members
28096 Online
110015 Solutions
New Discussion

Re: how

 
Mohammad Sanaullah
Frequent Advisor

how

1. how we can use _(underscore key) as backspace in hpux?
2. find files older than a given period (date/time)?
3. what option would be used to avoid changes made to link file to be reflected on original one?
4. listing all the files for which SETUID bit has been set in /usr/bin directory?
5. how to change user group temporarily without making changes in /etc/groups file?

i am a learner please help me out.


Thanks in advance
Mohammad Sanaullah
Alive
5 REPLIES 5
Steve Steel
Honored Contributor

Re: how

Hi

1)man stty
2),4) man find
5)chgrp

3)If it is a softlink you change the file . hardlink you do not

see

www.docs.hp.com
www.shelldorado.com

Steve Steel
If you want truly to understand something, try to change it. (Kurt Lewin)
Peter Godron
Honored Contributor

Re: how

Hi,
1. use stty
For a similar thread see:
http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=810789

2. find /dir1 -xdev -mtime +365 -type f
See "man find" or use the -newer option

3. Use seperate files

4. find /usr/bin -perm -4000
See earlier thread:http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=1040996

5. Set up secondary group

Please read:
http://66.34.90.71/ITRCForumsEtiquette/after.html

Please also read:
http://forums1.itrc.hp.com/service/forums/helptips.do?#33
on how to reward any useful answers given to your questions.

So far you have not awarded any points !

Rasheed Tamton
Honored Contributor

Re: how

1. stty erase "_"
2. find . -mtime
or
touch myfile
find . -newer myfile
3. Do not understand - please elaborate the question
4. find /usr/bin -type f \( -perm -4000 -o -perm -2000 \)
5. To change from your current group to group users without executing the
login routines:

newgrp users

To change from your current group to group users and execute the login
routines:

newgrp - users


Regards,
Rasheed Tamton.
Bill Hassell
Honored Contributor

Re: how

1) stty erase _
(but you should always look at the man pages - that's where all Unix commands are documented)

2) The question is ambiguous. "older" relative to what? When the file was last acccessed? When the contents of the file was changed? When the file was renamed or the mode (permission bits) was changed? See the man page for ls first, then look at the man page options for find that are named -atime -mtime and -ctime.

3) The option is called cp. A link is not a real file at all -- it is the same file with another name. If you want to change a file without changing the original, you make a copy.

4) From man find, use the -perm option. However, here is a case where manspeak (the horrible language used to describe an option in the man page) is confusing, so here are some examples:

setUID:
find /usr/bin -perm -2000 -exec ll -d {} +

setGID:
find /usr/bin -perm -4000 -exec ll -d {} +

To find world-writable directories (always a potential problem):

find /etc -perm -002 -exec ll -d {} +

5) newgrp is the correct command but this is a horrible command. It stops your current shell and starts a new one so it can never be used in a script (the script stops running). However, you cannot change to a group where you do not belong (from the /etc/group file). The *only* possible use for newgrp is to change the default group when you create a file. Otherwise (unless you are running a horribly obsolete version of HP-UX), you are a member of *all* the groups in /etc/group where your name is found. To see all the groups where you are a member, the the command:

id


Bill Hassell, sysadmin
Dave La Mar
Honored Contributor

Re: how

Just curious; what class are you taking that assigned these questions?

-dl
"I'm not dumb. I just have a command of thoroughly useless information."