Chapter 1 answers

From Linux Shell Scripting Tutorial - A Beginner's handbook
Jump to navigation Jump to search

← Chapter 1 ChallengesHomeChapter 2: Getting Started With Shell Programming →

  • What is the shell?

A type of computer user interface ( see What is Linux Shell )


Q. Decide whether the following sentence is true or false:

  1. True
  2. False ( Kernel [ OS ] manages files and data. )
  3. False ( see above )
  4. True
  5. False
  6. True
  7. True
  8. True
  9. True
  10. True
  11. True
  12. False
  13. True
  14. True
  15. True
  16. True
  17. True
  18. True

  • Write a command names, which can display the files to the terminal.
ls

  • Write a command to list details of all files ending in '.perl' in reverse time order.
ls -r *.perl

  • Write a command to list your running programs.
ps

OR

top

OR

top -u username

  • Write a command to list files waiting to be printed.
lpq

  • Write a command to delete 3 files called file1.txt, file2.txt, and data1.txt.
rm file1.txt file2.txt data1.txt

OR

rm file{1,2}.txt data1.txt

  • Write a command to creates a new sub-directory called 'foo' in /tmp.
mkdir /tmp/foo

  • Write a command to delete the directory called 'foo'.
rmdir foo

  • Write a command to read all ls command options.
man ls

← Chapter 1 ChallengesHomeChapter 2: Getting Started With Shell Programming →