Linux Basics Assignment – 2
1)Change to the home directory of another user directly,
using cd ~username.
2)Change back into your home directory.
3)Make subdirectories called work and play.
4)Delete the subdirectory called work.
5)Copy the file /etc/passwd into your home directory.
6)Move it into the subdirectory play.
7)Change into subdirectory play.
8)Create a file called hello.txt that contains the words
"hello world".
9)Create a symbolic link named abc.txt of files hello.txt
10) copy the entire directory play to a directory called
work, preserving the symbolic link.
11) Imagine you were working on a system and someone
accidentally deleted the ls command (/bin/ls). How could
you get a list of the files in the current directory? Try
it.
12) What is the difference between listing the contents of
directory play with ls l and ls L?
13) How would you create and then delete a file called
"$SHELL"? Try it.
14) How would you create and then delete a file that
begins with the symbol #? Try it.
15) What is the output of the command: echo
{con,pre}{sent,fer}{s,ed}?
16) Now, from your home directory, copy /etc/passwd and
/etc/group into your home directory in one command given
that you can only type /etc once.
17) Delete the work directory and its contents with one
command.
18) How to write the output of a command to a file?
19) Write random numbers in a file and sort them in
ascending order on terminal.