Team intermediate/basic add command ping chown mv pwd
git-svn-id: svn+ssh://atelier.inf.usi.ch/home/bevilj/group-1@226 a672b425-5310-4d7a-af5c-997e18724b81
This commit is contained in:
parent
07c41e6c5c
commit
c922a0d8d8
4 changed files with 158 additions and 0 deletions
site/pages/cmd
33
site/pages/cmd/basic/chown.html
Normal file
33
site/pages/cmd/basic/chown.html
Normal file
|
@ -0,0 +1,33 @@
|
|||
|
||||
---
|
||||
layout: page
|
||||
category-page: basic
|
||||
category-title: Basic commands
|
||||
author: Joy Albertini
|
||||
tags:directory file chown symbolic link
|
||||
title: chown
|
||||
---
|
||||
|
||||
<p>The <code>chown</code>
|
||||
If you want to change the user ID of a specific file, you can use chown. <br>
|
||||
Device-name:Current-position username$ chown owner[:group] file <br>
|
||||
Example chown Joy:student alice.txt add Joy to the group student <br>
|
||||
Use chgrp [:group] file to create a group for a file <br>
|
||||
Use Sudo chown owner[:group], if you need root permission for add the user to the group </p>
|
||||
|
||||
<pre>
|
||||
chown Joy [students] file
|
||||
</pre>
|
||||
|
||||
<ul>
|
||||
<li><code>-f</code> Don't show all error messages except usage messages.</li>
|
||||
<li><code>-h</code> Changes the symbolic link and not the file or directory referred by the symbolic link.</li>
|
||||
<li><code>-R</code> changing the ownership for each file in a folder, if encounter symbolic link it will cheange the owenership of that symbolic link,
|
||||
and the directoryfile referred in the symbolic link, but the directory is not further transversed. </li>
|
||||
<li><code>-RH</code> changing the ownership for each file in a folder, if encounter symbolic link it will cheange the owenership of that symbolic link,
|
||||
the directory/file referred in the symbolic link, and all the directory is further transversed.</li>
|
||||
<li><code>-RL</code> <!-- don't understand the diffrence between -RH --> If the -R option is specified and a symbolic link referencing a file of type directory
|
||||
is specified on the command line or encountered during the traversal of a file hierarchy, the chown command shall change the user ID (and group ID, if specified) of the directory referenced by the symbolic link and all files in the file hierarchy below it.</li>
|
||||
<li><code>-RP</code> changing the ownership for each file in a folder, if encounter symbolic link it will cheange the owenership of that symbolic link, but will not chenage the
|
||||
the directory/file referred in the symbolic link, and the directory is not further transversed.</li>
|
||||
</ul>
|
31
site/pages/cmd/basic/mv.html
Normal file
31
site/pages/cmd/basic/mv.html
Normal file
|
@ -0,0 +1,31 @@
|
|||
|
||||
|
||||
---
|
||||
layout: page
|
||||
category-page: basic
|
||||
category-title: Basic commands
|
||||
author: Joy Albertini
|
||||
tags: directory path mv file
|
||||
title: mv
|
||||
---
|
||||
|
||||
<p>The <code>mv</code> move a file from a directory to another:
|
||||
Device-name:Current-position username$ mv path/name-file path2
|
||||
You can verify the success of the operation by using the command ls with argument the path. <br>
|
||||
With mv you can rename a file: Device-name:Current-position username$ mv path/name-file mv path/newname-file
|
||||
</p>
|
||||
|
||||
<pre>
|
||||
mv /home/user/desktop/file.txt /home/user/desktop/subfolder1/
|
||||
</pre>
|
||||
|
||||
<ul>
|
||||
<li><code>-i</code> Prompt(request confirm) before overwriting the file (Overrides previous -f or -n options, and override file permission) <br>
|
||||
Example: mv -i name1.txt name2.txt, shell will ask overwrite 'name2.txt'? respond with Y(yes) or N(no)</li>
|
||||
<li><code>-n</code> Don't permit to overwrite existing file <br>
|
||||
Example: desktop as working directory there is a file called name2.txt, mv -n name5.txt name2.tx, with the flag -n you can't overwrite the file. </li>
|
||||
<li><code>-v</code> (verbose) will output information explaining what it's doing <br>
|
||||
Example: mv-v name1.txt name2.txt, the shell will output the operation: 'name1.txt' -to 'name2.txt'. </li>
|
||||
<li><code>-f</code> (Force) force overwriting without prompting (overrides previous -i or -n options).<br>
|
||||
Example: desktop as working directory there is a file called name2.txt, mv-f name1.txt name2.txt will overwrite the file without prompting</li>
|
||||
</ul>
|
24
site/pages/cmd/basic/pwd.html
Normal file
24
site/pages/cmd/basic/pwd.html
Normal file
|
@ -0,0 +1,24 @@
|
|||
---
|
||||
layout: page
|
||||
category-page: basic
|
||||
category-title: Basic commands
|
||||
author: Joy Albertini
|
||||
tags: directory current path pwd
|
||||
title: pdw
|
||||
---
|
||||
|
||||
<p>The <code>pwd</code> command (path of working directory) <br>
|
||||
The absolute pathname of the current working directory is given as result.</p>
|
||||
|
||||
<pre>
|
||||
cd /home/user
|
||||
pwd = /home/user
|
||||
</pre>
|
||||
|
||||
<ul>
|
||||
<li><code>-P </code> Show the working directory path without symbolic link (links to folder) <br>
|
||||
Example: <code>PWD</code> /home/symphoto, symphotos is a symlink to /home/photos <code>PDW-P</code> will show /home/photos</li>
|
||||
<li><code>-L </code> Show the working directory logical path with symbolic link. <br>
|
||||
Example: There is a symbolic link /home/symphoto, that redirect to /home/photo, <code>PWD -L</code> will show /home/symphoto</li>
|
||||
<li> Without flag, the -L is assumed, so the normal PWD is in reality PDW-L</li>
|
||||
</ul>
|
70
site/pages/cmd/interm/ping.html
Normal file
70
site/pages/cmd/interm/ping.html
Normal file
|
@ -0,0 +1,70 @@
|
|||
---
|
||||
layout: page
|
||||
category-page: intermediate
|
||||
category-title: intermediate commands
|
||||
author: Joy Albertini
|
||||
tags: server ping latency UNIX
|
||||
title: ping
|
||||
---
|
||||
<p>The <code>ping</code> command , is used to test connection between a local server/computer to a remote UNIX server.
|
||||
The ping command sends ICMP Echo Request packets to the remote server for accessing it.
|
||||
Each packet echoed back (via an ICMP Echo Response packet) is written to the shell output.<br></p>
|
||||
Usage:
|
||||
<ul>
|
||||
<li> test remote server if working. </li>
|
||||
<li> test network connectivity from your local machine to server </li>
|
||||
<li> general network problems </li>
|
||||
<ul>
|
||||
<br>
|
||||
|
||||
<p>
|
||||
Example; Device-name:Current-position username$ ping IP address; ping 192.168.3.2 <br>
|
||||
Device-name:Current-position username$ ping Server_name; ping yahoo.com <br>
|
||||
The shell will output something like this: 64 bytes from 98.138.219.232: icmp_seq=0 ttl=49 time=144.781 ms for each packets that return (echoed back).
|
||||
Important to stop the ping command press control + c. </p>
|
||||
|
||||
<pre>
|
||||
ping 192.168.3.2
|
||||
</pre>
|
||||
|
||||
<ul>
|
||||
<li><code>-c</code> send limited number of packets with ping -c (nr of packets) <br>
|
||||
Example: ping -c 4 yahoo.com, the shell will display the first 4 packets returned, and then stop.</li>
|
||||
<li><code>-n</code> avoid dns lookup, avoid to lookup symbolic names for host addresses, so only numeric output <br>
|
||||
Example: ping -n yahoo.com </li>
|
||||
<li><code>-a</code> get an audio warning, when the remote server comes online <br>
|
||||
Example: ping -a yahoo.com, server comes online audio signal for every packets that returns</li>
|
||||
<li><code>-b</code> Allow pinging a broadcast address (broadcast network, is a network with many devices on it).<br></li>
|
||||
<li><code>-m</code> (mark) tag the packets going out </li>
|
||||
<li><code>-f</code> (Flood ping) For every ECHO_REQUEST sent (.) is printed,
|
||||
for every ECHO_REPLY received, a backspace is printed.
|
||||
With this command you can easily understand how many packets are being dropped.</li>
|
||||
<li><code>-i</code> (interval) set the interval between seending each packet (defaultn 1 second); only super-user can set interval values less than 0.2 seconds <br>
|
||||
Example: ping -i 5 yahoo.com; the pacjets will be send each 5 seconds instead of 1</li>
|
||||
<li><code>-I</code> (interface-address) set souce adress to a specific interface adress, example the name of the device or IP. When pinging local adresses IPV6, is a needed flag
|
||||
<li><code>-l</code> (preload) ping send packets but don't wait for reply.(you need sudo = amministrator persmissions) <br>
|
||||
Example: Sudo ping -l 2 yahoo.com; it will send 2 packtes without waiting for the server reply.</li>
|
||||
<li><code>-L</code> Remove loopback of multicast packets </li>
|
||||
<li><code>-N</code> (Nioption) send ICMpv6 request, instead of Echo requests <ul><li> <code>ipv6</code> request Ipv6 adresses </li>
|
||||
<li> <code>ipv4-all</code> request Ipv4 adresses </li>
|
||||
</ul>
|
||||
</li>
|
||||
<li><code>-p</code> (pattern) specify up to 16 number to fill out the packets you send <br>
|
||||
Example: ping -p ff, al packet will be fill with ones, ff = 255 in hexadicimal, 11111111 in binary. </li>
|
||||
<li><code>-D</code> print timestamp (unix time + microseconds) in each line<br>
|
||||
Example: ping -D yahoo.com; the shell will output 64 bytes from 72.30.35.10: icmp_seq=1 ttl=51 time=137.882 ms. </li>
|
||||
<li><code>-q</code> (Quiet output) Nothing displayed except the summary lines at the start and at the end.
|
||||
Example: ping -q yahoo.com, shell Output initially PING yahoo.com (72.30.35.10): 56 data bytes, and nothig else
|
||||
until you stop the ping command, and the shell will display the stats. </li>
|
||||
<li><code>-R<code> (Record route), displays the route buffer on the packets that include RECORD_ROUTE in the ECHO_REQUEST.</li>
|
||||
<li><code>-r<code> bypass the normal routing in a directly-attached network </li>
|
||||
<li><code>-s<code> (packetsize) Specifies the data bytes to send (default is 56 that + 8 byte of ICMP = 64 ICMP data bytes) <br>
|
||||
Example: ping -s 33 yahoo.com; send packets of 33 + 8 ICMP = 41 bytes to yahoo.com. </li>
|
||||
<li><code>-t<code> set IP time-to-live (set how long execute ping in seconds) <br>
|
||||
Example: ping -t 3: the shell will ping yahoo.com for 3 seconds, and then stops.</li>
|
||||
<li><code>-U<code> print full user-to-user latency (legacy ping behaviour).</li>
|
||||
<li><code>-v<code> output verbose on output </li>
|
||||
<li><code>-V<code> Display verion of command </li>
|
||||
<li><code>-w<code> (deadline) Timeout in seconds of ping command, regardless of how many packets have been sent. </li>
|
||||
<li><code>-W<code> (timeout), time waiting for a response from the server, if the server dosen't reply in the time set, the ping command will stop. </li>
|
||||
</ul>
|
Loading…
Reference in a new issue