Professional Documents
Culture Documents
Communication Commands
Information Commands
Printing Commands
1. What is the use of ls -l command & what is the information it gives about user?
A: - $ ls -l given the sorted file in long listing format. it gives the information such as
type(file/directory), permissions. Given to file, links, owner, group user detail, date &
time of modification etc.
A: - Environment variables are a set of dynamic named values that can affect the way
running processes will behave on a computer.
UNIX Basics Commands-3
3. Write a grep command that selects the lines from a file that have exactly three
characters?
4. The rm command removes links to file. What does this mean? How then is a file
deleted from the file system?
A: - rm never delete the link. Only file get removed from index. So it will not come when
you will use ls command.
A: - my filename .filename.
A: - type [-aftpP] name [name ...] with no options, indicate how each name would be
interpreted if used as a command name.
A:-In the Directory Give....ls –ls|sort -nr| head -1that gives the largest file statistics...
8. How do you find which version and name of UNIX you are using at the
command prompt?
A:-Your name -a in HP-UX -s operating system name -r release of the version name
9. What is the command to change a file's creation time? Means one file is created
at the time 15:19 then time should br changed to 14:14?
11. Give the command to display space usage on the UNIX file system?
A:- df -k .
A:- sed is a stream editor for editing files from a script or from the command line
13. How to remotely move a file? That means how to move a file one machine to
another machine?
A:- By ftp
UNIX Basics Commands-4
A:- 1-BY using format command we can find the status of hard disk format
15. Why we are using UNIX OS when we are doing the testing in our application?
16. What is FIND, GREP and SED? Could you please give me the difference
between all the three? Where we use these commands?
Basically FIND & GREP are the UNIX commands shared through the FILTERS .Where
is SED (STREAM) is one of the main editor.
FIND: Find is an exclusive command used to find files/folders are other information.
And this is powerful then windows.
Grep: This is also one of the important command used to globally searching the regular
expression in the file .GERP is gripping the information character by character.(i.e) from
file .ex 1) : #GREP "cat" raja
OUTPUT: if we have a file raja with data regarding cat we can clearly explain. Finally
SED (STREAM)
A:- the use of hidden file is my file is not view any another to use only to show myself
A:- Depending on the type of shell you can execute a file in either of the ways
1) ksh <filename>
2) sh <filename>
If the file already possess execute bit set on it, then you can directly execute the file with
its name alone
1) <filename> Or
If the file doesn't have executable permissions than assign the same as chmod 755
<filename>. After that execute the same by using command. /<filename>.
^d (Press control+d)
$ cat fruits.txt
Apple,orange,grapes. or
21. Write a command to find all of the files which have been accessed within the
last 30 days.
A:- find / -type f -atime -30 > November.files & This command will find all the files under
root, which is "/", with file type is file. "-atime -30" will give all the files accessed less than
30 days ago. And the output will put into a file call November.files.
A:- kill -9 pid its forcefully stop kill the curent process