Professional Documents
Culture Documents
Linux 5
Linux 5
Assignment – 5
Part (A)- create a file with name Example.txt which contains following content
Welcome to Linux !
Linux is a free and open source Operating system that is mostly used by developers and in
production
servers for hosting crucial components such as web and database servers. Linux has also made a
name
for itself in PCs. Beginners looking to experiment with Linux can get started with friendlier linux
distributions such as Ubuntu, Mint, Fedora and Elementary OS.
Q3- display the lines that don’t contain the string “Linux”?
Sol:- $grep -v “Linux” Example.txt
Output Screenshot
Q4- search “linux” in same directory and other sub-directories?
Sol:-
Output Screenshot
Q3- Display all the files which have a word twt,twet, tweet etc in the file name?
Sol :- $ls tw*t.*
Output Screenshot
Q4- display the files which contains any single character between t and t?
Sol:- $ls t*t.*
Output Screenshot
Q5- Display all the files which starts with ‘a’ and wnds with ‘e’?
Sol:- $ls a*e.*
Output Screenshot
Q7- Display all the files which contains digit at last in its name?
Sol:- $ls *[0-9]*[0-9]*
Output Screenshot
Q8- Display all the files which don’t contain digit in its name?
Sol:- $ls [!0-9]*[!0-9]*[!0-9].*
OR
$ ls [\!0-9]*[\!0-9]*[\!0-9].*
Output Screenshot
Q9- Display all the the files whose name starts with a capital letter?
Sol:- $ls *[A-Z]*
Output Screenshot
Q10- Display all the files whose name contains only three letters?
Sol:- $ls ???.*
Output Screenshot