if you want to remove an article from website contact us from top.

    identify the command used to copy all the files having the string sample and any two characters after that to demo directory

    Mohammed

    Guys, does anyone know the answer?

    get identify the command used to copy all the files having the string sample and any two characters after that to demo directory from screen.

    Question is ⇒ Which command is used to copy all files having the string chap and any two characters after that to the progs directory?, Options are ⇒ (A) cp chap?? progs, (B) cp chap* progs, (C) cp chap[12] /progs/*.*, (D) cp chap?? /progs/*, (E) , Leave your comments or Download question paper.

    Previous question Next question

    Q1. Which command is used to copy all files having the string chap and any two characters after that to the progs directory?

    A.  cp chap?? progs B.  cp chap* progs

    C.  cp chap[12] /progs/*.*

    D.  cp chap?? /progs/*

    View Answer   1 -1 Explanation:- Answer : A

    Discuss it below :!! OOPS Login [Click here] is required to post your answer/resultHelp other students, write article, leave your comments

    Previous question Next question

    Also Read Similar Questions Below :

    ⇒ Which of the following commands is used to save the output of the who command in a file named user.lst, as well as display it?

    who | tee user.lst who > user.lst who >> user.lst who < user.lste

    ⇒ Which command is used to assign only read permission to all three categories of the file 'note'?

    chmod go+r note chmod a-rw chmod ugo=r note

    chmod u+r,g+r,o-x note

    ⇒ Which of the following subdirectory(ies) contains the device files?

    /dev /bin /etc /home

    ⇒ Which option will be used with ps command to slow the entire command line of the process being run?

    -4 -f -1 -2

    ⇒ Which of the following directories contain all the Alias created by a user, including his login directory?

    /tmp /etc /usr /dev

    ⇒ The first set of the three permissions (rw) pertains to the owner of the file, indicating that the owner has

    executable permission only

    write and executable permissions

    both read and executable permissions.

    both read and write permissions

    ⇒ Which of the following is not a filter?

    cat grep wc None of the above

    ⇒ Which command will be used with vi editor to insert text to left of cursor?

    s S a i

    ⇒ Which file is used to configure which filesystems are mounted?

    /etc/mount.sys /etc/filesys /etc/sysconfig /etc/fstab

    ⇒ What command is used to print a file?

    lp pg prn print

    ⇒ Which command is used with vi editor to save file and remain in the editing mode?

    :q :w q! :x

    ⇒ What command is used to display your current working directory?

    path pwd prompt $p$g dir

    ⇒ Which of the following keys is used to move the cursor to the end of the paragraph.

    } { | $

    ⇒ Which of the following commands is used to list contents of directories?

    ls lp dir tar

    ⇒ Which of the following commands can be used to get information about yourself?

    who am i i /4 pwd which

    ⇒ _____ tool allows you to change your default X Window desktop.

    utilinux cempre switchdesk window

    ⇒ Which of the following is not a communication command.

    write mesg mail grep

    ⇒ Which of are following internal commands is used in mail to forward mail to user in user-list?

    r user-list m user-list d user-list e user-list

    ⇒ Which of the following commands is used to have a two-way communication with any person who is currently logged in?

    mail mesg write grep

    ⇒ Which command is used to delete all files in the current directory as well as all files and sub-directories in its subdirectories?

    rm * rm -r * rm all rm *.*

    ⇒ Which command is used to terminate a process?

    shutdown haltsys cancel kill

    ⇒ Which of the following options will be used to display number of blocks used by a file?

    -c -i -d -s

    ⇒ The physical layer of a network

    constructs packets of data and sends them across the network

    controls error detection and correction

    defines the electrical characteristics of signals passed between the computer and communication devices

    All of the above

    ⇒ Which command is used to change directory to the name beginning with a 'p'?

    cd p cd p? cd p* cd [p]

    ⇒ Which program is used to schedule particular jobs or programs at particular times on the system?

    vi Outlook Scheduler cron

    ⇒ Which of the following special shell variables is used to process number of the last background job?

    $! $# 0 $*

    ⇒ Which of the following command is used to mount NFS filesystems?

    nfsmount knfsd mount All of the above

    ⇒ The % key allows you

    to move the cursor to a matching delimiter, when a delimiters a parenthesis, a bracket, or a brace.

    to move the cursor to the upperleft corner of the screen

    to move the cursor backward to the beginning of a word

    to move the cursor to the first column in the current line

    ⇒ You can append to a file instead of overwriting by using the

    < symbols<< symbols

    > symbols >> symbols

    ⇒ Which of the following command can be used to rename a file in UNIX?

    ren mv remove change

    स्रोत : studysite.org

    Which command is used to copy all files having the string

    Which command is used to copy all files having the string chap and any two characters after that to the progs directory? a) cp chap?? progs b) cp chap* progs c) cp chap[12] /progs/*.* d) cp chap?? /progs/* e) None of the above

    Examveda

    Which command is used to copy all files having the string chap and any two characters after that to the progs directory?

    A. cp chap?? progs B. cp chap* progs

    C. cp chap[12] /progs/*.*

    D. cp chap?? /progs/*

    E. None of the above

    Answer: Option A

    Join The Discussion

    Related Questions on Unix

    Which symbol will be used with grep command to match the pattern pat at the beginning of a line?

    A. ^pat B. $pat C. pat$ D. pat^

    E. None of the above

    View Answer

    Which command is used to sort the lines of data in a file in reverse order

    A. sort B. sh C. st D. sort -r

    E. None of the above

    View Answer

    Which command is used to display the top of the file?

    A. cat B. head C. more D. grep

    E. None of the above

    View Answer

    Which command is used to copy all files having the string chap and any two characters after that to the progs directory?

    A. cp chap?? progs B. cp chap* progs

    C. cp chap[12] /progs/*.*

    D. cp chap?? /progs/*

    E. None of the above

    View Answer

    More Related Questions on Unix

    Read More: MCQ Type Questions and Answers

    Arithmetic Ability

    Competitive Reasoning

    Competitive English Data Interpretation General Knowledge History Geography Current Affairs Banking Awareness

    Computer Fundamentals

    Networking C Program Java Program SQL Database HTML CSS Javascript PHP Computer Science

    Electrical Engineering

    Mechanical Engineering

    Civil Engineering

    Chemical Engineering

    Commerce Management

    स्रोत : www.examveda.com

    15 Practical Grep Command Examples In Linux / UNIX

    Photo courtesy of Alexôme’s You should get a grip on the Linux grep command. This is part of the on-going 15 Examples series, where 15 detailed examples will be provided for a specific command or functionality.  Earlier we discussed 15 practical examples for Linux find command,  Linux command line history and mysqla

    15 Practical Grep Command Examples In Linux / UNIX

    by SATHIYAMOORTHY on MARCH 26, 2009

    Photo courtesy of Alexôme’s

    You should get a grip on the Linux grep command.

    This is part of the on-going 15 Examples series, where 15 detailed examples will be provided for a specific command or functionality.  Earlier we discussed 15 practical examples for Linux find command,  Linux command line history and mysqladmin command.

    In this article let us review 15 practical examples of Linux grep command that will be very useful to both newbies and experts.

    First create the following demo_file that will be used in the examples below to demonstrate grep command.

    $ cat demo_file

    THIS LINE IS THE 1ST UPPER CASE LINE IN THIS FILE.

    this line is the 1st lower case line in this file.

    This Line Has All Its First Character Of The Word With Upper Case.

    Two lines above this line is empty.

    And this is the last line.

    1. Search for the given string in a single file

    The basic usage of grep command is to search for a specific string in the specified file as shown below.

    Syntax:

    grep "literal_string" filename

    $ grep "this" demo_file

    this line is the 1st lower case line in this file.

    Two lines above this line is empty.

    And this is the last line.

    2. Checking for the given string in multiple files.

    Syntax:

    grep "string" FILE_PATTERN

    This is also a basic usage of grep command. For this example, let us copy the demo_file to demo_file1. The grep output will also include the file name in front of the line that matched the specific pattern as shown below. When the Linux shell sees the meta character, it does the expansion and gives all the files as input to grep.

    $ cp demo_file demo_file1

    $ grep "this" demo_*

    demo_file:this line is the 1st lower case line in this file.

    demo_file:Two lines above this line is empty.

    demo_file:And this is the last line.

    demo_file1:this line is the 1st lower case line in this file.

    demo_file1:Two lines above this line is empty.

    demo_file1:And this is the last line.

    3. Case insensitive search using grep -i

    Syntax:

    grep -i "string" FILE

    This is also a basic usage of the grep. This searches for the given string/pattern case insensitively. So it matches all the words such as “the”, “THE” and “The” case insensitively as shown below.

    $ grep -i "the" demo_file

    THIS LINE IS THE 1ST UPPER CASE LINE IN THIS FILE.

    this line is the 1st lower case line in this file.

    This Line Has All Its First Character Of The Word With Upper Case.

    And this is the last line.

    4. Match regular expression in files

    Syntax:

    grep "REGEX" filename

    This is a very powerful feature, if you can use use regular expression effectively. In the following example, it searches for all the pattern that starts with “lines” and ends with “empty” with anything in-between. i.e To search “lines[anything in-between]empty” in the demo_file.

    $ grep "lines.*empty" demo_file

    Two lines above this line is empty.

    From documentation of grep: A regular expression may be followed by one of several repetition operators:

    ? The preceding item is optional and matched at most once.

    * The preceding item will be matched zero or more times.

    + The preceding item will be matched one or more times.

    {n} The preceding item is matched exactly n times.

    {n,} The preceding item is matched n or more times.

    {,m} The preceding item is matched at most m times.

    {n,m} The preceding item is matched at least n times, but not more than m times.

    5. Checking for full words, not for sub-strings using grep -w

    If you want to search for a word, and to avoid it to match the substrings use -w option. Just doing out a normal search will show out all the lines.

    The following example is the regular grep where it is searching for “is”. When you search for “is”, without any option it will show out “is”, “his”, “this” and everything which has the substring “is”.

    $ grep -i "is" demo_file

    THIS LINE IS THE 1ST UPPER CASE LINE IN THIS FILE.

    this line is the 1st lower case line in this file.

    This Line Has All Its First Character Of The Word With Upper Case.

    Two lines above this line is empty.

    And this is the last line.

    The following example is the WORD grep where it is searching only for the word “is”. Please note that this output does not contain the line “This Line Has All Its First Character Of The Word With Upper Case”, even though “is” is there in the “This”, as the following is looking only for the word “is” and not for “this”.

    $ grep -iw "is" demo_file

    THIS LINE IS THE 1ST UPPER CASE LINE IN THIS FILE.

    this line is the 1st lower case line in this file.

    Two lines above this line is empty.

    And this is the last line.

    6. Displaying lines before/after/around the match using grep -A, -B and -C

    When doing a grep on a huge file, it may be useful to see some lines after the match. You might feel handy if grep can show you not only the matching lines but also the lines after/before/around the match.

    Please create the following demo_text file for this example.

    स्रोत : www.thegeekstuff.com

    Do you want to see answer or more ?
    Mohammed 11 month ago
    4

    Guys, does anyone know the answer?

    Click For Answer