Results 1 to 3 of 3

Thread: Execute Unix Commands

  1. #1

    Execute Unix Commands

    List and execute the following UNIX commands:
    (a)To change the password.
    (b)To search files in the current directory/subdirectory for lines that match a particular string pattern given.
    (c)To print the first 5 lines of a file.
    (d)To print the number of processes run by a particular user.
    (e)To kill a process which is running in the background.
    (f)To display the number of blank spaces in a given file.
    (g)To sort alphabetically, a list of numbers stored in a data file in an ascending order.
    (h)To convert the upper case letters to corresponding lower case letters in a text file.
    (i)To count the number of users currently logged on.
    (j)To display the calendar for a given month and year.


  2. #2

    Re: Execute Unix Commands

    could answer some of your questions,

    List and execute the following UNIX commands:
    (a)To change the password. : Ans:- passwd <user name>
    (c)To print the first 5 lines of a file. : Ans:- tail -5 <path of the file>
    (e)To kill a process which is running in the background. : Ans:- kill $! (this is to kill the last back ground process executed)
    (i)To count the number of users currently logged on. : Ans:- who -a (will display the no. of users logged in - but it will not give us the count)
    (j)To display the calendar for a given month and year. : Ans:- cal (this will display just the current months calendar) and if you want to display a specific month :- cal <month> <year>
    Ex: cal 7 2007


  3. #3
    Junior Member
    Join Date
    May 2008
    Answers
    1

    Re: Execute Unix Commands

    Quote Originally Posted by vasanthakashyap View Post
    List and execute the following UNIX commands:
    (a)To change the password.
    (b)To search files in the current directory/subdirectory for lines that match a particular string pattern given.
    (c)To print the first 5 lines of a file.
    (d)To print the number of processes run by a particular user.
    (e)To kill a process which is running in the background.
    (f)To display the number of blank spaces in a given file.
    (g)To sort alphabetically, a list of numbers stored in a data file in an ascending order.
    (h)To convert the upper case letters to corresponding lower case letters in a text file.
    (i)To count the number of users currently logged on.
    (j)To display the calendar for a given month and year.

    a)To change password use passwd or yppasswd
    b)to locate a file a particularfile use "locate" or "find " --very useful
    c)head or more
    d)ps a | wc -l
    e)kill pid (first find the pid of that process )
    f)try this ---> cat filename | wc -w
    g)use sort
    j)cal monthname


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
About us
Applying for a job can be a stressful and frustrating experience, especially for someone who has never done it before. Considering that you are competing for the position with a at least a dozen other applicants, it is imperative that you thoroughly prepare for the job interview, in order to stand a good chance of getting hired. That's where GeekInterview can help.
Interact