interm: add missing pages from @tomazj
git-svn-id: svn+ssh://atelier.inf.usi.ch/home/bevilj/group-1@292 a672b425-5310-4d7a-af5c-997e18724b81
This commit is contained in:
parent
f5f18c2e13
commit
623b7a667f
7 changed files with 158 additions and 3 deletions
site/pages
|
@ -6,7 +6,7 @@ author: Joy Albertini
|
|||
tags: directory user shell
|
||||
title: chsh
|
||||
previous-page: pages/cmd/interm/chroot.html
|
||||
next-page: pages/cmd/interm/curl.html
|
||||
next-page: pages/cmd/interm/cowsay.html
|
||||
---
|
||||
|
||||
The <code>chsh</code> command can be used to change the following user's login shell properties:
|
||||
|
|
47
site/pages/cmd/interm/cowsay.html
Normal file
47
site/pages/cmd/interm/cowsay.html
Normal file
|
@ -0,0 +1,47 @@
|
|||
---
|
||||
layout: page
|
||||
category-page: intermediate
|
||||
category-title: Intermediate commands
|
||||
tags: cow print say dragon lolcat
|
||||
author: Joao Tomazoni
|
||||
title: cowsay
|
||||
previous-page: pages/cmd/interm/chsh.html
|
||||
next-page: pages/cmd/interm/curl.html
|
||||
---
|
||||
|
||||
<code>cowsay</code> is a entertainment command, however it's not guaranteed that your terminal is
|
||||
going to have this command available as default. It most likely won't, however you can download
|
||||
it yourself using a package manager like <a href="https://brew.sh">brew.sh</a>.<br>
|
||||
|
||||
<pre>
|
||||
cowsay "Hello there"
|
||||
</pre>
|
||||
|
||||
Very useful wouldn't you agree?
|
||||
You can also pipe commands like ls with cowsay, for example:
|
||||
|
||||
<pre>
|
||||
ls | cowsay
|
||||
</pre>
|
||||
|
||||
It returns the cow saying the list of files in the current directory.<br><br>
|
||||
|
||||
<h3>Flags</h3>
|
||||
|
||||
<b>-f</b> if you aren't satisfied with the cow, you have other possibilities of
|
||||
animals instead of cow. One example is the dragon which you can get by using "-f dragon",
|
||||
it will now draw a fantasy-like dragon.
|
||||
|
||||
<pre>
|
||||
cowsay -f dragon "Burn World"
|
||||
</pre>
|
||||
|
||||
There are more animal drawings for the cowsay command, just type cowsay -l in your terminal for
|
||||
the list of the animals you can use.<br><br>
|
||||
|
||||
<h3>Suggestion: combine with <code>lolcat</code></h3>
|
||||
|
||||
<code>lolcat</code> is another entertainment command that is also installed with the brew pack you
|
||||
installed previously for the <code>cowsay</code> command, and they work perfectly together.
|
||||
Adding lolcat at the end of the cowsay command and its quote will add random colours for the
|
||||
drawing.
|
|
@ -5,7 +5,7 @@ category-title: Intermediate commands
|
|||
tags: curl download http client crawler request online
|
||||
author: Claudio Maggioni
|
||||
title: curl
|
||||
previous-page: pages/cmd/interm/chsh.html
|
||||
previous-page: pages/cmd/interm/cowsay.html
|
||||
next-page: pages/cmd/interm/fg.html
|
||||
---
|
||||
The <code>curl</code> command is a fast and versatile shell program that can
|
||||
|
|
58
site/pages/cmd/interm/sudo.html
Normal file
58
site/pages/cmd/interm/sudo.html
Normal file
|
@ -0,0 +1,58 @@
|
|||
---
|
||||
layout: page
|
||||
category-page: intermediate
|
||||
category-title: Intermediate commands
|
||||
tags: super user admin execute root
|
||||
author: Joao Tomazoni
|
||||
title: sudo
|
||||
previous-page: pages/cmd/interm/strings.html
|
||||
next-page: pages/cmd/interm/sync.html
|
||||
---
|
||||
|
||||
<code>sudo</code> stands for <i>Substitute User DO</i> or <i>SuperUser DO</i>.<br>
|
||||
It's a powerful command that you must handle with great care.
|
||||
If you are a member of the proper group and have permission to do sudo
|
||||
commands than you can execute commands as if you were the root user.
|
||||
|
||||
Say you're an administrator in the users folder, and you would like to see a subfolder
|
||||
inside the home folder from another user named Nate, you may attempt to use the command:
|
||||
<code>ls -lr Nate</code>, but you will come by a whole bunch of permissions denied messages,
|
||||
this happens because even-though you're an administrator, you don't
|
||||
have the rights or permissions to get inside of Nate's home folder and look
|
||||
inside those subfolders.
|
||||
That's where the sudo command comes in:
|
||||
|
||||
<pre>
|
||||
ls -lr Nate
|
||||
</pre>
|
||||
|
||||
Returns denied access messages. To fix this, proceed to add sudo before the
|
||||
previously inserted command:
|
||||
|
||||
<pre>
|
||||
sudo ls -lr Nate
|
||||
Password: (type the local administrator password)
|
||||
</pre>
|
||||
|
||||
Now, Instead of the denied messages now you actually get a listing of all those subfolders
|
||||
in Nate's home folder. So you can execute commands temporarily as if you were the root user,
|
||||
which can do absolutely anything on the system. It's is very powerful to troubleshooting
|
||||
or fixing problems.<br><br>
|
||||
|
||||
<h3>Flags</h3>
|
||||
|
||||
<b>-s</b>: If you're going to execute a lot of commands with sudo, you can go inside
|
||||
the root shell using the flag <code>-s</code>,
|
||||
so that you won't need to keep typing sudo over and over again.
|
||||
By typing whoami command after typing <code>sudo -s</code> should return you "root".
|
||||
This is what it look likes:</p>
|
||||
|
||||
<pre>
|
||||
sudo -s
|
||||
Password: (type the local administrator password)
|
||||
whoami
|
||||
root
|
||||
</pre>
|
||||
|
||||
Remember, with great power comes great responsibility, be careful with sudo commands.<br>
|
||||
<img src="https://imgs.xkcd.com/comics/sandwich.png" alt="xkcd 146">
|
|
@ -5,7 +5,7 @@ category-title: Intermediate commands
|
|||
tags: sync disk write completion
|
||||
author: Gianmarco De Vita
|
||||
title: sync
|
||||
previous-page: pages/cmd/interm/strings.html
|
||||
previous-page: pages/cmd/interm/sudo.html
|
||||
next-page: pages/cmd/interm/tar.html
|
||||
---
|
||||
<p>
|
||||
|
|
|
@ -6,6 +6,7 @@ tags: directory list create new file
|
|||
author: Mattia Hijman
|
||||
title: touch
|
||||
previous-page: pages/fs/rm.html
|
||||
next-page: pages/fs/zip.html
|
||||
---
|
||||
|
||||
The <code>touch</code> command updates the modification and access time of the a file.
|
||||
|
|
49
site/pages/fs/zip.html
Normal file
49
site/pages/fs/zip.html
Normal file
|
@ -0,0 +1,49 @@
|
|||
---
|
||||
layout: page
|
||||
category-page: fs
|
||||
category-title: FileSystem
|
||||
tags: compress file directory extract
|
||||
author: Joao Tomazoni
|
||||
title: zip
|
||||
previous-page: pages/fs/rm.html
|
||||
---
|
||||
|
||||
<code>zip</code> is the command to package and compress files together as .zip extension.
|
||||
Simply type zip + name of the zip file + name of the files to be compressed as .zip.
|
||||
|
||||
<pre>
|
||||
zip -r [target.zip] [source1] [source2]
|
||||
</pre>
|
||||
|
||||
Say you want to compress a file named test.txt and an image named image.png together
|
||||
in one zip file named test.zip. This is what it should look like:
|
||||
|
||||
<pre>
|
||||
zip -r test.zip text.txt image.png
|
||||
</pre>
|
||||
|
||||
In this case it should return a test.zip file in your desktop with a directory inside
|
||||
containing the two files together.<br><br>
|
||||
|
||||
<h3>Flags</h3>
|
||||
|
||||
<ul>
|
||||
<li><b>-e</b>: create zip files that require a password in order to be uncompressed.
|
||||
<pre>
|
||||
zip -e test.zip text.txt image.png
|
||||
Enter password: (password required to unzip the file)
|
||||
</pre>
|
||||
</li>
|
||||
<li><b>-u</b>: update zip files and add new files inside the current zip file.
|
||||
<pre>
|
||||
zip -u test.zip newtext.txt
|
||||
</pre>
|
||||
The newtext.txt file will be added to the current test.zip file.
|
||||
</li>
|
||||
<li><b>-d</b>: remove files inside the current zip file.
|
||||
<pre>
|
||||
zip -d test.zip newtext.txt
|
||||
</pre>
|
||||
The newtext.txt file will be removed from the current test.zip file.
|
||||
</li>
|
||||
</ul>
|
Loading…
Reference in a new issue