Vous êtes sur la page 1sur 3

ans-1

=$ pwd
$ cd ~
$ mkdir
$ mkdir
$ mkdir
$ mkdir

temp
temp/stuff
temp/stuff/things
-p temp/stuff/things/orange/apple/pear/grape

Ans-2=
$ cd temp
$ touch Sanya.txt
$ ls
Sanya.txt
$

Ans=-3 cat command is used to create a file


http://learncodethehardway.org/cli/book/cli-crash-course.html
this link cn help u
Ans-8=#
useradd "Test"
creates a user
# passwd "Test"
Assign password to user
to find uid= $ id -u Test
to 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/content
2) 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.deb
or
rm path/to/extracted/content/install-script

Ans 17=

3. Download a file and save it in a specific folder


wget --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 e
ntire 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 an
d you cannot see the beginning of the file anymore. In which case, you can use e
ither the "more" or "less" command.
indigo5> more sample.txt
or
indigo5> less sample.txt
Both 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 mo
ve down one line, and "q" to quit
"less" has actually more features than "more" (Unix programmers love to coin hum
ourous names for their programs...). The most useful feature is that it can scro
ll 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"

Ans=7
grep -c '^/bin/false$' /etc/passwd_backup < output.txt
{ command1 & command2; } > new_file
if two commands ki output bhejni he file me
now 10 are done 5 left
Chat Conversation End

Vous aimerez peut-être aussi