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
- Create a folder
testin your working directory - Create a empty file named
test_file.txtin the folder~/test. What is the meaning of~in~/test? - What is the command to change your working directory to
/home/imaEns/jdequidt/testwith an absolute path ? Same question with a relative path. - How many files are in the folder
/home/imaEns/jdequidt/test? How many directories ? How many executable files ? - Can you read the files inside this folder ?
- 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.
- What is the command to check if files in a folder are readable / writable / executable ?
- Assuming that your working directory is
/home/imaEns/jdequidt/test, how do you copy the fileusersin your folder~/test? Assuming that your working directory is~/test, how do you copy the file/home/imaEns/jdequidt/test/usersin your working directory ? Choose one way or the other to copy the fileusersin your folder~/test. - Now in
~/test, how do you display the content of the filerusers? - How do you display the first ten lines of this file ? The last ten lines ?
Common commands
- Assuming that the group member of
SE3is1023, what is the command to display only users that belongs to the groupSE3? - What do you need to add to the previous command to output the result of the
command in the file
se3.txt? - Is the file
se3.txtalphabetically sorted ? What is the command to output the content ofse3.txtalphabetically sorted ? - How can you combine the questions 1. and 3. to output the sorted
SE3members from the fileusers? - What is the command to know how many users there are in
SE3? - The command
getent grouplists 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. - Graduate students in Embedded Systems from 2002 belongs to the group
ima2002. How can you display the users of the groupima2002? Are people you know in this group ?
Cleaning things up
- The test is almost complete. How do you remove the folder
~/testand all its content ? Do it. - Congrats, the test is done :)