Linux 1. As a regular user, search the /etc directory for every file named passwd. Redirect error messages from your search to /dev/null. 2.Find files under the /usr/share/doc directory that have not been modified in more than 300 days. 3. Find all files on your system which are longer than 1 MiB, and output their names. 4. How could you use find to delete a file with an unusual name (e. g., containing invisible control characters or umlauts)? 5. How would you ensure that files in /tmp which belong to you are deleted once you log out? 6. README is a very popular file name. Give the absolute path names of all files on your system called README .
As a regular user, you can use the following command to search the /etc directory for every file named passwd and redirect error messages to /dev/null:
find /etc -name passwd 2>/dev/null
You can find files under the /usr/share/doc directory that have not been modified in more than 300 days using the following command:
find /usr/share/doc -type f -mtime +300
To find all files on your system which are longer than 1 MiB and output their names, you can use the following command:
find / -size +1M -type f -exec ls -lh {} \;
To delete a file with an unusual name using find, you can use the following command:
find . -type f -name 'file_with_unusual_name*' -exec rm {} \;
To ensure that files in /tmp which belong to you are deleted once you log out, you can use a tool like tmpwatch to clean up files older than a certain time. You can add a cron job to run tmpwatch at regular intervals.
To find all files on your system called README, you can use the following command:
As a regular user, you can use the following command to search the /etc directory for every file named passwd and redirect error messages to /dev/null:
find /etc -name passwd 2>/dev/nullYou can find files under the /usr/share/doc directory that have not been modified in more than 300 days using the following command:
find /usr/share/doc -type f -mtime +300To find all files on your system which are longer than 1 MiB and output their names, you can use the following command:
find / -size +1M -type f -exec ls -lh {} \;To delete a file with an unusual name using find, you can use the following command:
find . -type f -name 'file_with_unusual_name*' -exec rm {} \;To ensure that files in /tmp which belong to you are deleted once you log out, you can use a tool like tmpwatch to clean up files older than a certain time. You can add a cron job to run tmpwatch at regular intervals.
To find all files on your system called README, you can use the following command:
find / -name README -type f