Challenge 03 - Handling files
< Previous Challenge - Home - Next Challenge >
Description
In this challenge you will learn basic commands about file manipulation such as create, rename, find and remove files.
- Find in the
/var
directory all the files that have been modified in the last 60 minutes
- Show the type of file of
/bin/htop
, /etc/passwd
and /usr/bin/passwd
- Go to your home directory and download
azure-linux.svg
and InfographicRC2.pdf
- Display the type of file of
azure-linux.svg
and InfographicRC2.pdf
- Rename
azure-linux.svg
to azure-linux.pdf
- Display the type of file of
azure-linux.pdf
and InfographicRC2.pdf
- Create a directory
~/lab
and enter it.
- Create the file
today.log
and the file yesterday.log
in lab.
- Check the creation date and time
- Change the date on
yesterday.log
to match yesterday’s date
- Check the creation date and time again
- Create a directory
~/mybackup
and copy all files from ~/lab
into it
- Use one command to remove the directory
~/mybackup
and all files under it
- Create a directory
~/logbackup
and copy the *.log
files from /var/log
into it
- Count the number of times ‘linux’ appears in the file
/etc/wgetrc
- Count the number of words from the file
/etc/hdparm.conf
Success Criteria
- Show all the files that have been modified in the last 60 minutes within
/var
- Make sure you checked the different file types of the files
/bin/htop
, /etc/passwd
and /usr/bin/passwd
- Ensure you were able to download the files
azure-linux.svg
and InfographicRC2.pdf
successfully into your home directory
- Confirm the different file types
- Validate the renaming of
azure-linux.svg
to azure-linux.pdf
- After the renaming of the extension, check if the file type was changed
- Make sure the directory was successfully created and that you are inside of the directory
- Check if files were created correctly inside the
~/lab
directory
- Confirm the creation date and time for each file
- Make sure you have changed the date properly to yesterday’s date
- Confirm if the creation date and time were defined as expected
- Validate if the all files from
~/lab
were successfully placed into ~/mybackup
- Make sure if you were able to remove everything using just one command
- Show all log files copied from
/var/log
into ~/logbackup
- Confirm how many lines exist in
/etc/wgetrc
- Confirm how many words exist in
/etc/hdparm.conf
Learning Resources