Foreword

The aim of this guide is to provide the quickest path possible towards passing the LFCS exam. The way you are evaluated in this exam is based on practical exercises, so that’s where I put the focus on with these guides.

If you are a newcomer to Linux, I beg you to not stop here, Operating Systems is an amazing subject. Its history is full of bright engineers who came up with clever solutions that you use on your day to day life. Take a full dive on other articles about the concepts these commands use here.

Learning objectives

Learning GoalCommand
Log into local & remote txt consolesssh-keygen ssh-copy-id screen script
Search for filesfind
Compare & manipulate file contentdiff md5sum sed cut uniq sort
Use input-output redirection< <<CHAR > >> 2> &> tee mkfifo
Analyze text using basic REgrep sed
Archive, backup, compress & viceversatar cpio dd
Create, delete, cp, mv files & dirstouch mkdir rm cp mv
Create and manage hrd and sft linksln ln -s
List, set and change std file permls umask mkdir -m chmod Suid, Guid, Stcky Bit
Read and use system documentationman info
Manage access to the root accountsu sudo /etc/sudoers visudo PermitRootLogin

Review Questions

  1. Create a har file with 2048MB in the following location ~/lfcs-1/test/test2/
  2. Find the file looking by its type
  3. Find the file looking it by its size
  4. Find the file looking it by its name
  5. Find the file by looking it by its permissions
  6. Find the file by looking at its access time (less than 48h)
  7. Find the file by looking at who does NOT owns a file . Find the files that have a specific size or type . Find the file by any of the criteria above and copy it into /mnt
  8. Find the difference between files
  9. Find the difference in case insensitive mode
  10. Create a regex to find all the lines of a log file that start with a timestamp like this YYYY-MM-DD
  11. Create a regex to find and substitute all the dates YYYY-MM-DD to DD-MM-YYYY
  12. Create a regex to find all the lines that do not start with the # symbol and end with t, then substitute them by the word koala
  13. Archive the content of the dir A into a tar file compressed by bzip algorithm
  14. Extract the file tar file into a new dir B
  15. Create a new file into dir B
  16. Make an incremental tar file from the previous tar file with the new file created
  17. Extract the cpio image
  18. Make a new cpio archive
  19. Make a block-by-block copy of a disk into another disk
  20. Find an example of a file owned by root but that can’t be deleted. Fix it’s permission so it can be deleted
  21. Explain the difference between the SETUID, GUID and the sticky bit.
  22. Set and unset each bit on a file. Then set/unset them in combinations of two
  23. Verify the defaut umask value
  24. Modify the umask value for a user
  25. Modify the umaks value for a specific directory
  26. Modify the sudoers file to give a user A the ability to run commands without being prompted the password
  27. Modify the sudoers file to give user A the ability to run ls commands as user B

TODO

  • Make list prettier
  • Make each item of the list a link to a different post
  • Link to conceptual articles