3

Click here to load reader

Answers

Embed Size (px)

DESCRIPTION

answers

Citation preview

Page 1: Answers

ans-1=$ pwd$ cd ~$ mkdir temp$ mkdir temp/stuff$ mkdir temp/stuff/things$ mkdir -p temp/stuff/things/orange/apple/pear/grape

Ans-2=

$ cd temp$ touch Sanya.txt$ lsSanya.txt$

Ans=-3 cat command is used to create a filehttp://learncodethehardway.org/cli/book/cli-crash-course.htmlthis link cn help uAns-8=# useradd "Test" creates a user# passwd "Test" Assign password to userto find uid= $ id -u Testto find gid= $id -g Test

Ans-13

1) Unzip the archive.zip to path/to/extracted/content:

unzip /path/to/archive.zip -d path/to/extracted/content2) Install the archive content :

if it's a package.deb :

sudo dpkg -i path/to/extracted/content/package.deb

sudo apt-get install -f

if it's an install-script :

sudo bash path/to/extracted/content/install-script

3) Delete the installation files (package.deb or install-script) :

rm path/to/extracted/content/package.debor

rm path/to/extracted/content/install-script

Ans 17=

Page 2: Answers

3. Download a file and save it in a specific folderwget --directory-prefix=folder/subfolder example.com

Ans-4= find . -name "passwd.txt"

cp passwd.txt passwd_copy.txt

mv passwd_copy.txt passwd_backup.txt

ans 4 understanding ke liye=https://www.st-andrews.ac.uk/ITS/training/unix/unix2.html

Ans=5

cat/more/less <file>"cat" stands for CATenate or conCATenate. You can use this command to dump the entire text file to the screen, much like the DOS "type" command.

indigo5> cat sample.txt (make sure you're in the correct directory; use "pwd" and "cd" if not.)

If the text file is too long, you might find that it scrolls past too quickly and you cannot see the beginning of the file anymore. In which case, you can use either the "more" or "less" command.

indigo5> more sample.txtor

indigo5> less sample.txtBoth these commands perform simlar functions as they allow to see the text file one page at a time. You use the spacebar to continue paging, <enter> key will move down one line, and "q" to quit

"less" has actually more features than "more" (Unix programmers love to coin humourous names for their programs...). The most useful feature is that it can scroll backwards (or up) whereas "more" cannot. Press "h" (while in the program) to see more options.

ANS6=

grep -c '^/bin/false$' /etc/passwd_backup

ans 2 =

remove directory

$ rm "dir2"

Page 3: Answers

Ans=7

grep -c '^/bin/false$' /etc/passwd_backup < output.txt

{ command1 & command2; } > new_file

if two commands ki output bhejni he file menow 10 are done 5 leftChat Conversation End