In: Computer Science
Run the commands used for following tasks and paste the screen shots here:
a) Search/find a specified word in a file and display all the lines containing that word.
b) List all the files and directories in the current directory (including the hidden files).
c) Change to the root directory / and show a complete long listing of it.
d) Append the output of file1 to file2. [1 Mark] e) Count how many lines, words and characters in file1.
f) Create, copy, append and display the content of a file.
I created two files named file1.txt and file2.txt.
The contents of file1.txt are:
The contents of file2.txt are:
a) grep -i "word" file name will print the lines that the word contains in a file
b)List all files and directories in a current directory including hidden files.
command : ls -a
c)change to root directory / and show a complete long listing of it.
commands used :
To change to root directory : cd /
For long listing: ls -al
d) Append the output of file1 to file2:
command used: cat file1.txt>>file2.txt
I HOPE THIS WILL HELP YOU.......