Professional Documents
Culture Documents
1 Practical No 1 Basic Command and Directory
1 Practical No 1 Basic Command and Directory
Basic Commands.
$cd
cd/bin
bin $ ls
output:
bin $ ls ?? ???
output
3.List all filenames with 2 and 4 characters at same file
Code:
bin $ ls ?? ????
output:
bin $ ls [aeiou]*
output:
5.list all filenames with exactly 3 characters in which the second character is vowel
Code:
bin $ ls ?[aeiou]?
output:
6.list all filenames with last character as a or b orc orc
Code:
bin $ ls * [abcd]
output:
8.list all 4 character filenames whose first character is ‘b’ and third character is ‘c’.
Code:
bin $ ls b? c?
output:
9.list all filenames whose first character is ‘m’ or ‘r’ or or is in the range c to f or v
to z.
Code:
output:
10.list all filenames whose first character is anything other than an alphabet
in the range d to m.
Code:
bin $ ls [!d-m]*
output:
11.construct a command to display the total number of files with exactly 3
character in their filename
Code:
output:
bin $ ls !more
output:
Directory Command:
Code:
User37@kcmit-desktop ~ $ cd fy5
User37@kcmit-desktop ~/fy5 $ ls
f5 f6
user37@kcmit-desktop ~/fy5 $ cd
user37@kcmit-desktop ~ $ cd fy6
user37@kcmit-desktop ~/fy6 $ ls
f7 f8
user37@kcmit-desktop ~/fy6 $ cd
user37@kcmit-desktop ~ $ cd fy5
user37@kcmit-desktop ~/fy5 $ cd
user37@kcmit-desktop ~ $ cd fy6
user37@kcmit-desktop ~/fy6 $ ls
f7 f8
user37@kcmit-desktop ~ $ cd fy5
user37@kcmit-desktop ~/fy5 $ ls
f5 f6 fy6
user37@kcmit-desktop ~/fy5 $ rm f5 f6
user37@kcmit-desktop ~/fy5 $ ls
fy6
User37@kcmit-desktop ~/fy5 $ ls
f6 fy6
User37@kcmit-desktop ~/fy5 $ ls
user37@kcmit-desktop ~/fy5 $ ^C
User37@kcmit-desktop ~/fy5 $
output: