Skip to content

Instantly share code, notes, and snippets.

@jangeador
Created June 7, 2019 20:59
Show Gist options
  • Save jangeador/74d24e4866a283a376499556cfd552b6 to your computer and use it in GitHub Desktop.
Save jangeador/74d24e4866a283a376499556cfd552b6 to your computer and use it in GitHub Desktop.
Linux tutorial homework

Homework

  1. Find out which shell you are using

  2. Find out where you are in file system

  3. Go to home directory

  4. Create a folder named homework

  5. List the contents of home directory to a file named ~/homework/home_dir.txt

  6. Same as previous but also showing hidden files and permissions. Name it ~/homework/home_dir_all.txt

  7. Change to homework directory

  8. Create an empty file named empty.txt

  9. Make empty.txt a hidden file

  10. Create a folder called private and change permissions so that only you can access it

  11. Read the man page for the command seq

  12. Use the command seq to generate a file with numbers from 1 to 1000

  13. Bonus... use command seq to generate a file containing a list of ips from 10.2.8.1 to 10.2.8.254. Hint seq -f

  14. Bonus 2: use command seq to generate a file named apples.txt containing the following:

10 apples
11 apples
12 apples
13 apples
14 apples
15 apples
16 apples
17 apples
18 apples
19 apples
20 apples

hints: seq -s hint 2: new line needs to be escaped as \\n

  1. If you cannot complete bonus 2 create the file manually using vi

  2. Use sed to create a pears.txt file from the apples.txt file it should contains pears instead of apples

  3. Create a pairs_5.txt file using either sed or grep to only contain the lines where the numbers end in 5 or zero. Hint: math will not be used. (string manipulation)

  4. Create the following file ~/level1/level2/level3/level4/level5/level6/linux.txt

  5. Copy the ~/level1 directory with all the subdirectories to a folder called level1_copy Hint: cp -r

  6. Create a bash script where the user places a path and the script lists all the files in that path. name it myls.sh

To Take Home:

  1. Complete vimtutor

  2. Update and upgrade all packages on your pi

  3. Install the git package

  4. Use apt-get to remove all unnecessary files

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment