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
Re: Execute Unix Commands
[QUOTE=vasanthakashyap;28296]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.[/QUOTE]
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