Beruflich Dokumente
Kultur Dokumente
8. How to replace the n-th line in a file with a new line in Unix?
sed -i'' '10 i new inserted line' filename # i stands for insert
11. How will you find which operating system your system is running on in UNIX?
uname -a
The 'history' command can be used to get the list of commands that we are
executed.
By default, the head command displays the first 10 lines from a file. If we change the
option of head, then we can display as many lines as we want.
The d option here deletes the lines from 21 to the end of the file
The tail command can be used to display the last lines from a file.
tail -1 filename
16. How do you rename the files in a directory with _new as suffix?
ls -lrt|grep '^-'| awk '{print "mv "$9" "$9".new"}' | sh
17. Write a command to convert a string from lower case to upper case?
19. Write a command to redirect the output of date command to multiple files?
The tee command writes the output to multiple files and also displays the output on
the terminal.
ls -a | grep '^\.'
21. List out some of the Hot Keys available in bash shell?