strace -tt -o log -p
log is going to the error log file.
man -k program_name
gpasswd -a user_name group_name
gpasswd -a example project
4, give the write permission to the group for project dir:
chmod -R g+w project
5, Set the S-GID means change the x bit to s so when any user creat any folder or files they
inherent their ownership like their parents project:
chmod g+s project
one can set the set-UID by adding a 4 in the chmod like:
chmod 4755 mydir
the first 4 is the set-UID for set-GID use the 2 and for the sticky bit use the 1.
LABEL=/usr /usr ext4 ro,suid,dev,auto,nouser,async 1 2
even root cannot write to the usr dir until change ro to rw.
umask
022
That means 755 permission (minus the umaks values from 7 to see the permission)
export PATH=$:~/bin
above will add the bin dir from your home to the path.
export CDPATH=.;~
The above command will make cd program to search as will your home dir.
rm -rf "\\"
to delete - :
rm -rf -- "-"
or
rm -rf "\-"
Top
#/bin/bash
# to kill process run the script as "killp procces_name".
ps -ef | grep $1 | grep -v grep | awk '{print $2}' | xargs kill -9
Top
# chattr +i test_file
# chattr -i test_file
To check the file attributes:
# lsattr test_file
To permit only appending the lines in a file, cannot change the written lines, or remove that:
# chattr +a test_file
# chattr -a test_file
Creat a empty file -i with touch in any directory, so when want to delete the files from this directory will prompt for permission
and only the -f command can delte files from this dir:
touch -i
Top