interm, fs: fix new added pages
git-svn-id: svn+ssh://atelier.inf.usi.ch/home/bevilj/group-1@279 a672b425-5310-4d7a-af5c-997e18724b81
This commit is contained in:
parent
7b58800bf5
commit
e3fa1d2eba
8 changed files with 180 additions and 145 deletions
docs/website_as_latex
site/pages
|
@ -1,4 +1,4 @@
|
|||
% File autogenerated using the Bonus 2 program at 2018-11-19 12:39
|
||||
% File autogenerated using the Bonus 2 program at 2018-11-19 04:03
|
||||
\documentclass[hidelinks,12pt,a4paper,numbers=enddot]{scrartcl}
|
||||
|
||||
\usepackage[margin=2cm]{geometry}
|
||||
|
@ -1331,6 +1331,18 @@ Here are some of the most common basename flags:
|
|||
\item \textbf{-a}: Supports multiple arguments and they will be treated as a name
|
||||
\end{itemize}
|
||||
|
||||
Example
|
||||
|
||||
\begin{verbatim}
|
||||
basename /USI/command
|
||||
\end{verbatim}
|
||||
|
||||
The shell will output this:
|
||||
|
||||
\begin{verbatim}
|
||||
command
|
||||
\end{verbatim}
|
||||
|
||||
\section{base64}
|
||||
|
||||
|
||||
|
@ -1890,7 +1902,7 @@ If this is not indicated, the command will run the last stopped operation.\\
|
|||
|
||||
Stop a working job
|
||||
|
||||
To stop the execution of a command so that i can be later resumed with \texttt{fg}
|
||||
To stop the execution of a command so that it can be later resumed with \texttt{fg}
|
||||
you need to press the \texttt{ctrl + Z} keys. The job number to be used with the
|
||||
\texttt{fg} command will be printed.
|
||||
|
||||
|
@ -3548,6 +3560,55 @@ mkdir -m 777 test_free_directory
|
|||
|
||||
Our new directory will now have read,write and execute permissions for user, group and others.
|
||||
|
||||
\section{cp}
|
||||
|
||||
|
||||
\large Mattia Hijman \normalsize\\
|
||||
|
||||
|
||||
|
||||
The \texttt{cp} command copies the contents of one or more files or directories to a
|
||||
target file or directory.\\
|
||||
|
||||
\begin{verbatim}
|
||||
cp [source1] [source2] [source3] ... [target]
|
||||
\end{verbatim}
|
||||
|
||||
|
||||
Flags
|
||||
|
||||
\begin{itemize}
|
||||
\item \textbf{-a}: Same as -pPR options. Preserves structure and attributes of files
|
||||
but not directory structure.
|
||||
|
||||
\item \textbf{-f}: If the destination file cannot be opened, remove it and create a new file,
|
||||
without prompting for confirmation regardless of its permissions.
|
||||
The target file is not unlinked before the copy,
|
||||
so any existing access rights will be retained.
|
||||
|
||||
\item \textbf{-H}: If -R is specified, symbolic links on the command line are followed.
|
||||
\item \textbf{-i}: Cause cp to write a prompt to the standard error output before
|
||||
copying a file that would overwrite an existing file. If the
|
||||
response from the standard input begins with the character \emph{y} or
|
||||
\emph{Y}, the file copy is attempted.
|
||||
|
||||
\item \textbf{-L}: If the -R option is specified, all symbolic links are followed.
|
||||
\item \textbf{-n}: Do not overwrite an existing file.
|
||||
\item \textbf{-P}: If the -R option is specified, no symbolic links are followed.
|
||||
\item \textbf{-p}: Cause cp to preserve the following attributes of each source file
|
||||
in the copy.
|
||||
|
||||
\item \textbf{-R}: If source\_file designates a directory, cp copies the directory and
|
||||
the entire subtree connected at that point. If the source\_file
|
||||
ends in a /, the contents of the directory are copied rather than
|
||||
the directory itself. This option also causes symbolic links to be
|
||||
copied, rather than indirected through, and for cp to create special files
|
||||
rather than copying them as normal files.
|
||||
|
||||
\item \textbf{-v}: Cause cp to be verbose, showing files as they are copied.
|
||||
\item \textbf{-X}: Do not copy Extended Attributes (EAs) or resource forks.
|
||||
\end{itemize}
|
||||
|
||||
\section{Absolute paths}
|
||||
|
||||
|
||||
|
@ -3584,6 +3645,44 @@ Here are some other examples of absolute paths:
|
|||
\item /var/log/messages
|
||||
\end{itemize}
|
||||
|
||||
\section{touch}
|
||||
|
||||
|
||||
\large Mattia Hijman \normalsize\\
|
||||
|
||||
|
||||
|
||||
The \texttt{touch} command updates the modification and access time of the a file.
|
||||
If the given file does not exists, it gets created.\\
|
||||
|
||||
\begin{verbatim}
|
||||
touch [flags] [file1] [file2] ...
|
||||
\end{verbatim}
|
||||
|
||||
Flags
|
||||
|
||||
\begin{itemize}
|
||||
\item \textbf{-A}: adjust the access and modification timestamps for the file by the
|
||||
specified value.
|
||||
|
||||
\item \textbf{-a}: Change the access time of the file. The modification time of the
|
||||
file is not changed unless the -m flag is also specified.
|
||||
|
||||
\item \textbf{-c}: Do not create the file if it does not exist.
|
||||
\item \textbf{-f} Attempt to force the update, even if the file permissions do not
|
||||
currently permit it.
|
||||
|
||||
\item \textbf{-h}: If the file is a symbolic link, change the times of the link
|
||||
itself rather than the file that the link points to.
|
||||
|
||||
\item \textbf{-m}: Change the modification time of the file. The access time of the
|
||||
file is not changed unless the -a flag is also specified.
|
||||
|
||||
\item \textbf{-t}: Change the access and modification times to the specified time
|
||||
instead of the current time of day.
|
||||
|
||||
\end{itemize}
|
||||
|
||||
\section{cd}
|
||||
|
||||
|
|
@ -19,7 +19,7 @@ basename [flags] [string] [suffix]
|
|||
</pre>
|
||||
|
||||
Where [flags] are the cat flags, read below for more info, the string command is
|
||||
the pathname and the suffix, if indicated, will be also deleted.<br>
|
||||
the pathname and the suffix, if indicated, will be also deleted.<br><br>
|
||||
|
||||
<h3>Flags</h3>
|
||||
|
||||
|
@ -39,4 +39,6 @@ basename /USI/command
|
|||
|
||||
The shell will output this:
|
||||
|
||||
<pre>command</pre>
|
||||
<pre>
|
||||
command
|
||||
</pre>
|
||||
|
|
|
@ -6,7 +6,7 @@ tags: change directory
|
|||
author: Alessandro Marinelli
|
||||
title: cd
|
||||
previous-page: pages/fs/absolute.html
|
||||
next-page: pages/fs/du.html
|
||||
next-page: pages/fs/cp.html
|
||||
---
|
||||
|
||||
<!-- Co-authored with Mirko Ponzio -->
|
||||
|
|
|
@ -5,108 +5,48 @@ category-title: FileSystem
|
|||
tags: directory list copy cp
|
||||
author: Mattia Hijman
|
||||
title: cp
|
||||
previous-page: pages/fs/touch.html
|
||||
previous-page: pages/fs/cd.html
|
||||
previous-next: pages/fs/du.html
|
||||
---
|
||||
|
||||
In the first synopsis form, the cp utility copies the contents of the source_file to the target_file. <br>
|
||||
In the second synopsis form, the contents of each named source_file is copied to the destination
|
||||
target_directory. <br>
|
||||
The names of the files themselves are not changed. If cp detects an attempt to copy a file to itself, the copy will fail. <br>
|
||||
The <code>cp</code> command copies the contents of one or more files or directories to a
|
||||
target file or directory.<br>
|
||||
|
||||
<pre>
|
||||
cp [source1] [source2] [source3] ... [target]
|
||||
</pre>
|
||||
|
||||
|
||||
<h3>Flags</h3>
|
||||
|
||||
The following options are available:<br>
|
||||
<ul>
|
||||
|
||||
<li> <b>-a</b>
|
||||
|
||||
Same as -pPR options. Preserves structure and attributes of files
|
||||
but not directory structure.</li>
|
||||
|
||||
<li> <b>-f</b>
|
||||
|
||||
If the destination file cannot be opened, remove it and create a new file, without prompting for confirmation regardless of its permissions. (The -f option overrides any previous -n option.)
|
||||
|
||||
The target file is not unlinked before the copy. Thus, any existing access rights will be retained.</li>
|
||||
|
||||
<li> <b>-H</b>
|
||||
|
||||
If the -R option is specified, symbolic links on the command line are followed. </li>
|
||||
|
||||
<li> <b>-i</b> Cause cp to write a prompt to the standard error output before
|
||||
copying a file that would overwrite an existing file. If the
|
||||
response from the standard input begins with the character `y' or
|
||||
`Y', the file copy is attempted.</li>
|
||||
|
||||
<li> <b>-L</b> If the -R option is specified, all symbolic links are followed.</li>
|
||||
|
||||
<li> <b>-n</b> Do not overwrite an existing file. </li>
|
||||
<li> <b>-P </b> If the -R option is specified, no symbolic links are followed.
|
||||
This is the default.</li>
|
||||
|
||||
<li> <b>-p</b> Cause cp to preserve the following attributes of each source file
|
||||
in the copy: modification time, access time, file flags, file mode,
|
||||
user ID, and group ID, as allowed by permissions. Access Control
|
||||
Lists (ACLs) and Extended Attributes (EAs), including resource
|
||||
forks, will also be preserved.
|
||||
|
||||
If the user ID and group ID cannot be preserved, no error message
|
||||
is displayed and the exit value is not altered.
|
||||
|
||||
If the source file has its set-user-ID bit on and the user ID can-
|
||||
not be preserved, the set-user-ID bit is not preserved in the
|
||||
copy's permissions. If the source file has its set-group-ID bit on
|
||||
and the group ID cannot be preserved, the set-group-ID bit is not
|
||||
preserved in the copy's permissions. If the source file has both
|
||||
its set-user-ID and set-group-ID bits on, and either the user ID or
|
||||
group ID cannot be preserved, neither the set-user-ID nor set group-ID bits are preserved in the copy's permissions.</li>
|
||||
|
||||
<li> <b>-R</b> If source_file designates a directory, cp copies the directory and
|
||||
the entire subtree connected at that point. If the source_file
|
||||
ends in a /, the contents of the directory are copied rather than
|
||||
the directory itself. This option also causes symbolic links to be
|
||||
copied, rather than indirected through, and for cp to create spe-
|
||||
cial files rather than copying them as normal files. Created
|
||||
directories have the same mode as the corresponding source direc-
|
||||
tory, unmodified by the process' umask.
|
||||
|
||||
In -R mode, cp will continue copying even if errors are detected.
|
||||
|
||||
Note that cp copies hard-linked files as separate files. If you
|
||||
need to preserve hard links, consider using tar(1), cpio(1), or
|
||||
pax(1) instead.</li>
|
||||
|
||||
<li> <b>-v</b> Cause cp to be verbose, showing files as they are copied.</li>
|
||||
|
||||
<li> <b>-X</b> Do not copy Extended Attributes (EAs) or resource forks.</li>
|
||||
|
||||
<li> <b>-c</b> copy files using clonefile(2)</li>
|
||||
</ul>
|
||||
|
||||
For each destination file that already exists, its contents are overwrit-
|
||||
ten if permissions allow. Its mode, user ID, and group ID are unchanged
|
||||
unless the -p option was specified.
|
||||
|
||||
In the second synopsis form, target_directory must exist unless there is
|
||||
only one named source_file which is a directory and the -R flag is speci-
|
||||
fied.
|
||||
|
||||
If the destination file does not exist, the mode of the source file is
|
||||
used as modified by the file mode creation mask (umask, see csh(1)). If
|
||||
the source file has its set-user-ID bit on, that bit is removed unless
|
||||
both the source file and the destination file are owned by the same user.
|
||||
If the source file has its set-group-ID bit on, that bit is removed
|
||||
unless both the source file and the destination file are in the same
|
||||
group and the user is a member of that group. If both the set-user-ID
|
||||
and set-group-ID bits are set, all of the above conditions must be ful-
|
||||
filled or both bits are removed.
|
||||
|
||||
Appropriate permissions are required for file creation or overwriting.
|
||||
|
||||
Symbolic links are always followed unless the -R flag is set, in which
|
||||
case symbolic links are not followed, by default. The -H or -L flags (in
|
||||
conjunction with the -R flag) cause symbolic links to be followed as described above. The -H, -L and -P options are ignored unless the -R
|
||||
option is specified. In addition, these options override each other and
|
||||
the command's actions are determined by the last one specified.
|
||||
|
||||
If cp receives a SIGINFO (see the status argument for stty(1)) signal,
|
||||
the current input and output file and the percentage complete will be
|
||||
written to the standard output.
|
||||
<li><b>-a</b>: Same as -pPR options. Preserves structure and attributes of files
|
||||
but not directory structure.
|
||||
</li>
|
||||
<li><b>-f</b>: If the destination file cannot be opened, remove it and create a new file,
|
||||
without prompting for confirmation regardless of its permissions.
|
||||
The target file is not unlinked before the copy,
|
||||
so any existing access rights will be retained.
|
||||
</li>
|
||||
<li><b>-H</b>: If -R is specified, symbolic links on the command line are followed.</li>
|
||||
<li><b>-i</b>: Cause cp to write a prompt to the standard error output before
|
||||
copying a file that would overwrite an existing file. If the
|
||||
response from the standard input begins with the character <i>y</i> or
|
||||
<i>Y</i>, the file copy is attempted.
|
||||
</li>
|
||||
<li><b>-L</b>: If the -R option is specified, all symbolic links are followed.</li>
|
||||
<li><b>-n</b>: Do not overwrite an existing file.</li>
|
||||
<li><b>-P</b>: If the -R option is specified, no symbolic links are followed.</li>
|
||||
<li><b>-p</b>: Cause cp to preserve the following attributes of each source file
|
||||
in the copy.
|
||||
</li>
|
||||
<li><b>-R</b>: If source_file designates a directory, cp copies the directory and
|
||||
the entire subtree connected at that point. If the source_file
|
||||
ends in a /, the contents of the directory are copied rather than
|
||||
the directory itself. This option also causes symbolic links to be
|
||||
copied, rather than indirected through, and for cp to create special files
|
||||
rather than copying them as normal files.
|
||||
</li>
|
||||
<li><b>-v</b>: Cause cp to be verbose, showing files as they are copied.</li>
|
||||
<li><b>-X</b>: Do not copy Extended Attributes (EAs) or resource forks.</li>
|
||||
</ul>
|
||||
|
|
|
@ -5,7 +5,7 @@ category-title: FileSystem
|
|||
tags: disk usage file size
|
||||
author: Joey Bevilacqua
|
||||
title: du
|
||||
previous-page: pages/fs/cd.html
|
||||
previous-page: pages/fs/cp.html
|
||||
next-page: pages/fs/ln.html
|
||||
---
|
||||
|
||||
|
|
|
@ -11,8 +11,10 @@ next-page: pages/fs/pwd.html
|
|||
|
||||
<!-- Co-authored with Joy Albertini -->
|
||||
|
||||
The <code>mv</code> command is used to move a file and directories from a given path to another.
|
||||
If both files are in the same filesystem it will result as a renaming of the file<br>
|
||||
The <code>mv</code> command is used to move a file from a given path to another.
|
||||
It can also be used to rename a file by moving it into the same directory,
|
||||
but with a different name.<br>
|
||||
It stands for <i>MoVe</i>.
|
||||
|
||||
<pre>
|
||||
mv [-finv] source target
|
||||
|
|
|
@ -6,11 +6,13 @@ tags: directory list remove delete erase
|
|||
author: Mattia Hijman
|
||||
title: rm
|
||||
previous-page: pages/fs/relative.html
|
||||
next-page: pages/fs/touch.html
|
||||
---
|
||||
|
||||
The <code>rm</code> command is used to delete and unlink directories and files.<br>
|
||||
It attempts to remove the non-directory type files specified on the command line.
|
||||
If the permissions of the file do not permit writing, the user is prompted for confirmation.<br>
|
||||
It stands for <i>ReMove</i>.
|
||||
|
||||
<pre>
|
||||
rm [-dfiPRrvW] file1 file2 file....
|
||||
|
|
|
@ -2,49 +2,39 @@
|
|||
layout: page
|
||||
category-page: fs
|
||||
category-title: FileSystem
|
||||
tags: directory list create new file
|
||||
tags: directory list create new file
|
||||
author: Mattia Hijman
|
||||
title: touch
|
||||
previous-page: pages/fs/rm.html
|
||||
---
|
||||
|
||||
The <code>touch</code> command updates the modification and access time of the a file.
|
||||
If the given file does not exists, it gets created.<br>
|
||||
|
||||
<pre>
|
||||
touch [-A [-][[hh]mm]SS] [-acfhm] [-r file] [-t [[CC]YY]MMDDhhmm[.SS]]
|
||||
file ...
|
||||
touch [flags] [file1] [file2] ...
|
||||
</pre>
|
||||
|
||||
<h3>Flags</h3>
|
||||
|
||||
The touch utility sets the modification and access times of files. If any file does not exist, it is created with default permissions.<br>
|
||||
By default, touch changes both modification and access times. The -a and -m flags may be used to select the access time or the modification time individually. Selecting both is equivalent to the default. By default, the timestamps are set to the current time. The -t flag explicitly specifies a different time, and the -r flag specifies to set the times those of the specified file.
|
||||
The -A flag adjusts the values by a specified amount.<br>
|
||||
The following options are available:<br>
|
||||
<ul>
|
||||
<li> <b>-A</b>
|
||||
|
||||
Adjust the access and modification time stamps for the file by the specified value. This flag is intended for use in modifying files with incorrectly set time stamps.
|
||||
|
||||
The -A flag implies the -c flag: if any file specified does not
|
||||
exist, it will be silently ignored.</li>
|
||||
|
||||
<li> <b>-a</b> Change the access time of the file. The modification time of the
|
||||
file is not changed unless the -m flag is also specified.</li>
|
||||
|
||||
<li> <b>-c</b> Do not create the file if it does not exist. The touch utility
|
||||
does not treat this as an error. No error messages are displayed
|
||||
and the exit value is not affected.</li>
|
||||
|
||||
<li> <b>-f</b> Attempt to force the update, even if the file permissions do not
|
||||
currently permit it.</li>
|
||||
|
||||
<li> <b>-h</b> If the file is a symbolic link, change the times of the link
|
||||
itself rather than the file that the link points to. Note that
|
||||
-h implies -c and thus will not create any new files.</li>
|
||||
|
||||
<li> <b>-m</b> Change the modification time of the file. The access time of the
|
||||
file is not changed unless the -a flag is also specified.</li>
|
||||
|
||||
<li> <b>-r</b> Use the access and modifications times from the specified file
|
||||
instead of the current time of day.</li>
|
||||
|
||||
<li> <b>-t</b> Change the access and modification times to the specified time
|
||||
instead of the current time of day.</li>
|
||||
<li><b>-A</b>: adjust the access and modification timestamps for the file by the
|
||||
specified value.
|
||||
</li>
|
||||
<li><b>-a</b>: Change the access time of the file. The modification time of the
|
||||
file is not changed unless the -m flag is also specified.
|
||||
</li>
|
||||
<li><b>-c</b>: Do not create the file if it does not exist.</li>
|
||||
<li><b>-f</b> Attempt to force the update, even if the file permissions do not
|
||||
currently permit it.
|
||||
</li>
|
||||
<li><b>-h</b>: If the file is a symbolic link, change the times of the link
|
||||
itself rather than the file that the link points to.
|
||||
</li>
|
||||
<li><b>-m</b>: Change the modification time of the file. The access time of the
|
||||
file is not changed unless the -a flag is also specified.
|
||||
</li>
|
||||
<li><b>-t</b>: Change the access and modification times to the specified time
|
||||
instead of the current time of day.
|
||||
</li>
|
||||
</ul>
|
||||
|
|
Loading…
Reference in a new issue