Test : Basic Test about Linux and Vim

This objective of this test is to know if you master the most useful commands for Linux. Feel free to ask for help if you can’t solve some of the questions.

File management

  1. Create a folder test in your working directory
  2. Create a empty file named test_file.txt in the folder ~/test. What is the meaning of ~ in ~/test ?
  3. What is the command to change your working directory to /home/imaEns/jdequidt/test with an absolute path ? Same question with a relative path.
  4. How many files are in the folder /home/imaEns/jdequidt/test ? How many directories ? How many executable files ?
  5. Can you read the files inside this folder ?
  6. Can you modify the files inside the folder ? When it is possible, prove it by adding some text (with your name) at the end of the file.
  7. What is the command to check if files in a folder are readable / writable / executable ?
  8. Assuming that your working directory is /home/imaEns/jdequidt/test, how do you copy the file users in your folder ~/test ? Assuming that your working directory is ~/test, how do you copy the file /home/imaEns/jdequidt/test/users in your working directory ? Choose one way or the other to copy the file users in your folder ~/test.
  9. Now in ~/test, how do you display the content of the filer users ?
  10. How do you display the first ten lines of this file ? The last ten lines ?

Common commands

  1. Assuming that the group member of SE3 is 1023, what is the command to display only users that belongs to the group SE3 ?
  2. What do you need to add to the previous command to output the result of the command in the file se3.txt ?
  3. Is the file se3.txt alphabetically sorted ? What is the command to output the content of se3.txt alphabetically sorted ?
  4. How can you combine the questions 1. and 3. to output the sorted SE3 members from the file users ?
  5. What is the command to know how many users there are in SE3 ?
  6. The command getent group lists all the group created in Polytech Lille. Using your login, how can you filter the result of the previous command to display only the groups you belong to. How can you complement the command to know how many groups you belong to.
  7. Graduate students in Embedded Systems from 2002 belongs to the group ima2002. How can you display the users of the group ima2002 ? Are people you know in this group ?

Cleaning things up

  1. The test is almost complete. How do you remove the folder ~/test and all its content ? Do it.
  2. Congrats, the test is done :)