Skip to content

Make-School-Labs/Core-Unix-Utilities

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Core: Unix Utilities

More powerful than the spiky blue shell

Working with this GitHub repository

Follow these steps to set up your own repository:

  1. Fork this repository on GitHub to create your own version of this repo on your GitHub account, which should also be named Core-Unix-Utilities

  2. Visit your fork and clone that repository onto your computer: git clone https://github.com/<your-username>/Core-Unix-Utilities.git

  3. Push your commits and link the local repo to your remote GitHub repo: git push -u origin master

  4. When you've completed a challenge and want to share it for code review, commit your work and push it to your own remote repo with: git push

  5. Add this GitHub repository as a remote to the local one on your computer: git remote add core https://github.com/Product-College-Labs/Core-Unix-Utilities.git

  6. When you want to access new course materials, just pull from the origin remote repo: git pull core master

Challenges, Part 1

Challenges within each section are meant to be solved in order.

Navigation

  1. Print the path of your working directory
  2. List the files in your working directory
  3. List the files with a particular extension, like .txt
  4. List the files in a subdirectory, like project
  5. Navigate to a subdirectory, like project
  6. Navigate to the parent directory of your working directory
  7. Navigate to a nested subdirectory, like path/to/project
  8. Navigate to your home directory
  9. Navigate back to the previous directory

Variables

  1. Print a sentence, like Hello world
  2. Print a variable value, like $USER or $PATH
  3. Set a variable NAME equal to your first name, then print its value
  4. Set a variable FULL_NAME equal to your full name, then print its value
  5. Print all environment variables (names and values)
  6. Make an alias named hello that prints Hello world
  7. Make an alias named gocode that navigates to your code directory
  8. Print all aliases (names and values)

Getting Help

  1. Print what options a command accepts, like bash or python
  2. Read the manual for a command, like echo or ls
  3. Print the file path to a command, like bash or python

Files

  1. Navigate to the directory Animals
  2. Print the contents of the file Cats.txt
  3. Print the contents of both files Cats.txt and Dogs.txt
  4. Count the words in the file Cats.txt
  5. Count the words in all files with the extension .txt
  6. Copy the file Dogs.txt to a new file BabyDogs.txt
  7. Rename the file BabyDogs.txt to Puppies.txt
  8. Make a new directory named Shelter inside Animals
  9. Move the file Puppies.txt into the directory Shelter
  10. Copy the file Cats.txt to Kittens.txt inside Shelter
  11. List the files within the directory Shelter
  12. Count the words in all .txt files inside Shelter
  13. Try to remove the directory Shelter (this should fail)
  14. Remove all .txt files inside Shelter
  15. Remove the directory Shelter (this should succeed)
  16. Now cry because you just deleted those poor tiny animals

Permissions

  1. Print out your user name
  2. List the permissions (and metadata) of all .txt files
  3. Give all users write permission on the file Cats.txt
  4. List the permissions (and metadata) of the file Cats.txt
  5. Change the owner of the file Cats.txt to another user
  6. Now list the permissions (and owner) of the file Cats.txt
  7. Try to change the owner of the file Cats.txt back to yourself
  8. Invoke the super-user to make the previous command succeed
  9. List the permissions (and owner) of the file Cats.txt again

Challenges, Part 2

These challenges utilize more sophisticated Unix utilities. Challenges within each section are meant to be solved in order.

Streams

  1. Print a sentence like Hello world into a file named test.txt
  2. Append another sentence Hola Mundo on a new line of test.txt
  3. Print the contents of the file test.txt
  4. Print the contents of the file numbers.txt
  5. Print the first 10 lines in the file numbers.txt
  6. Print the first 5 lines in the file numbers.txt
  7. Print the last 10 lines in the file numbers.txt
  8. Print the last 5 lines in the file numbers.txt
  9. Print lines 6 through 10 in the file numbers.txt
  10. Sort all lines in the file numbers.txt
  11. Print the first 2 characters of each line in numbers.txt
  12. Print only characters 9-16 of each line in numbers.txt
  13. Sort the first 2 characters of each line in numbers.txt
  14. Print only the unique first 2 characters of each line in numbers.txt
  15. Replace all os with 0s in file test.txt
  16. Capitalize all letters in the file test.txt
  17. Capitalize all letters in the string Hello world

Search

  1. Find the file named Cats.txt in the directory Animals
  2. Find all files ending with .py in your code directory
  3. Find all files larger than 100 MB in your movies directory
  4. Find all lines containing the word one in the file numbers.txt
  5. Find all lines containing the letter e at least 3 times in the file numbers.txt
  6. Find the search function definition in a source code file
  7. Find the search function definition in all source code files
  8. Count the lines and words in all source code files
  9. Find all U.S. zip codes in a file containing addresses
  10. Find all U.S. zip codes in a file containing addresses

About

Core session on Unix utilities & command line tools

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published