IMPORTANT DIRECTORIES AND COMMANDS IN LINUX

From GluCki
Jump to: navigation, search

Directory Structure

1. Files are put in a directory.

2. All directories are in a hierarchical structure (tree structure).

3. User can put and remove any directories on the tree.

4. Top directory is “/”, which is called slash or root.

5. Users have the own directory. (home directory)

Important Directories

/bin

This contains files that are essential for correct operation of the system. These are available for use by all users.

/mnt

Provides a location for mounting devices,such as remote filesystems and removable media

/home

This is where user home directories are stored.

/var

This directory is used to store files which change frequently, and must be available to be written to.

/etc

Various system configuration files are stored here.

/dev

This contains various devices as files, e.g. hard disk, CDROM drive, etc.

/root

This is the root (administrator) user's home directory.

/sbin

Binaries which are only expected to be used by the super user.

/tmp

Temporary files.

/boot

Has the bootable Linux kernel and boot loader configuration files(GRUB).

/usr

Contains user documentation,games,graphical files,libraries(lib),etc..


Basic Commands

One command consists of three parts, i.e. command name, options, arguments.

Example:- [cswug~]$ commandname optionA optionB argument1 argument2

How to run commands

1. Between command name, options and arguments, space is necessary.

2. Opitions always start with “”

  Example:-
  cd ..
  ls –l .bashrc
  mv fileA fileB

Commands

ls

show files in current position

cd

change directory

cp

copy file or directory

mv

move file or directory

rm

remove file or directory

pwd

show current position

mkdir

create directory

rmdir

remove directory

cat

display file contents

less

display file contents pagewise

man

display online manual

su

switch user

passwd

change password

useradd

create new user account

userdel

delete user account

mount

mount file system

umount

unmount file system

df

show disk space usage

shutdown

reboot or turn off machine