Linuxconfig.org - Linux Questions and Answers
Location of cp command
Last Updated on Friday, 01 April 2011 18:26
Question:
What is the exact command that makes a guess about the content of a file "instructions" without displaying that content?
Answer:
file
A command file takes a best guess about a file content.
NOTE: file command does not rely on a file extention.
Command that makes a guess about the file content
Last Updated on Friday, 01 April 2011 18:26
Question:
What is the exact command that makes a guess about the content of a file "instructions" without displaying that content?
Answer:
file
A command file takes a best guess about a file content.
NOTE: file command does not rely on a file extention.
Read more: Command that makes a guess about the file content
Command to locate the word within a text file
Last Updated on Friday, 01 April 2011 18:27
Question:
Give the exact command that can locate the word "to" (without quotes) in a file named "file1" (without quotes), but does not display words like "total" or "stone" that are in the same file.
Answer:
-w option of a grep commad allows user to search a content of a file for a words, where word is separated on both sides by a white space.
grep -w to file1Add a comment
Keyword search in the online manual
Last Updated on Friday, 01 April 2011 18:27
Question:
Do a keyword (-k) search in the online manual for the word "grep". How many man PAGES are there where the word "grep" appears? What command did you use to get the result?
Answer:
To search for a specific keyword within online manual pages we can use a man -k command. For exmaple to search for a keyword grep we use:
man -k grep
another alternative to man command is apropos command:
apropos -k grep
Both commands will return the same number of results.
Add a commentDifferences between the cat and ls utilities
Last Updated on Friday, 01 April 2011 18:27
Question:
What are the differences between the cat and ls utilities, with respect to file content?
Answer:
ls without any arguments will return a file name and thus it does not directly read a content of the file. Whereas cat will return a content of a file.
More Articles...
Page 9 of 10













