Jump to content

Welcome to Geeks to Go - Register now for FREE

Need help with your computer or device? Want to learn new tech skills? You're in the right place!
Geeks to Go is a friendly community of tech experts who can solve any problem you have. Just create a free account and post your question. Our volunteers will reply quickly and guide you through the steps. Don't let tech troubles stop you. Join Geeks to Go now and get the support you need!

How it Works Create Account
Photo

Linux basic questions

linux homework

  • Please log in to reply

#1
mxiamy

mxiamy

    New Member

  • Member
  • Pip
  • 2 posts

There are 100 possible points.
-------------------

1. Search ALL files in the ~ directory -- and all subdirectories below ~ -- that contain the keyword "Parrot" (case sensitive).  Make sure to print out the line number where each keyword

was found within the file.

 

2. Search files in ~ and all subdirectories -- that contain the word 'albatross' (case sensitive) at the beginning OR end of a line. Provide two lines of context before and after each

keyword found. Hint: Extended Grep is your friend

 

3. Search files in the /var/log directory that contain the word 'sudo' (case insensitive).  Add three lines of context after each keyword found.

 

4. Create a tar file named 'October.tar' that would include all the files in /var/log with the extension *.log

 

5. I want to append the file contingency.log.bak to the tar archive from Question 4 above. What command would I use?

 

6. Find all empty files under /home that belong to the user 'patrick' and delete them.

 

      
7. Find all files under ~ with a size smaller than 5 kilobytes.

 

     
8. I want to compress the file in Question 4 using the bzip2 compression algorithm. What command would I use?

 

9. Find all files under /var/log whose accessed time was MORE than 4 minutes ago.

 

10. Find all files under the current directory whose modified time was more than 3 days ago.

 

11. I have a file called 'backups.tar.bz2' in my home directory. I want to uncompress and unarchive the files in it. What single command would I use?

 

12. I have a file called hello.bz2 and I want to uncompress it. What command would I use?

 

13. I want to search for all files in the directory ~/Documents that contain the keyword "mount", case sensitive, and as the entire word. Words like amount, submount, demount, etc, should

not be found in the results; just 'mount'. Additionally, I only want to see the name(s) of the file(s) that have matches as a result of running the command. What command would I use? Hate

mail can be directed to /dev/null

 

14. I have a large file named bighead.txt and I want to view only the first 6 lines of the file. What command would I use?

 

15. Same as file as Question 14, but I want to view only the last 5 lines.

 

16. Find all files under ~ whose content contain the keyword pizza OR PIZZA OR piZZa OR pizzA. Not all variations in case for 'pizza', but just the variations listed.

 

17. Find all files under the current directory whose extension is *.gz and use -exec to create a listing of each files inode number.

 

18. What command would I run to update the database of file names used by the locate command?

 

19. Find all files under the /tmp directory whose size is greater than 90 kilobytes.  Use -exec and an appropriate command to delete these files.

 

20. Find all files under the current directory that are named 'bacon' ignoring case.

          find . -type f -iname "*bacon*"

 


  • 0

Advertisements


#2
mxiamy

mxiamy

    New Member

  • Topic Starter
  • Member
  • Pip
  • 2 posts

I'm a Linux beginner taking Linux admin for college class and need help to answer this questions


  • 0

#3
paws

paws

    WTT Tech Teacher

  • Tech Academy Moderator
  • 990 posts

 Hi mxiamy and welcome to our forums.

 

:welcome:

To enable our members to offer you their focussed assistance with your studies, please submit your best attempt to the questions yourself, indicating any areas on which you are getting stuck, the resources you are using to research the issues, and the specific areas where you require guidance.

If you provide full information on the lines suggested above then it will increase your chances of one of our Linux experts providing you with the guidance and direction you need.
Regards
paws


  • 0

#4
mrjimphelps

mrjimphelps

    New Member

  • Member
  • Pip
  • 4 posts

Have you asked your professor for help?  Maybe a classmate?  They would be the best people to help you with your homework.


Edited by mrjimphelps, 23 October 2017 - 12:22 PM.

  • 0






Similar Topics

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

As Featured On:

Microsoft Yahoo BBC MSN PC Magazine Washington Post HP