Escolar Documentos
Profissional Documentos
Cultura Documentos
Lab-1
( Linux Commands + Filters + Shell Wild Cards )
1. Create two files 1a.txt,1b.txt. Enter one line into both the files,Copy the
contents of both the files into 1c.txt,without using 'cp' command.
2. Create a file 2a.txt with 20 lines in it. The contents of each line should be
the line number. Copy line number 7 to 15 into another file 2b.txt.
3. Split the file 2a.txt created above into two halves.
4. Find 5 Recently modified files in your current working directory,Redirect
their file names,size date and time stamp into another file 4a.txt
5. Count the no of lines,words,characters in the file 4a.txt using a single
command.
6. Sort the file 2a.txt in the reverse order.
7. Combine the lines of file 2a.txt into a single line where each number is
separated by a space and redirect it to 7a.txt.
8. Find 5 largest files in the current folder display on the output screen and
also in a file 8a.txt without using redirection operator.
9. Try outputting contents of '2a.txt' and 'doesntExist.txt'. Redirect output to
'out.txt' and error to 'error.txt'
10. Count the no of 'Text' files (with .txt extension) in the current directory.
11. Find all txt files which are accessed 10 minutes ago in your home
directory.
12. List all the files which has a numeric value in its file name followed by an
extension.
13. Try to execute a command ls -l I love scripting the error should not be
displayed on the terminal and also not redirected to the file.
14. In your current folder, create the five folder with the name, hello, bye,
tata, hello1, bye4times and four files with the name boring.txt, in.c,
new, old
a) List all the files and folders that have some extension and their name is of at least 3
characters.
b) List all the folder that don't have the numeric letter in their name.
15.Create a folder Pics.
a)Create pics with pic1.jpg, pic2.jpg, ..... pic19.jpg, pic20.jpg
b) List all the pics in range 5 to 15 ( ie pic5.jpg to pic15.jpg )