Sunteți pe pagina 1din 4

Lab practice Manual for Students

Standard directory of Unix


Follow the following Steps

Start / open your virtual box >>


Click on New for creating new project >>
Give Name for your project and select the type of operating system Linux >> Next
Select amount of Memory to be allocated to virtual machine>> Next
Add virtual hard disk for your machine or select create a virtual disk now>> Create
Select VHD >> Next
Select storage on physical hard disk, dynamic or fixed >> Next

Adding Extension
Select File then
From file select Preference
Then from displayed option select extension
Then add your extension Pack from your file >> click OK
Start your project
NB: some fatal error will displayed after you start your project that exits your process
For fixing fatal error
Select setting >>
Select storage >>
Click on empty>>
Click on disk sign >> then choose your iso from your disk
Choose Ubuntu.__.__. Iso source file or use fedora workstation
Then click OK
NOW YOU CAN START YOUR PROJECT
Start Terminal
Write the command written below
Working with Directory
Important standard directories
(/): -root, or ancestor of all files
(/usr): - shows each users home directory
(/dev): - all files that represent peripheral devices
(/etc): - administrative command kept in this directory
(/bin): - contains standard Linux programs
(/tmp): - used for temporary files
(/lib): - store library files

pwd
You are here sign can be displayed with the pwd command (Print Working
Directory).
The tool displays your current directory.
$ pwd
cd
You can change your current directory with the cd command (Change Directory).
$ cd /etc
$ pwd
/etc
$ cd /bin
$ pwd
/bin
cd ~
same with cd
You can pull off a trick with cd. Just typing cd without a target directory, will put you in your
home directory.
Typing cd ~ has the same effect.
$ cd /etc
$ pwd
/etc
cd ..
To go to the parent directory (the one just above your current directory in the
directory tree), type cd ..
$ pwd
/usr
$ cd ..
$ pwd
cd Another useful shortcut with cd is to just type cd - to go to the previous directory back and forth.
$ pwd
$ cd /etc
$ pwd
/etc
$ cd ls
You can list the contents of a directory with ls.
$ ls
ls -a
A frequently used option with ls is -a to show all files. Showing all files means
including the hidden files. When a file name on a Linux file system starts with a dot,
it is considered a hidden file and it doesn't show up in regular file listings.
$ ls

$ ls a
ls -l
Many times you will be using options with ls to display the contents of the directory
in different formats or to display different parts of the directory. Typing just ls gives
you a list of files in the directory. Typing ls -l (that is a letter L, not the number 1)
gives you a long listing.
$ ls l
ls -lh
Another frequently used ls option is -h. It shows the numbers (file sizes) in a more
human readable format. Also shown below is some variation in the way you can give
the options to ls.
$ ls -l -h
$ ls -lh
$ ls -hl
$ ls -h l
ls i
used to see the inode number of the file created
$ls i
Clear
for clearing the terminal
$ clear
mkdir
Walking around the Linux file tree is fun, but it is even more fun to create your own
directories with mkdir. You have to give at least one parameter to mkdir, the name
of the new directory to be created. Think before you type a leading / .
$ mkdir MyDir
$ cd MyDir
/MyDir$ ls -al
/MyDir$ mkdir stuff
/MyDir$ mkdir otherstuff
/MyDir$ ls l
mkdir -p
When given the option -p, then mkdir will create parent directories as needed.
$ mkdir -p MyDir2/MySubdir2/ThreeDeep
$ ls MyDir2
$ ls MyDir2/MySubdir2
$ ls MyDir2/MySubdir2/ThreeDeep/
rmdir
you can use rmdir to remove the directory.
/MyDir$ rmdir otherstuff
/MyDir$ ls
/MyDir$ cd ..
$ rmdir MyDir
rmdir: MyDir/: Directory not empty

$ rmdir MyDir/stuff
$ rmdir MyDir
rmdir -p
And similar to the mkdir -p option, you can also use rmdir to recursively remove
directories.
$ mkdir -p dir/subdir/subdir2
$ rmdir -p dir/subdir/subdir2
Chmod
Used to set permission for file
1. Symbolic mode
This have 3 parts
a. Users : u user , g - group member o other
b. To access or deny permission: (+ to access , - to deny)
c. Permission: (r- read, w- write, x- execute)
2. Absolute mode
We use numbers
1- None
2- Execute
3- Write
4- Read
$ Chmod 764 <file name>

S-ar putea să vă placă și