Commit 9276bf8d authored by Toby Hodges's avatar Toby Hodges

added hints for file exercises

parent 6e99d75d
......@@ -8,25 +8,25 @@ Exercises
Misc. file tools
----------------
#. Which tool can be used to determine the type of a file?
#. Which tool can be used to determine the type of a file? (Hint: if you don't know about an appropriate command to do this, think about how you might go about finding one...)
#. Use it on the following files/directories and compare the results:
A. ``/usr/bin/tail``
A. ``/usr/bin/tail``
B. ``~``
B. ``~``
C. ``~/exercises/SRC_HUMAN.fasta``
C. ``~/exercises/SRC_HUMAN.fasta`` (or the equivalent path to the ``SRC_HUMAN.fasta`` file in the ``exercises`` folder on your system.)
Copying / Deleting Files & Folders
----------------------------------
#. Navigate to your home directory
#. Navigate to your home directory
#. In your home directory, create a new directory named ``new_dir``
#. In your home directory, create a new directory named ``new_dir``
#. Change into this directory, create a new empty file in there named ``new_file``,
#. Change into this directory, create a new empty file in there named ``new_file``,
and make sure that the file was created.
#. Duplicate this file by copying it as a new file named ``another_file``
......@@ -47,87 +47,87 @@ View Files
Searching
---------
#. Which tool can be used to search for files or directories?
#. Which tool can be used to search for files or directories?
#. Use it to find all directories in the ``~/exercises`` directory
#. Use it to find all directories in the ``~/exercises`` directory
#. Search for the file named ``date`` in the ``/bin`` directory
#. Search for the file named ``date`` in the ``/bin`` directory
#. List those entries in the directory ``/bin`` that are bigger than 400 kBytes
#. List those entries in the directory ``/bin`` that are bigger than 400 kBytes
Misc. terminal
--------------
#. Which two tools can be used to redraw/empty the screen?
#. Which two tools can be used to redraw/empty the screen?
Permissions
-----------
#. Create a directory called ``testpermissions``
#. Create a directory called ``testpermissions``
#. Change your working directory to ``testpermissions``
#. Change your working directory to ``testpermissions``
#. Create a directory called ``adir``.
#. Create a directory called ``adir``.
#. Use the command ``which date`` to find out where the date program is located.
#. Use the command ``which date`` to find out where the date program is located.
#. Copy this date program into the directory ``adir`` and name it 'mydate'.
#. Copy this date program into the directory ``adir`` and name it 'mydate'.
#. Check the permissions of the copied program 'mydate'
#. Check the permissions of the copied program 'mydate'
#. Change the permissions on 'mydate' to remove the executable permissions.
#. Change the permissions on 'mydate' to remove the executable permissions.
#. Check the permissions of the program 'mydate'
#. Check the permissions of the program 'mydate'
#. Change the permissions back so that the file is executable.
#. Change the permissions back so that the file is executable.
#. Try running it as ``./mydate`` or ``adir/mydate`` (depending on your current working directory)
#. Try running it as ``./mydate`` or ``adir/mydate`` (depending on your current working directory)
#. Copy a textfile from a previous exercise into ``adir``, then change the permissions, so you are not allowed to write to it.
Test that you are still able to read the file via `cat`.
#. Copy a textfile from a previous exercise into ``adir``, then change the permissions, so you are not allowed to write to it.
Test that you are still able to read the file via `cat`.
#. Then change the permissions so you can't read/cat it either. Test this by trying to read it via `cat`.
#. Then change the permissions so you can't read/cat it either. Test this by trying to read it via `cat`.
#. Change your working directory to ``testpermissions``, and then try changing the permissions on the directory ``adir`` to non-executable.
#. Change your working directory to ``testpermissions``, and then try changing the permissions on the directory ``adir`` to non-executable.
#. What are the minimum permissions (on the directory) necessary for you to be able to execute ``adir/mydate``?
#. What are the minimum permissions (on the directory) necessary for you to be able to execute ``adir/mydate``?
Remote access
-------------
#. Login to machine "submaster1.embl.de" (using your own username)
#. Login to machine "submaster1.embl.de" (using your own username)
#. Use exit to quit the remote shell (Beware to not exit your local shell)
#. Use exit to quit the remote shell (Beware to not exit your local shell)
#. Use clear to empty the screen after logout from the remote server
#. Use clear to empty the screen after logout from the remote server
#. Use the following commands locally as well as on the remote machine to get a feeling for the different machines:
#. Use the following commands locally as well as on the remote machine to get a feeling for the different machines:
#. Copy the file ``/etc/motd`` from machine submaster1.embl.de into your local home directory (using scp)
#. Copy the file ``/etc/motd`` from machine submaster1.embl.de into your local home directory (using scp)
#. Determine the filetype and the permissions of the file that you just copied
#. Determine the filetype and the permissions of the file that you just copied
#. Login to your neighbor's machine (ask him for the hostname) using your own username
#. Login to your neighbor's machine (ask him for the hostname) using your own username
IO and Redirections
-------------------
#. Use date in conjunction with the redirection to insert the current date into the (new) file current_date (in your homedirectory).
#. Use date in conjunction with the redirection to insert the current date into the (new) file current_date (in your homedirectory).
#. Inspect the file to make sure it contains (only a single line with) the date.
#. Inspect the file to make sure it contains (only a single line with) the date.
#. Use ``date`` again to append the current date into the same file.
#. Use ``date`` again to append the current date into the same file.
#. Again, check that this file now contains two lines with dates.
#. Again, check that this file now contains two lines with dates.
#. Use ``grep`` to filter out lines containing the term "TITLE" from all PDB files in the exercises directory and use redirection to insert them into a new file pdb_titles.txt.
#. Use ``grep`` to filter out lines containing the term "TITLE" from all PDB files in the exercises directory and use redirection to insert them into a new file pdb_titles.txt.
#. (OPTIONAL) Upon inspection of the file pdb_titles.txt, you see that it also contains the names of the files in which the term was found.
#. (OPTIONAL) Upon inspection of the file pdb_titles.txt, you see that it also contains the names of the files in which the term was found.
A. Use either the grep manpage or ``grep --help`` to find out how you can suppress this behaviour.
A. Use either the grep manpage or ``grep --help`` to find out how you can suppress this behaviour.
B. Redo the previous exercise such that the output file pdb_titles.txt only contains lines starting with TITLE.
B. Redo the previous exercise such that the output file pdb_titles.txt only contains lines starting with TITLE.
#. The *third* column of the file /etc/passwd contains user IDs (numbers)
......@@ -159,13 +159,13 @@ You can find the famous BLAST tool installed at `/g/software/bin/blastp`.
#. Typing the full path is too cumbersome, so let's append `/g/software/bin` to your $PATH variable and ensure that it works by calling `blastp`.
#. When you run `blastp -help`, you notice that it has a lot of options!
#. When you run `blastp -help`, you notice that it has a lot of options!
Use redirections in conjunction with grep to find out which options you need to specify a *input_file* and *database_name*.
#. Now run blastp using the following values as options:
#. Now run blastp using the following values as options:
*database_name* = `/g/data/ncbi-blast/db/swissprot`
*database_name* = `/g/data/ncbi-blast/db/swissprot`
*input_file* = `suspect1.fasta`
*input_file* = `suspect1.fasta`
#. Use either ``less`` or redirection to a file to manage the amount of information that ``blastp`` prints on your screen.
......@@ -254,6 +254,11 @@ For the navigation within a manpage and how to exit the manpage, see the :ref:`p
Use ``apropos`` to find candidates for specific tasks.
To perform a more specific search, combine multiple keywords inside quote marks e.g.
::
$ apropos "determine file type"
/usr/share/doc/
---------------
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment