Posts Tagged ‘special’

Special Characters and their meaning:

~ - Home directory
 - Command substitution. Better: $(...)
# - Comment
$ - Variable expression
& - Background Job
* - File name matching wildcard
| - Pipe
( - Start subshell
) - End subshell
[ - Start character set ?le name matching
] - End character set ?le name matching
{ - Start command block
; - Command separator
\ - Quote next character
 - Strong quote
" - Weak quote
< - Redirect Input
> - Redirect Output
/ - Pathname directory separator
? - Single-character match in ?lenames
! - Pipline logical NOT
pace or tab - shell normally splits at white space

setuid grants temporary access permission. A normal user inherits root privileges for the purpose of that process. setuid bit is represented by an S/s.
-rwSrw-rw- –> Setuid bit set, not executable
-rwsrw-rw- –> Setuid bit set, executable

syntax:

chmod 4*** file

e.g.: chmod 4644 /etc/passwd

setgid works the same way with setuid. The difference is; instead of the root, the group privileges are inherited. setgid is bit represented by an S/s.
-rw-rwSrw- –> Setgid bit set, not executable
-rw-rwsrw- –> Setgid bit set, executable
file should be a member of the group, to access privilege.

syntax:

chmod 2*** file

e.g.: chmod 2755 hexdump

stickybit keep programs in swap even after execution. Files in a directory with the sticky bit set can not be deleted by anyone other than the owner of the file, the owner of the directory, and the root user. Sticky bit is represented by an T/t.
-rw-rw-rwT –> Sticky bit set, not executable
-rw-rw-rwt –> Sticky bit set, executable

syntax:

chmod 1*** file

e.g.: chmod 1755 myfile