Drugie_21

 0    21 Fiche    michalesq
басу ойын өзіңді тексер
 
сұрақ - жауап -
chown apache: apache -R /var/www recursively sets the owner to all files and directories under /var/www/ to apache and the group ownership to apache (This would include the www directory itself).
оқуды бастаңыз
True
How would you dump the contents of the /var/log/messages file into standard output, grep for all lines that contain "Memory" and then redirect the grep'ed result to /home/user/log. txt?
оқуды бастаңыз
cat /var/log/messages | grep -i memory > /home/user/log. txt
You need to search for man pages that relate to the postfix service. Which command will do this?
оқуды бастаңыз
whatis postfix, apropos postfix
How would you append the text "service=on" to the /etc/motd file?
оқуды бастаңыз
echo "service=on" >> /etc/motd
You need to set the execute bit on the finance directory and any subdirectories it might contain, but not on the files within them. This change must apply to all users. What methods might you use?
оқуды бастаңыз
chmod a+X -R finance, chmod -R a+X finance
Which directory contains the info files from which the info program reads?
оқуды бастаңыз
/usr/share/info
Display first ten lines of the file
оқуды бастаңыз
head
Display first fifty lines of the file
оқуды бастаңыз
head -n 50
Display last ten lines of the file
оқуды бастаңыз
tail
Add next line to the file i.e. to /varlog/messages when new log comes
оқуды бастаңыз
tail -f /var/log/messages
Display all lines starting with #
оқуды бастаңыз
grep '^#'
Display a word with either capital or small letter
оқуды бастаңыз
grep -i <word>
Search and display word in a file
оқуды бастаңыз
grep 'user' /etc/passwd
Search and display everything but the word in the file
оқуды бастаңыз
grep -v 'slowo' /etc/passwd
Find a word in results of dmesg command
оқуды бастаңыз
dmesg | grep slowo
Find a line in a file where 'word' is at the end on the line
оқуды бастаңыз
grep 'word$' /etc/passwd
Find lines starting and ending with linuxacademy
оқуды бастаңыз
grep -I '^linuxacademy&' /etc/passwd
Find a line without letters o and a
оқуды бастаңыз
grep '[^oa]' /var/log/messages
Regular expression -?
оқуды бастаңыз
Item is optional
Regular expression - +
оқуды бастаңыз
Item exists once or more times in line
Fine a latter which appears once or more in the line
оқуды бастаңыз
grep -E '(a)+' <filename>

Пікір қалдыру үшін жүйеге кіру керек.