Professional Documents
Culture Documents
User Access: Charotar University of Science and Technology
User Access: Charotar University of Science and Technology
User Access: Charotar University of Science and Technology
Practical-2
Date:
Aim: Study of Unix Architecture and the following Unix commands
with option:
User Access
Description: The passwd utility is used to update user's authentication token(s).
This task is achieved through calls to the Linux-PAM and Libuser API.
Essentially, it initializes itself as a "passwd" service with Linux-PAM
and utilizes configured password modules to authenticate and then up‐
date a user's password.
A simple entry in the global Linux-PAM configuration file for this ser‐
vice would be:
#
# passwd service entry that does strength checking of
# a proposed password before updating it.
#
passwd password requisite pam_cracklib.so retry=3
passwd password required pam_unix.so use_authtok
#
Program: passwd
Output:
1
Charotar University of Science and Technology
Devang Patel Institute of Advance Technology and Research
Department of Computer Engineering
Description:
Program: exit
Output:
Directory
Description: Create the DIRECTORY(ies), if they do not already exist.
Mandatory arguments to long options are mandatory for short options
too.
-m, --mode=MODE
set file mode (as in chmod), not a=rwx - umask
-p, --parents
no error if existing, make parent directories as needed
-v, --verbose
print a message for each created directory
-Z set SELinux security context of each created directory to the
default type
Program: mkdir
Output:
Description: Remove the DIRECTORY(ies), if they are empty.
2
Charotar University of Science and Technology
Devang Patel Institute of Advance Technology and Research
Department of Computer Engineering
--ignore-fail-on-non-empty
ignore each failure that is solely because a directory
is non-empty
Program: rmdir
Output:
Description: Print the full filename of the current working directory.
-L, --logical
3
Charotar University of Science and Technology
Devang Patel Institute of Advance Technology and Research
Department of Computer Engineering
use PWD from environment, even if it contains symlinks
-P, --physical
avoid all symlinks
--help display this help and exit
--version
output version information and exit
If no option is specified, -P is assumed.
Program: pwd
Output:
Description: List information about the FILEs (the current directory by default).
Sort entries alphabetically if none of -cftuvSUX nor --sort is speci‐
fied.
Mandatory arguments to long options are mandatory for short options
too.
Program: ls
Output:
4
Charotar University of Science and Technology
Devang Patel Institute of Advance Technology and Research
Department of Computer Engineering
Description: Rename SOURCE to DEST, or move SOURCE(s) to DIRECTORY.
Program: mv
Output:
5
Charotar University of Science and Technology
Devang Patel Institute of Advance Technology and Research
Department of Computer Engineering
Description:
Copy SOURCE to DEST, or multiple SOURCE(s) to DIRECTORY.
Program: cp
Output:
6
Charotar University of Science and Technology
Devang Patel Institute of Advance Technology and Research
Department of Computer Engineering
Description: This manual page documents the GNU version of rm. rm removes each
specified file. By default, it does not remove directories.
If the -I or --interactive=once option is given, and there are more
than three files or the -r, -R, or --recursive are given, then rm
prompts the user for whether to proceed with the entire operation. If
the response is not affirmative, the entire command is aborted.
Otherwise, if a file is unwritable, standard input is a terminal, and
the -f or --force option is not given, or the -i or --interactive=al‐
ways option is given, rm prompts the user for whether to remove the
file. If the response is not affirmative, the file is skipped.
Program: rm
Output:
Description: Write sorted concatenation of all FILE(s) to standard output.
With no FILE, or when FILE is -, read standard input.
Mandatory arguments to long options are mandatory for short options
too. Ordering options:
-b, --ignore-leading-blanks
ignore leading blanks
-d, --dictionary-order
consider only blanks and alphanumeric characters
-f, --ignore-case
fold lower case to upper case characters
7
Charotar University of Science and Technology
Devang Patel Institute of Advance Technology and Research
Department of Computer Engineering
-g, --general-numeric-sort
compare according to general numerical value
Program: sort
Output:
Description: Concatenate FILE(s) to standard output.
With no FILE, or when FILE is -, read standard input.
-A, --show-all
equivalent to -vET
-b, --number-nonblank
number nonempty output lines, overrides -n
-e equivalent to -vE
-E, --show-ends
display $ at end of each line
-n, --number
number all output lines
-s, --squeeze-blank
suppress repeated empty output lines
8
Charotar University of Science and Technology
Devang Patel Institute of Advance Technology and Research
Department of Computer Engineering
Program: cat
Output:
Description:
This manual page documents version 5.39 of the file command.
file tests each argument in an attempt to classify it. There are three
sets of tests, performed in this order: filesystem tests, magic tests,
and language tests. The first test that succeeds causes the file type to
be printed.
The type printed will usually contain one of the words text (the file
contains only printing characters and a few common control characters and
is probably safe to read on an ASCII terminal), executable (the file con‐
tains the result of compiling a program in a form understandable to some
UNIX kernel or another), or data meaning anything else (data is usually
“binary” or non-printable). Exceptions are well-known file formats (core
files, tar archives) that are known to contain binary data. When modify‐
ing magic files or the program itself, make sure to preserve these
keywords
Program: file
9
Charotar University of Science and Technology
Devang Patel Institute of Advance Technology and Research
Department of Computer Engineering
Output:
Description:
more is a filter for paging through text one screenful at a time.This
version is especially primitive. Users should realize that less(1)
provides more(1) emulation plus extensive enhancements.
Program: more
Output:
Description:
Compare two files byte by byte.
The optional SKIP1 and SKIP2 specify the number of bytes to skip at the
beginning of each file (zero by default).
10
Charotar University of Science and Technology
Devang Patel Institute of Advance Technology and Research
Department of Computer Engineering
Program: cmp
Output:
Description: Compare FILES line by line.
Program: diff
Output:
Description: Compare sorted files FILE1 and FILE2 line by line.
When FILE1 or FILE2 (not both) is -, read standard input.
With no options, produce three-column output. Column one contains
lines unique to FILE1, column two contains lines unique to FILE2, and
column three contains lines common to both files
11
Charotar University of Science and Technology
Devang Patel Institute of Advance Technology and Research
Department of Computer Engineering
Program: comm
Output:
Description:
Print the first 10 lines of each FILE to standard output. With more
than one FILE, precede each with a header giving the file name.
With no FILE, or when FILE is -, read standard input
Program: head
Output:
12
Charotar University of Science and Technology
Devang Patel Institute of Advance Technology and Research
Department of Computer Engineering
Description:
Print the last 10 lines of each FILE to standard output. With more
than one FILE, precede each with a header giving the file name.
With no FILE, or when FILE is -, read standard input.
Program: tail
Output:
13
Charotar University of Science and Technology
Devang Patel Institute of Advance Technology and Research
Department of Computer Engineering
Description:
Program:
Output:
14
Charotar University of Science and Technology
Devang Patel Institute of Advance Technology and Research
Department of Computer Engineering
Description:
Program:
Output:
15