More powerful than the spiky blue shell
Follow these steps to set up your own repository:
-
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 -
Visit your fork and clone that repository onto your computer:
git clone https://github.com/<your-username>/Core-Unix-Utilities.git -
Push your commits and link the local repo to your remote GitHub repo:
git push -u origin master -
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 -
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 -
When you want to access new course materials, just pull from the origin remote repo:
git pull core master
Challenges within each section are meant to be solved in order.
- Print the path of your working directory
- List the files in your working directory
- List the files with a particular extension, like
.txt - List the files in a subdirectory, like
project - Navigate to a subdirectory, like
project - Navigate to the parent directory of your working directory
- Navigate to a nested subdirectory, like
path/to/project - Navigate to your home directory
- Navigate back to the previous directory
- Print a sentence, like
Hello world - Print a variable value, like
$USERor$PATH - Set a variable
NAMEequal to your first name, then print its value - Set a variable
FULL_NAMEequal to your full name, then print its value - Print all environment variables (names and values)
- Make an alias named
hellothat printsHello world - Make an alias named
gocodethat navigates to your code directory - Print all aliases (names and values)
- Print what options a command accepts, like
bashorpython - Read the manual for a command, like
echoorls - Print the file path to a command, like
bashorpython
- Navigate to the directory
Animals - Print the contents of the file
Cats.txt - Print the contents of both files
Cats.txtandDogs.txt - Count the words in the file
Cats.txt - Count the words in all files with the extension
.txt - Copy the file
Dogs.txtto a new fileBabyDogs.txt - Rename the file
BabyDogs.txttoPuppies.txt - Make a new directory named
ShelterinsideAnimals - Move the file
Puppies.txtinto the directoryShelter - Copy the file
Cats.txttoKittens.txtinsideShelter - List the files within the directory
Shelter - Count the words in all
.txtfiles insideShelter - Try to remove the directory
Shelter(this should fail) - Remove all
.txtfiles insideShelter - Remove the directory
Shelter(this should succeed) - Now cry because you just deleted those poor tiny animals
- Print out your user name
- List the permissions (and metadata) of all
.txtfiles - Give all users write permission on the file
Cats.txt - List the permissions (and metadata) of the file
Cats.txt - Change the owner of the file
Cats.txtto another user - Now list the permissions (and owner) of the file
Cats.txt - Try to change the owner of the file
Cats.txtback to yourself - Invoke the super-user to make the previous command succeed
- List the permissions (and owner) of the file
Cats.txtagain
These challenges utilize more sophisticated Unix utilities. Challenges within each section are meant to be solved in order.
- Print a sentence like
Hello worldinto a file namedtest.txt - Append another sentence
Hola Mundoon a new line oftest.txt - Print the contents of the file
test.txt - Print the contents of the file
numbers.txt - Print the first 10 lines in the file
numbers.txt - Print the first 5 lines in the file
numbers.txt - Print the last 10 lines in the file
numbers.txt - Print the last 5 lines in the file
numbers.txt - Print lines 6 through 10 in the file
numbers.txt - Sort all lines in the file
numbers.txt - Print the first 2 characters of each line in
numbers.txt - Print only characters 9-16 of each line in
numbers.txt - Sort the first 2 characters of each line in
numbers.txt - Print only the unique first 2 characters of each line in
numbers.txt - Replace all
os with0s in filetest.txt - Capitalize all letters in the file
test.txt - Capitalize all letters in the string
Hello world
- Find the file named
Cats.txtin the directoryAnimals - Find all files ending with
.pyin your code directory - Find all files larger than 100 MB in your movies directory
- Find all lines containing the word
onein the filenumbers.txt - Find all lines containing the letter
eat least 3 times in the filenumbers.txt - Find the
searchfunction definition in a source code file - Find the
searchfunction definition in all source code files - Count the lines and words in all source code files
- Find all U.S. zip codes in a file containing addresses
- Find all U.S. zip codes in a file containing addresses