Basics Review Questions

Using basic commands

Answer and try out:

  1. What command would you use to display your current location in the file system?
  2. Which command shows the list of files and directories in your current location?
  3. What command would you use to create a new directory called "projects"?
  4. Which command allows you to change your current directory?
  5. What command would you use to view the contents of a text file without opening an editor?
  6. Which command creates a copy of a file?
  7. What command would you use to create an empty file?
  8. Which command displays detailed information about files including permissions, ownership, and timestamps?
  9. What command would you use to remove or delete a file?
  10. Which command shows you the username you're currently logged in as?
  11. How would you list files in a directory which is not the current directory?
  12. How would you run a program (binary executable) called myprog that exists in the current directory?
  13. How would you create a directory called d15 under the current directory?
  14. How would you show the list of directories that are searched when trying to run ls?
  15. What is the difference in the types of the commands:
  • ls
  • cd please show these types.