Kamis, 17 Februari 2011

file management in linux

Most of the files, just an ordinary file called regular file that contains the normal data as an example of text files, executable files, or programs, input or output of the program and others. In addition to regular file there specific files as follows:


* Directories: files that contain lists of other files.
* Special files: the mechanism used for input and output. Most are in the directory / dev.
* Links: System to create files or directories can be seen in banayk part of the system file tree.
* (Domain) sockets: a special file type, similar to the sockets TCP / IP, which provides inter-process networking protected by the file system's access control.
* Named pipes: to function more or less like sockets and form a path for the communication process.


· Absolute Paths


An absolute path at the start of the root (/), and the name of the directory will be

into being in it, for example ls which is actually located in the directory:

/ Bin / ls


So to run the ls command using the absolute path ie

by:


[Josh @ josh slashsmart] $ / bin / ls


We can also use ls to display files in a directory

with absolute path:


[Josh @ josh slashsmart] $ ls / usr / share / doc /


· Current Directory

To find the directory where the guess is right now, use the pwd command:


[Josh @ josh slashsmart] $ pwd / home / josh


To change directory cd command we use:


[Josh @ josh slashsmart] $ cd / var / log /

[Josh @ slashsmart log] $ pwd / var / log


To return to our home directory, use the cd command without any options or paths followed.


· Create and Delete Directories


To create a directory use mkdir followed by name of the directory

want to be made:


[Josh @ josh slashsmart] $ mkdir list


Keep in mind the system of unix / linux in general we are allowed to create / delete directories or menulisinya only in our home directory. To remove use rmdir. This command only if the directory is a directory that will be removed empty (no files or other directories in it):


[Josh @ josh slashsmart] $ rmdir list


To delete a directory that has a file or directory, use rm

followed by the options r:


[Josh @ josh slashsmart] $ rm r list


Be careful using this command because the system unix / linux there is no recycle

bin or undelete command


· Relative Paths


To enter a directory we do not have to start from the root directory (/) or

with relatively path.Jadi katalain we use depends on the directory where

we were at that time.

For example:


[Josh @ josh slashsmart] $ cd /

[Josh @ slashsmart /] $ cd usr

[Josh @ slashsmart usr] $ cd share

[Josh @ slashsmart share] $


· Special Dot Direktories


There are two special directories using a dot in the system unix / linux:



First the directory .. which indicates the parent directory or the directory above us.


[Josh @ josh slashsmart] $ cd ..

[Josh @ slashsmart home] $ pwd

/ Home

[Josh @ slashsmart home] $ cd ..

[Josh @ slashsmart /] $ pwd

/


Both directories. which shows the directory where we are.


[Josh @ josh slashsmart] $ cd. / Mail


tantamount to


[Josh @ josh slashsmart] $ cd Mail


· Hidden Files and Directories


A special directory. and .. is a hidden directory, to view it

use ls with the option a.


[Josh @ josh slashsmart] $ ls a

. /. Bash_logout

.. /. Bash_profile

. Bash_history. Bashrc

public_html /


As an omen, all files beginning with terhidden. , Usually hidden files are configuration files.


Path to Home Directories

·

Symbols used in the ~. To enter the directory that is at home

we can use:


[Josh @ slashsmart etc] $ cd / home / josh / public_html


tantamount to:


[Josh @ slashsmart etc] $ cd ~ / public_html


To enter the other user's home (eg on my system, there are other users by name

lognight, we use the sign in front till the user name:

Tidak ada komentar:

Posting Komentar