Skip to content

Latest commit

 

History

History
43 lines (36 loc) · 1.97 KB

terminal_exercises.md

File metadata and controls

43 lines (36 loc) · 1.97 KB

Terminal Exercises

Write the following terminal commands to perform the following tasks: Part I

  1. make a directory called first mkdir first
  2. change directory to the first folder cd first
  3. create a file called person.txt touch person.txt
  4. change the name of person.txt to another.txt mv person.txt another.txt
  5. make a copy of the another.txt file and call it copy.txt cp another.txt copy.txt
  6. remove the copy.txt file rm copy.txt
  7. make a copy of the first folder and call it second cp -r first second
  8. delete the second folder rm -rf second

Part II

  1. What does the man command do? Type in man rm. How do you scroll and get out?
    • Displays the manual for a command; D - Scroll down, U - Scroll up, B - Go back, Q - Exit
  2. Look at the man page for ls. What does the -l flag do? What does the -a flag do?
    • Lists files as a column; Gives all info
  3. How do you jump between words in the terminal?
    • Ctrl + Arrows
  4. How do you get to the end of a line in terminal?
    • Ctrl + e
  5. How do you move your cursor to the beginning in terminal?
    • Ctrl + a
  6. How do you delete a word (without pressing backspace multiple times) in terminal?
    • Alt + Backspace
  7. What is the difference between a terminal and shell?
    • A terminal is the program that displays and accepts characters, and the shell is the program that displays path info and accepts commands.
  8. What is an absolute path?
    • A path that starts from the root directory, begins with a /.
  9. What is an relative path?
    • A path that starts from the current directory.
  10. What is a flag? Give three examples of flags you have used.
    • An option that tells a program to do something; -r for recursive, -l for list, -a for all.
  11. What do the r and f flags do with the rm command?
    • r means recursive, it will delete all files and folders within the folder; f means that it will act on a folder.

Solution

See Our solution