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 Goal | Command |
---|---|
Log into local & remote txt consoles | ssh-keygen ssh-copy-id screen script |
Search for files | find |
Compare & manipulate file content | diff md5sum sed cut uniq sort |
Use input-output redirection | < <<CHAR > >> 2> &> tee mkfifo |
Analyze text using basic RE | grep sed |
Archive, backup, compress & viceversa | tar cpio dd |
Create, delete, cp, mv files & dirs | touch mkdir rm cp mv |
Create and manage hrd and sft links | ln ln -s |
List, set and change std file perm | ls umask mkdir -m chmod Suid, Guid, Stcky Bit |
Read and use system documentation | man info |
Manage access to the root account | su sudo /etc/sudoers visudo PermitRootLogin |
Review Questions
- Create a har file with 2048MB in the following location ~/lfcs-1/test/test2/
- Find the file looking by its type
- Find the file looking it by its size
- Find the file looking it by its name
- Find the file by looking it by its permissions
- Find the file by looking at its access time (less than 48h)
- 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
- Find the difference between files
- Find the difference in case insensitive mode
- Create a regex to find all the lines of a log file that start with a timestamp like this YYYY-MM-DD
- Create a regex to find and substitute all the dates YYYY-MM-DD to DD-MM-YYYY
- 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
- Archive the content of the dir A into a tar file compressed by bzip algorithm
- Extract the file tar file into a new dir B
- Create a new file into dir B
- Make an incremental tar file from the previous tar file with the new file created
- Extract the cpio image
- Make a new cpio archive
- Make a block-by-block copy of a disk into another disk
- Find an example of a file owned by root but that can’t be deleted. Fix it’s permission so it can be deleted
- Explain the difference between the SETUID, GUID and the sticky bit.
- Set and unset each bit on a file. Then set/unset them in combinations of two
- Verify the defaut umask value
- Modify the umask value for a user
- Modify the umaks value for a specific directory
- Modify the sudoers file to give a user A the ability to run commands without being prompted the password
- 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