Linux Concepts : Level 2

Linux Concepts : Level 2

  • The maximum size of a file is limited by a parameter called ULIMIT that is part of the configuration of the kernel
  • The superuser may impose a quota of the total file space a user's files can accept

A buffer is a region of computer memory that holds a portion of the data in a file after that portion has been read form the file or before that portion is written to to the file.

Editor Buffers:

Editors such as vi,ed and emacs use a buffer to hold the contents of a file while it is being edited. The basic editing cycle is as follows:

  1. Read a file into a buffer
  2. Edit a file
  3. Write the contents of the buffer back to the file

File permissions in Linux:

The three basic operations ona file are "reda", " write" , "execute". The permission required to perform theses operations are denoted by "r","w" and "x". The x permission is needed for compiled programs and for for any shell script that you intend to use directly as a comaand For instance, if the file gaurav contains a sheell script but lacks the x (execute) permission, you can't give the command $gaurav
File permissions also apply to directories
  • The set-uid bit enables a program to run with the permissions of its owner rather than the permissions of the user who called it
  • The set-gid bit is like the set-uid bit except that it applies to group permissions rather than owner permissions
  • The Locking bit: If a file's locking bit is on, a program is reading or writing a file, can lock out other attempts to access that file at the same time
  • Sticky bit: Applied to a directory, the sticky bit prevents files in that directory from being deleted or renamed by anyone other than their owner( or the superuser)

How to print envirionment variables on the command prompt window: echo $PATH The $ sign tells the system that the PATH enviroment variable will be displayed. in Linux Ubuntu, The PATH variablen is a colon delimited string having path of special programs like Java, node.js, etc. Whenwewvera kernel wants to run a "java" program, the kernel searches fior the executable biary of the program in one of the path(s) in the PATH environmwnt variable So, Whenever you install a new pavckage in LInux Ubunutu, ypu should append its binary folder to the existing PATH vqariable4 export PATH=$PATH:/home/gaurav/xyz/bin This will append "/hojme/gaurafv/xyz/bin" to teh PATH emnvironmnet variable
A symbolic link specifies a pathname. If that pathname designates an actual file, then the symbolic link refers to tha You can create a symbolic link by issuing the command: ln -s target source where, target is the pathname of the file you wish to reference with the symbolic libk itself

Conventions for naming directories:

/usr:-
Contains subdirectories of interest to users

/bin:-
Contains executable versions of sytem utilities and other user commands

/sbin:-
Contains executable programs used to when you are system starts up and for manual recovery from A system failure

/dev:-
Contains files that correspond to external devices such as printers.
/etc:-
Contains installation-specific files,. such as the password ( file /etc/passwd) that are required for ssytem administrator. It contains configuration files and directories for diffderent programs

/home:-
Often used for the home directories of individual users

/lib:- or /usr/lib:-
Contains compiled C subprogram libraries

/usr/local:-
Contains a collection of subdirectories that partially mirror the top-level structure and contains installation-specific files

/usr/src:-
Contains Linux source files, that is, the text of the C programs that come with your system

/usr/include:-
Contains header files for C programs

/usr/share:-
Contains platform-indepenedent textual information such as manual pages, run-time databases, and source files

/usr/sbin:-
Contains executable programs used for system administration ina sytem that is running normally

/usr/tmp:-
An alternative to /tmp

/tmp:-
Contaons temporary files created by various programs as they are operating

/var:-
Contaiin administrative files that often change or are in transit, such as files awaiting printing, mail messages, and log files

/var/adm:- and /usr/adm:-
Contain accoutning information ,diagnostic files generated at the time of system crashes, and similar information needed by system administrators

/var/spool:- and /usr/spool:-
Contains spool files, that is, temporary files awaiting processing.These include files to be printed, administrative logs, files to be sent to other computers, and files received from other computers that are waiting to bve picked up by users

/proc:-
Conatins active system processes by number, amemory image fo teh machine, and otherv "pseudo-files" that don't represent stored information but are usefully treated as though they did

/stand:- and /kernel:-
Contains the system kernel

Pipelining commands

You can use the output of one command as the input of another using the pipe(|) between them.
For example,
grep "pest" phones | sort
calls the program grep which extracts from the file phones all lines containing the string "pest" and produces these lines as a standard output. The output is then piped to sort, which sees that output as its standard input. The output of the entire command line is a sorted list of the lines in phone containing 'pest'

Comments

Popular posts from this blog

Laravel | PHP | Basics | Part 2

Apache Hadoop | Running MapReduce Jobs

Parallel Database design, query processing