If you can see this check that

next section prev section up prev page next page

Essential Unix


Essential Unix commands

User:
Password:

We explore some of the basic unix commands such as ls, ps, chmod.

Question 1: ls

Enter the number of entries in the top level directory. You can use the command ls / and simply count the words.

If you are too lazy to count you can pass the output through the wc command: ls /|wc

Enter a number:

Tests - not attempted
Count files and directories in / UNTESTED

Question 2: Edit

Edit the file /etc/motd so that it contains the single word Welcome You can use the echo command and redirect the output, or you can use an editor such as vi or nano (similar to pico).

On some Windows machines, nano does not seem to like the cursor keys. If (and only if) the cursor keys result in funny characters when using nano, type the following at the prompt and then try nano again:

export TERM=vt102
This should get you going again. Silly Windows...

Tests - not attempted
Welcome in motd UNTESTED

Question 3: uid

Give the uid of the user mysql.

Enter a number:

Tests - not attempted
uid of mysql UNTESTED

Question 4: owner

Who is the owner of the directory /var/cache/mod_proxy?

Enter the user name:

Tests - not attempted
owner of mod_proxy UNTESTED

Question 5: permissions

Give the name of the first directory (alphabetically) of / that has no read permission for other.

Enter the directory name:

Tests - not attempted
inaccessible directory UNTESTED

Question 6: more permissions

Change the permission of the directory /var/log/httpd so that group and world have execute and read permission.

Tests - not attempted
access web log UNTESTED

Question 7: Change owner

Change the owner of the file /etc/my.cnf to mysql

Tests - not attempted
change owner UNTESTED

Question 8: Drop zone

Create a directory /root/dropzone It should be set up so that group and other users can save files in the directory, but they cannot read the files that are there. User root must able to read and write the directory.

Tests - not attempted
write only UNTESTED

Question 9: Linking files

Create a symbolic link so that the file /usr/share/dict/words appears as /root/words

Tests - not attempted
link to dictionary UNTESTED

Question 10: Word puzzle 1

Use grep on words to find a word that contains each of the vowels in the correct order. How many such words are there? (you may include words with extra vowels such as adventitious. /root/words

Tests - not attempted
all vowels in order UNTESTED

Question 11: Word puzzle 2

The words lightweight includes the same four characters (namely ight) repeated. How many such words are there (any four character are repeated).

Tests - not attempted
all vowels in order UNTESTED

Question 12: How much space in the apache manual?

How much space is the apache manual at /var/www/manual is taking? We want the total answer in human readable format (eg 6.2M).

Tests - not attempted
size of apache manual UNTESTED

Question 13: How much space is available?

In human readable form (eg 123M) how much disk space is available on the main filesystem?

Tests - not attempted
space free UNTESTED

Question 14: How much space is available?

Remove the entire Apache manual (it's easy to find elsewhere). Now repeat the above calculation for disk space.

Tests - not attempted
apache manual gone UNTESTED
space free UNTESTED


Tutlinks: intro1 intro2 wildcard permission pipe vi essential admin net fwall DNS diag Apache1 Apache2 MySQL1 MySQL2
Useful: Quiz Forums
Site Links:XMLZoo ActiveSQL ProgZoo SQLZoo