Showing posts with label UNIX. Show all posts
Showing posts with label UNIX. Show all posts

Tuesday, August 27, 2013

PPT ON UNIX DIRECTORY MANAGEMENT

Presentation On Unix Directory Management
Download

Unix Directory Management Presentation Transcript:
1.Unix - Directory Management

2.A directory is a file whose sole job is to store file names and related information. All files, whether ordinary, special, or directory, are contained in directories.
UNIX uses a hierarchical structure for organizing files and directories. This structure is often referred to as a directory tree . The tree has a single root node, the slash character ( /), and all other directories are contained below it.

3.Home Directory:
The directory in which you find yourself when you first login is called your home directory.
You will be doing much of your work in your home directory and subdirectories that you'll be creating to organize your files.
You can go in your home directory anytime using the following command:
$cd ~ 
$

4.Here ~ indicates home directory. If you want to go in any other user's home directory then use the following command:
$cd ~username 
$
To go in your last directory you can use following command:
$cd – 
$

5.Absolute/Relative Pathnames:
Directories are arranged in a hierarchy with root (/) at the top. The position of any file within the hierarchy is described by its pathname.
Elements of a pathname are separated by a /. A pathname is absolute if it is described in relation to root, so absolute pathnames always begin with a /.
These are some example of absolute filenames.

6./etc/passwd
 /users/sjones/chem/notes
 /dev/rdsk/Os3
A pathname can also be relative to your current working directory. Relative pathnames never begin with /. Relative to user amrood' home directory, some pathnames might look like this:
chem/notes personal/res

7.chem/notes 
personal/res
To determine where you are within the filesystem hierarchy at any time, enter the command pwd to print the current working directory:
$pwd /user0/home/amrood $

8.Listing Directories:
To list the files in a directory you can use the following syntax:
$ls dirname
Following is the example to list all the files contained in /usr/local directory:
$ls /usr/local
X11     bin     gimp         jikes         sbin
ace     doc     include     lib         share
atalk     etc     info         man         ami

9.Creating Directories:
Directories are created by the following command:
$mkd dirname
Here, directory is the absolute or relative pathname of the directory you want to create. For example, the command:
$mkdir mydir $
Creates the directory mydir in the current directory. Here is another example:
$mkdir /tmp/test-dir $

10.This command creates the directory test-dir in the /tmp directory. The mkdir command produces no output if it successfully creates the requested directory.
If you give more than one directory on the command line, mkdir creates each of the directories. For example:
$mkdir docs pub $Creates the directories docs and pub under the current directory.

Source: Power Point Presentations

PPT ON UNIX PROCESS MANAGEMENT

Presentation On Unix Processes Management
Download

Unix Processes Management Presentation Transcript:
1.Unix - Processes Management

2.When you execute a program on your UNIX system, the system creates a special environment for that program. This environment contains everything needed for the system to run the program as if no other program were running on the system.
Whenever you issue a command in UNIX, it creates, or starts, a new process. When you tried out the lscommand to list directory contents, you started a process. A process, in simple terms, is an instance of a running program.

3.The operating system tracks processes through a five digit ID number known as the pid or process ID . Each process in the system has a unique pid.
Pids eventually repeat because all the possible numbers are used up and the next pid rolls or starts over. At any one time, no two processes with the same pid exist in the system because it is the pid that UNIX uses to track each process.

4.Starting a Process:
When you start a process (run a command), there are two ways you can run it:
Foreground Processes
Background Processes

5.Foreground Processes:
By default, every process that you start runs in the foreground. It gets its input from the keyboard and sends its output to the screen.
You can see this happen with the ls command. If I want to list all the files in my current directory, I can use the following command:
$ls ch*.doc

6.This would display all the files whose name start with ch and ends with .doc:
ch01-1.doc ch010.doc ch02.doc ch03-2.doc ch04-1.doc ch040.doc ch05.doc ch06-2.doc ch01-2.doc ch02-1.doc
The process runs in the foreground, the output is directed to my screen, and if the ls command wants any input (which it does not), it waits for it from the keyboard.

7.While a program is running in foreground and taking much time, we cannot run any other commands (start any other processes) because prompt would not be available until program finishes its processing and comes out.

8.Background Processes:
A background process runs without being connected to your keyboard. If the background process requires any keyboard input, it waits.
The advantage of running a process in the background is that you can run other commands; you do not have to wait until it completes to start another!
The simplest way to start a background process is to add an ampersand ( &) at the end of the command.

9.$ls ch*.doc &This would also display all the files whose name start with ch and ends with .doc:
ch01-1.doc ch010.doc ch02.doc ch03-2.doc ch04-1.doc ch040.doc ch05.doc ch06-2.doc ch01-2.doc ch02-1.doc
Here if the ls command wants any input (which it does not), it goes into a stop state until I move it into the foreground and give it the data from the keyboard.

10.That first line contains information about the background process - the job number and process ID. You need to know the job number to manipulate it between background and foreground.
If you press the Enter key now, you see the following:
[1] + Done ls ch*.doc & $
The first line tells you that the ls command background process finishes successfully. The second is a prompt for another command.

Source: Power Point Presentations