0% found this document useful (0 votes)
17 views1 page

Linux Assignment 2

The document outlines a Linux basics assignment consisting of various tasks related to file and directory management. Tasks include changing directories, creating and deleting subdirectories, copying files, creating symbolic links, and executing commands. It also covers handling special characters in filenames and using command output redirection.

Uploaded by

saurabhydv2002
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
17 views1 page

Linux Assignment 2

The document outlines a Linux basics assignment consisting of various tasks related to file and directory management. Tasks include changing directories, creating and deleting subdirectories, copying files, creating symbolic links, and executing commands. It also covers handling special characters in filenames and using command output redirection.

Uploaded by

saurabhydv2002
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 1

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.

You might also like