0% found this document useful (0 votes)
0 views

a8

The document contains a series of commands executed in a terminal, including creating and running a shell script that concatenates specific files into a new file. It also includes detailed manual pages for the commands 'chmod', 'du', and 'rm', explaining their usage, options, and descriptions. The manual pages provide information on changing file permissions, estimating file space usage, and removing files or directories, respectively.
Copyright
© © All Rights Reserved
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
0 views

a8

The document contains a series of commands executed in a terminal, including creating and running a shell script that concatenates specific files into a new file. It also includes detailed manual pages for the commands 'chmod', 'du', and 'rm', explaining their usage, options, and descriptions. The manual pages provide information on changing file permissions, estimating file space usage, and removing files or directories, respectively.
Copyright
© © All Rights Reserved
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 10

moonylead@moonylead-hp:~/Kozul$ nano script.

sh
moonylead@moonylead-hp:~/Kozul$ touch script.sh
moonylead@moonylead-hp:~/Kozul$ nano script.sh
moonylead@moonylead-hp:~/Kozul$ cat script.sh
cat apr/arg2/arg6/arg1/.s1_copy apr/arg2/arg6/arg3/.s3_copy
apr/arg2/arg6/arg1/arg5/.s5_copy apr/arg2/arg6/.s6_copy > apr2/X2
moonylead@moonylead-hp:~/Kozul$ mkdir apr2
moonylead@moonylead-hp:~/Kozul$ ls
apr apr2 script.sh wc_info.txt
moonylead@moonylead-hp:~/Kozul$ bash script.sh
moonylead@moonylead-hp:~/Kozul$ ls - apr2/X2
ls: cannot access '-': No such file or directory
apr2/X2
moonylead@moonylead-hp:~/Kozul$ ls -la apr2/X2
-rw-rw-r-- 1 moonylead moonylead 19050 Mar 8 14:25 apr2/X2
moonylead@moonylead-hp:~/Kozul$ cat apr2/X2
CHMOD(1) User Commands
CHMOD(1)

NAME
chmod - change file mode bits

SYNOPSIS
chmod [OPTION]... MODE[,MODE]... FILE...
chmod [OPTION]... OCTAL-MODE FILE...
chmod [OPTION]... --reference=RFILE FILE...

DESCRIPTION
This manual page documents the GNU version of chmod. chmod changes the
file mode bits of each given file ac‐
cording to mode, which can be either a symbolic representation of changes to
make, or an octal number repre‐
senting the bit pattern for the new mode bits.

The format of a symbolic mode is [ugoa...][[-+=][perms...]...], where


perms is either zero or more letters
from the set rwxXst, or a single letter from the set ugo. Multiple symbolic
modes can be given, separated by
commas.

A combination of the letters ugoa controls which users' access to the file
will be changed: the user who owns
it (u), other users in the file's group (g), other users not in the file's
group (o), or all users (a). If
none of these are given, the effect is as if (a) were given, but bits
that are set in the umask are not af‐
fected.

The operator + causes the selected file mode bits to be added to the
existing file mode bits of each file; -
causes them to be removed; and = causes them to be added and causes
unmentioned bits to be removed except that
a directory's unmentioned set user and group ID bits are not affected.

The letters rwxXst select file mode bits for the affected users: read (r),
write (w), execute (or search for
directories) (x), execute/search only if the file is a directory or already
has execute permission for some
user (X), set user or group ID on execution (s), restricted deletion flag
or sticky bit (t). Instead of one
or more of these letters, you can specify exactly one of the letters ugo:
the permissions granted to the user
who owns the file (u), the permissions granted to other users who are
members of the file's group (g), and the
permissions granted to users that are in neither of the two preceding
categories (o).

A numeric mode is from one to four octal digits (0-7), derived by adding up
the bits with values 4, 2, and 1.
Omitted digits are assumed to be leading zeros. The first digit selects the
set user ID (4) and set group ID
(2) and restricted deletion or sticky (1) attributes. The second digit
selects permissions for the user who
owns the file: read (4), write (2), and execute (1); the third selects
permissions for other users in the
file's group, with the same values; and the fourth for other users not in
the file's group, with the same val‐
ues.

chmod never changes the permissions of symbolic links; the chmod system
call cannot change their permissions.
This is not a problem since the permissions of symbolic links are never
used. However, for each symbolic link
listed on the command line, chmod changes the permissions of the pointed-to
file. In contrast, chmod ignores
symbolic links encountered during recursive directory traversals.

SETUID AND SETGID BITS


chmod clears the set-group-ID bit of a regular file if the file's group ID
does not match the user's effective
group ID or one of the user's supplementary group IDs, unless the user has
appropriate privileges. Additional
restrictions may cause the set-user-ID and set-group-ID bits of MODE or
RFILE to be ignored. This behavior
depends on the policy and functionality of the underlying chmod system call.
When in doubt, check the under‐
lying system behavior.

For directories chmod preserves set-user-ID and set-group-ID bits unless


you explicitly specify otherwise.
You can set or clear the bits with symbolic modes like u+s and g-s. To
clear these bits for directories with
a numeric mode requires an additional leading zero like 00755, leading
minus like -6000, or leading equals
like =755.

RESTRICTED DELETION FLAG OR STICKY BIT


The restricted deletion flag or sticky bit is a single bit, whose
interpretation depends on the file type.
For directories, it prevents unprivileged users from removing or renaming a
file in the directory unless they
own the file or the directory; this is called the restricted deletion flag
for the directory, and is commonly
found on world-writable directories like /tmp. For regular files on
some older systems, the bit saves the
program's text image on the swap device so it will load more quickly when
run; this is called the sticky bit.
OPTIONS
Change the mode of each FILE to MODE. With --reference, change the mode of
each FILE to that of RFILE.

-c, --changes
like verbose but report only when a change is made

-f, --silent, --quiet


suppress most error messages

-v, --verbose
output a diagnostic for every file processed

--no-preserve-root
do not treat '/' specially (the default)

--preserve-root
fail to operate recursively on '/'

--reference=RFILE
use RFILE's mode instead of specifying MODE values. RFILE is always
dereferenced if a symbolic link.

-R, --recursive
change files and directories recursively

--help display this help and exit

--version
output version information and exit

Each MODE is of the form '[ugoa]*([-+=]([rwxXst]*|[ugo]))+|[-+=][0-7]+'.

AUTHOR
Written by David MacKenzie and Jim Meyering.

REPORTING BUGS
GNU coreutils online help: <https://www.gnu.org/software/coreutils/>
Report any translation bugs to <https://translationproject.org/team/>

COPYRIGHT
Copyright © 2023 Free Software Foundation, Inc. License GPLv3+:
GNU GPL version 3 or later
<https://gnu.org/licenses/gpl.html>.
This is free software: you are free to change and redistribute it. There
is NO WARRANTY, to the extent per‐
mitted by law.

SEE ALSO
chmod(2)

Full documentation <https://www.gnu.org/software/coreutils/chmod>


or available locally via: info '(coreutils) chmod invocation'

GNU coreutils 9.4 April 2024


CHMOD(1)
DU(1) User Commands
DU(1)
NAME
du - estimate file space usage

SYNOPSIS
du [OPTION]... [FILE]...
du [OPTION]... --files0-from=F

DESCRIPTION
Summarize device usage of the set of FILEs, recursively for directories.

Mandatory arguments to long options are mandatory for short options too.

-0, --null
end each output line with NUL, not newline

-a, --all
write counts for all files, not just directories

--apparent-size
print apparent sizes rather than device usage; although the apparent
size is usually smaller, it may be
larger due to holes in ('sparse') files, internal fragmentation,
indirect blocks, and the like

-B, --block-size=SIZE
scale sizes by SIZE before printing them; e.g., '-BM' prints
sizes in units of 1,048,576 bytes; see
SIZE format below

-b, --bytes
equivalent to '--apparent-size --block-size=1'

-c, --total
produce a grand total

-D, --dereference-args
dereference only symlinks that are listed on the command line

-d, --max-depth=N
print the total for a directory (or file, with --all) only if it is N
or fewer levels below the command
line argument; --max-depth=0 is the same as --summarize

--files0-from=F
summarize device usage of the NUL-terminated file names specified in
file F; if F is -, then read names
from standard input

-H equivalent to --dereference-args (-D)

-h, --human-readable
print sizes in human readable format (e.g., 1K 234M 2G)

--inodes
list inode usage information instead of block usage

-k like --block-size=1K

-L, --dereference
dereference all symbolic links

-l, --count-links
count sizes many times if hard linked

-m like --block-size=1M

-P, --no-dereference
don't follow any symbolic links (this is the default)

-S, --separate-dirs
for directories do not include size of subdirectories

--si like -h, but use powers of 1000 not 1024

-s, --summarize
display only a total for each argument

-t, --threshold=SIZE
exclude entries smaller than SIZE if positive, or entries greater
than SIZE if negative

--time show time of the last modification of any file in the directory, or
any of its subdirectories

--time=WORD
show time as WORD instead of modification time: atime, access, use,
ctime or status

--time-style=STYLE
show times using STYLE, which can be: full-iso, long-iso, iso, or
+FORMAT; FORMAT is interpreted like
in 'date'

-X, --exclude-from=FILE
exclude files that match any pattern in FILE

--exclude=PATTERN
exclude files that match PATTERN

-x, --one-file-system
skip directories on different file systems

--help display this help and exit

--version
output version information and exit

Display values are in units of the first available SIZE from --block-size,
and the DU_BLOCK_SIZE, BLOCK_SIZE
and BLOCKSIZE environment variables. Otherwise, units default to 1024 bytes
(or 512 if POSIXLY_CORRECT is
set).

The SIZE argument is an integer and optional unit (example: 10K is


10*1024). Units are K,M,G,T,P,E,Z,Y,R,Q
(powers of 1024) or KB,MB,... (powers of 1000). Binary prefixes can be
used, too: KiB=K, MiB=M, and so on.
PATTERNS
PATTERN is a shell pattern (not a regular expression). The pattern ?
matches any one character, whereas *
matches any string (composed of zero, one or multiple characters). For
example, *.o will match any files
whose names end in .o. Therefore, the command

du --exclude='*.o'

will skip all files and subdirectories ending in .o (including the file .o
itself).

AUTHOR
Written by Torbjorn Granlund, David MacKenzie, Paul Eggert, and Jim
Meyering.

REPORTING BUGS
GNU coreutils online help: <https://www.gnu.org/software/coreutils/>
Report any translation bugs to <https://translationproject.org/team/>

COPYRIGHT
Copyright © 2023 Free Software Foundation, Inc. License GPLv3+:
GNU GPL version 3 or later
<https://gnu.org/licenses/gpl.html>.
This is free software: you are free to change and redistribute it. There
is NO WARRANTY, to the extent per‐
mitted by law.

SEE ALSO
Full documentation <https://www.gnu.org/software/coreutils/du>
or available locally via: info '(coreutils) du invocation'

GNU coreutils 9.4 April 2024


DU(1)
RM(1) User Commands
RM(1)

NAME
rm - remove files or directories

SYNOPSIS
rm [OPTION]... [FILE]...

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 --re‐
cursive 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=always option is given, rm prompts the user for
whether to remove the file. If the
response is not affirmative, the file is skipped.
OPTIONS
Remove (unlink) the FILE(s).

-f, --force
ignore nonexistent files and arguments, never prompt

-i prompt before every removal

-I prompt once before removing more than three files, or when removing
recursively; less intrusive than
-i, while still giving protection against most mistakes

--interactive[=WHEN]
prompt according to WHEN: never, once (-I), or always (-i); without
WHEN, prompt always

--one-file-system
when removing a hierarchy recursively, skip any directory that is on
a file system different from that
of the corresponding command line argument

--no-preserve-root
do not treat '/' specially

--preserve-root[=all]
do not remove '/' (default); with 'all', reject any command line
argument on a separate device from its
parent

-r, -R, --recursive


remove directories and their contents recursively

-d, --dir
remove empty directories

-v, --verbose
explain what is being done

--help display this help and exit

--version
output version information and exit

By default, rm does not remove directories. Use the --recursive (-r or -R)
option to remove each listed di‐
rectory, too, along with all of its contents.

To remove a file whose name starts with a '-', for example '-foo', use one
of these commands:

rm -- -foo

rm ./-foo

Note that if you use rm to remove a file, it might be possible to recover


some of its contents, given suffi‐
cient expertise and/or time. For greater assurance that the contents are
truly unrecoverable, consider using
shred(1).

AUTHOR
Written by Paul Rubin, David MacKenzie, Richard M. Stallman, and Jim
Meyering.

REPORTING BUGS
GNU coreutils online help: <https://www.gnu.org/software/coreutils/>
Report any translation bugs to <https://translationproject.org/team/>

COPYRIGHT
Copyright © 2023 Free Software Foundation, Inc. License
GPLv3+: GNU GPL version 3 or later
<https://gnu.org/licenses/gpl.html>.
This is free software: you are free to change and redistribute it. There is
NO WARRANTY, to the extent per‐
mitted by law.

SEE ALSO
unlink(1), unlink(2), chattr(1), shred(1)

Full documentation <https://www.gnu.org/software/coreutils/rm>


or available locally via: info '(coreutils) rm invocation'

GNU coreutils 9.4 April 2024


RM(1)
MV(1) User Commands
MV(1)

NAME
mv - move (rename) files

SYNOPSIS
mv [OPTION]... [-T] SOURCE DEST
mv [OPTION]... SOURCE... DIRECTORY
mv [OPTION]... -t DIRECTORY SOURCE...

DESCRIPTION
Rename SOURCE to DEST, or move SOURCE(s) to DIRECTORY.

Mandatory arguments to long options are mandatory for short options too.

--backup[=CONTROL]
make a backup of each existing destination file

-b like --backup but does not accept an argument

--debug
explain how a file is copied. Implies -v

-f, --force
do not prompt before overwriting

-i, --interactive
prompt before overwrite

-n, --no-clobber
do not overwrite an existing file
If you specify more than one of -i, -f, -n, only the final one takes effect.

--no-copy
do not copy if renaming fails

--strip-trailing-slashes
remove any trailing slashes from each SOURCE argument

-S, --suffix=SUFFIX
override the usual backup suffix

-t, --target-directory=DIRECTORY
move all SOURCE arguments into DIRECTORY

-T, --no-target-directory
treat DEST as a normal file

--update[=UPDATE]
control which existing files are updated;
UPDATE={all,none,older(default)}. See below

-u equivalent to --update[=older]

-v, --verbose
explain what is being done

-Z, --context
set SELinux security context of destination file to default type

--help display this help and exit

--version
output version information and exit

UPDATE controls which existing files in the destination are replaced.


'all' is the default operation when an
--update option is not specified, and results in all existing files in the
destination being replaced. 'none'
is similar to the --no-clobber option, in that no files in the destination
are replaced, but also skipped
files do not induce a failure. 'older' is the default operation when --
update is specified, and results in
files being replaced if they're older than the corresponding source file.

The backup suffix is '~', unless set with --suffix or SIMPLE_BACKUP_SUFFIX.


The version control method may be
selected via the --backup option or through the VERSION_CONTROL environment
variable. Here are the values:

none, off
never make backups (even if --backup is given)

numbered, t
make numbered backups

existing, nil
numbered if numbered backups exist, simple otherwise

simple, never
always make simple backups

AUTHOR
Written by Mike Parker, David MacKenzie, and Jim Meyering.

REPORTING BUGS
GNU coreutils online help: <https://www.gnu.org/software/coreutils/>
Report any translation bugs to <https://translationproject.org/team/>

COPYRIGHT
Copyright © 2023 Free Software Foundation, Inc. License GPLv3+:
GNU GPL version 3 or later
<https://gnu.org/licenses/gpl.html>.
This is free software: you are free to change and redistribute it. There
is NO WARRANTY, to the extent per‐
mitted by law.

SEE ALSO
rename(2)

Full documentation <https://www.gnu.org/software/coreutils/mv>


or available locally via: info '(coreutils) mv invocation'

GNU coreutils 9.4 April 2024


MV(1)
moonylead@moonylead-hp:~/Kozul$ chmod u+rw apr2/X2
moonylead@moonylead-hp:~/Kozul$ ls -la apr2/X2
-rw-rw-r-- 1 moonylead moonylead 19050 Mar 8 14:25 apr2/X2
moonylead@moonylead-hp:~/Kozul$

You might also like