Unix Assignment by Ritu
Unix Assignment by Ritu
b. $ date ; who
Who – shows a list of users who are currently logged into a computer.
c. $ ls > file1
Lists all the files in the current directory in the ‘file1’ file.
2. What does the command “$who | sort –logfile > newfile” do?
4. Use a grep command to display all the lines from following Sunday.log file, where ‘Sunday’ is
the starting word.(not where it comes in middle or end)
Today is Sunday
Sunday is a good day
No one go to school on Sunday
Sunday we meet our friends
killall
6. Can you write command to give read and write user group permissions to xyz.log file?
7. How can I delete all the files in current and all its sub directories?
rm*
YES. wc –l ‘file_name’
% who | sort
command1 | command2
12. How many commands are there to check processes (including foreground and background)
%ps, %jobs
$ echo $0
/bin/bash
$ exec /bin/sh
$ echo $0
/bin/sh
% head -5 filename