Thursday, 4 July 2019

Basics of UNIX


Main features of unix :
1.      Multi user -  More than one user can use the machine
2.      Multitasking- More than one program can be run at a time.
3.      Portability – This means  the operating system can be easily converted to run on different browsers.
Commands
ls         
when invoked without any arguments, lists the files in the current working directory. A directory that is not the current working directory can be specified and ls will list the files there. The user also may specify any list of files and directories. In this case, all files and all contents of specified directories will be listed.
Files whose names start with "." are not listed, unless the -a flag is specified or the files are specified explicitly.
Without options, ls displays files in a bare format. This bare format however makes it difficult to establish the type, permissions, and size of the files. The most common options to reveal this information or change the list of files are:
-l    long format, displaying Unix file type, permissions, number of hard links, owner,     group, size, date, and filename
-F    appends a character revealing the nature of a file, for example, * for an executable, or / for a directory. Regular files have no suffix.
-a  lists all files in the given directory, including those whose names start with "." By default, these files are excluded from the list.
-R  recursively lists subdirectories. The command ls -R / would therefore list all files.
cd
Is a command line command used to change the current working directory in the Unix and DOS operating systems. It is also available for use in Unix shell scripts or DOS batch files. cd is frequently included built into certain shells such as the Bourne shell, tcsh, bash (where it calls the chdir() POSIX C function) and in DOS's COMMAND.COM.
A directory is a logical section of a filesystem used to hold files. Directories may also contain other directories. The cd command can be used to change into a subdirectory, move back into the parent directory, move all the way back to the root (/ in UNIX, \ in DOS) or move to any given directory.
pwd
command (print working directory) is used to print the name of current working directory from a computer's command-line interface. If the shell prompt does not already show this, the user can use this command to find their place in the directory tree. This command is found in the Unix family of operating systems and other flavors as well. The DOS equivalent is "CD" with no arguments.
It is a command which is sometimes included built into certain shells such as sh, and bash. It can be implemented easily with the POSIX C functions getcwd() and/or getwd().
Example:
$ pwd
/home/foobar
mkdir
command in the Unix operating system is used to make a new Directory. Normal usage is as straightforward as follows:
mkdir name_of_directory
Where name_of_directory is the name of the directory one wants to create. When typed as above (ie. normal usage), the new directory would be created within the current directory.
rm (short for remove)
is a Unix command used to delete files from a filesystem. Common options that rm accepts include:
-r, which processes subdirectories recursively
-i, which asks for every deletion to be confirmed
-f, which ignores non-existent files and overrides any confirmation prompts ("force")
rm is often aliased to "rm -i" so as to avoid accidental deletion of files. If a user still wishes to delete a large number of files without confirmation, they can manually cancel out the -i argument by adding the -f option.
"rm -rf" (variously, "rm -rf /", "rm -rf *", and others) is frequently used in jokes and anecdotes about Unix disasters. The "rm -rf /" variant of the command, if run by an administrator, would cause the contents of every mounted disk on the computer to be deleted.
rmdir
is a command which will remove an empty directory on a Unix-system. It cannot be capitalized. Normal usage is straightforward where one types:
rmdir name_of_directory
Where name_of_directory corresponds with the name of the directory one wishes to delete. There are options to this command such as -p which removes parent directories if they are also empty.
For example:
rmdir –p foo/bar/baz
Will first remove baz/, then bar/ and finally foo/ thus removing the entire directory tree specified in the command argument.
Often rmdir will not remove a directory if there is still files present in the directory. To force the removal of the directory even if files are present usually the -rf flag can be used. For example:
rmdir -Rf for/bar/baz
cp
is the command entered in a Unix shell to copy a file from one place to another, possibly on a different filesystem. The original file remains unchanged, and the new file may have the same or a different name.
To Copy a File to another File
cp [ -f ] [ -h ] [ -i ] [ -p ][ -- ] SourceFile TargetFile
To Copy a File to a Directory
cp [ -f ] [ -h ] [ -i ] [ -p ] [ -r | -R ] [ -- ] SourceFile ... TargetDirectory
To Copy a Directory to a Directory
cp [ -f ] [ -h ] [ -i ] [ -p ] [ -- ] { -r | -R } SourceDirectory ... TargetDirectory
-f (force) – specifies removal of the target file if it cannot be opened for write operations. The removal precedes any copying performed by the cp command.
-h – makes the cp command copy symbolic links. The default is to follow symbolic links, that is, to copy files to which symbolic links point.
-i (interactive) – prompts you with the name of a file to be overwritten. This occurs if the TargetDirectory or TargetFile parameter contains a file with the same name as a file specified in the SourceFile or SourceDirectory parameter. If you enter y or the locale's equivalent of y, the cp command continues. Any other answer prevents the cp command from overwriting the file.
-p (preserve) – duplicates the following characteristics of each SourceFile/SourceDirectory in the corresponding TargetFile and/or TargetDirectory:
Examples
To make a copy of a file in the current directory, enter:
    cp prog.c prog.bak
This copies prog.c to prog.bak. If the prog.bak file does not already exist, the cp command creates it. If it does exist, the cp command replaces it with a copy of the prog.c file.
To copy a file in your current directory into another directory, enter:
    cp jones /home/nick/clients
This copies the jones file to /home/nick/clients/jones.
To copy a file to a new file and preserve the modification date, time, and access control list associated with the source file, enter:
    cp -p smith smith.jr
This copies the smith file to the smith.jr file. Instead of creating the file with the current date and time stamp, the system gives the smith.jr file the same date and time as the smith file. The smith.jr file also inherits the smith file's access control protection.
To copy all the files in a directory to a new directory, enter:
    cp /home/janet/clients/* /home/nick/customers
This copies only the files in the clients directory to the customers directory.
To copy a directory, including all its files and subdirectories, to another directory, enter:
    cp -R /home/nick/clients /home/nick/customers
This copies the clients directory, including all its files, subdirectories, and the files in those subdirectories, to the customers/clients directory.
To copy a specific set of files to another directory, enter:
    cp jones lewis smith /home/nick/clients
This copies the jones, lewis, and smith files in your current working directory to the /home/nick/clients directory.
To use pattern-matching characters to copy files, enter:
    cp programs/*.c .
This copies the files in the programs directory that end with .c to the current directory, signified by the single . (dot). You must type a space between the c and the final dot.
find
program is a search utility, mostly found on Unix-like platforms. It searches through a directory tree of a filesystem, locating files based on some user-specified criteria. By default, find returns all files below the current working directory. Further, find allows the user to specify an action to be taken on each matched file. Thus, it is an extremely powerful program for applying actions to many files. It also supports regexp matching.
Examples
From current directory
find . -name my\*
This searches in the current directory (represented by a period) and below it, for files and directories with names starting with my. The backslash before the star is needed to avoid the shell expansion. Without the backslash, the shell would replace my* with the list of files whose names begin with my in the current directory. An alternative is to enclose the the arguments in quotes: find . -name "my*"
Files only
find . -name "my*" -type f
This limits the results of the above search to only regular files, therefore excluding directories, special files, pipes, symbolic links, etc. my* is enclosed in quotes as otherwise the shell would replace it with the list of files in the current directory starting with my
Commands
The previous examples created listings of results because, by default, find executes the '-print' action. (Note that early versions of the find command had no default action at all; therefore the resulting list of files would be discarded, to the bewilderment of naïve users.)
find . -name "my*" -type f -ls
This prints an extended file information.
Search all directories
find / -name "myfile" -type f -print
This searches every file on the computer for a file with the name myfile. It is generally not a good idea to look for data files this way. This can take a considerable amount of time, so it is best to specify the directory more precisely.
Specify a directory
find /home/brian -name "myfile" -type f -print
This searches for files named myfile in the /home/brian directory, which is the home directory for the user brian. You should always specify the directory to the deepest level you can remember.
Find any one of differently named files
find . ( -name "*jsp" -or -name "*java" ) -type f -ls
This prints extended information on any file whose name ends with either 'jsp' or 'java'. Note that the parentheses are required. Also note that the operator "or" can be abbreviated as "o". The "and" operator is assumed where no operator is given. In many shells the parentheses must be escaped with a backslash, "\(" and "\)", to prevent them from being interpreted as special shell characters.
touch
is a program on Unix and Unix-like systems used to change a file's date- and time-stamp. It can also be used to create an empty file. The command-syntax is:
touch [options] <file_name>
If the file exists, its access and modification time-stamps are set to the system's current date and time, as if the file had been changed. To touch a file simulates a change to the file. If the file does not exist, an empty file of that name is created with its access and modification time-stamps set to the system's current date and time. If no file path is specified, the current directory is assumed.
touch can be invoked with options to change its behaviour, which may vary from one Unix to another. One option makes it possible to set the file's time-stamp to something other than the current system date and time, but this action is normally restricted to the owner of the file or the system's superuser.
echo
is a command in Unix (and by extension, its descendants, such as Linux) and MS-DOS that places a string on the terminal. It is typically used in shell scripts and batch programs to output status text to the screen or a file.
$ echo This is a test.
This is a test.
$ echo "This is a test." > ./test.txt
$ cat ./test.txt
This is a test.
cat
program concatenates the contents of files, reading from a list of files and/or standard input in sequence and writing their contents in order to standard output. cat takes the list of files as arguments but also interprets the argument "-" as standard input.
 Example:          cat  filename
who                         
The Unix command who displays a list of users who are currently logged into a computer. The command accepts various options that vary by system to further specify the information that is returned, such as the length of time a particular user has been connected or what pseudo-teletype a user is connected to. The who command is related to the command w, which provides the same information but also displays additional data and statistics.
Example output         
user19    pts/35       Apr 18 08:40    (localhost)
user28    pts/27       Apr 18 09:50    (localhost)
du (abbreviated from disk usage)
is a Unix computer program to display the amount of disk space used under a particular directory or files on a file system.
du counts the disk space by walking the directory tree. As such, the amount of space on a file system shown by du may vary from that shown by df if files have been deleted but their blocks not yet freed.
In Linux, it is a part of the GNU Coreutils package.
The du utility first appeared in version 1 of AT&T UNIX.
Example
The -k flag will show the sizes in 1K blocks, rather than the default of 512 byte blocks.
$du -k /seclog
4       /seclog/lost+found
132     /seclog/backup/aix7
136     /seclog/backup
44044   /seclog/temp
439264  /seclog

Tuesday, 2 July 2019

Daily news 2-july-2019


National News


1. Jal Shakti Abhiyan
i. Union Jal Shakti Minister has launched a water conservation campaign 'Jal Shakti Abhiyan' , with an emphasis on 1592 stressed blocks in 256 districts. 
ii. The campaign will run through citizen participation during the monsoon 1st July-15th September. An additional phase II will run from 1st October-30th November for states receiving the northeast retreating monsoons.
iii. The campaign will focus on five aspects: water conservation and rainwater harvesting, renovation of traditional and other water bodies, reuse of water and recharging of structures, watershed development, and intensive afforestation.
Static/Current Takeaways Important For RRB NTPC/IBPS RRB Mains:

Union Jal Shakti Minister of India: Gajendra Singh Shekhawat.



2. India to contribute USD 5M in 2019 to UN Palestine refugee agency
i. India has pledged to contribute USD 5 Million in 2019 to the UN Palestine refugee agency. 
ii. The Indian Government is assisting 150 Palestinian professionals every year under the Indian Technical and Economic Cooperation programme. 
Static/Current Takeaways Important For SBI PO/Clerk Mains:

Palestine Capital: Ramallah & East Jerusalem.



3. High Powered Committee for ‘Transformation of Indian Agriculture’
i. Prime minister has constituted a high powered committee of chief ministers for transforming Indian agriculture and raising farmers’ income.
ii. Maharashtra chief minister will be the convenor of the committee. The committee has been asked to submit its report within two months.
iii. The other members of the committee include:

H.D. Kumaraswamy, Chief Minister, Karnataka





Manohar Lal Khattar, Chief Minister, Haryana





Pema Khandu, Chief Minster, Arunachal Pradesh





Vijay Rupani, Chief Minster, Gujarat





Yogi Adityanath, Chief Minister, Uttar Pradesh





Kamal Nath, Chief Minister, Madhya Pradesh





Narendra Singh Tomar, Minister, Agriculture Rural Development and Panchyati Raj.





NITI Aayog member Ramesh Chand will be the member secretary of the committee.



Static/Current Takeaways Important For SBI PO/Clerk Mains:

Chief Minister of Maharashtra : Devendra Fadnavis.





International News


4. New Zealand bans single-use plastic shopping bags
i. New Zealand has officially banned single-use plastic shopping bags. Under the new rules, thin plastic single-use shopping bags can no longer be supplied, but reusable carriers are allowed.
ii. Companies that break the ban will face heavy penalties, including fines of up to 100,000 New Zealand dollars.
Static/Current Takeaways Important For EPFO/LIC ADO Mains:

New Zealand Capital: Wellington, Currency: New Zealand dollar.



5. ISALEX19 Exercise Kicks-off in Abu Dhabi
i. The International Security Alliance’s first Joint Exercise ISALEX19 started in Abu Dhabi.
ii. The exercise is hosted by the UAE Ministry of Interior (MoI).
iii. The exercise witnessed the participation of 50 representatives from law enforcement agencies of the International Security Alliance (ISA) countries.
Static/Current Takeaways Important For ESIC:

Headquarters of International Security Alliance: Abu Dhabi, UAE.





Founded: February 2017.





Defence


6. AFSPA extended in Nagaland till december end
i. Ministry of Home Affairs have extended The Armed Forces (Special Powers) Act (AFSPA) for another six months in Nagaland
ii. The Act is implemented with effect from June 30 and will be in force till December end.
Static/Current Takeaways Important For ESIC:

Union Home Minister of India: Amit Shah.





Awards


7. NALCO to get President’s award for excellent CSR
i. National Aluminium Company Limited has been selected for President's award for utilisation of Corporate Social Responsibility fund in social development.
ii. NALCO started a scheme "Aliali Jhia" in 2015 to promote the education of Girls of BPL families. NALCO is an Odisha based Navaratna Company.
Static/Current Takeaways Important For ESIC:

Chairman cum Managing Director of NALCO: T.K. Chand.



8. Sports Journalists Federation of India 2019 Awards
Sports Journalists Federation of India 2019 Awards: 

SJFI Medal (Highest Honour): Prakash Padukone (Badminton).





Sportsperson of the Year Award: Pankaj Advani (Billiards and Snooker) and Bajrang Punia (Wrestling).





Emerging Talent of the Year Award: Saurabh Choudhary (Shooting).





Team of the Year Award: Vidarbha Cricket Team.





Appointments


9. P.K. Purwar appointed as the CMD of BSNL
i. The GoI has appointed MTNL CMD P.K. Purwar as the  Chairman and Managing Director of Bharat Sanchar Nigam Ltd. He has been appointed for a period of three months starting July 1.
ii. He will replace Anupam Shrivastava as the CMD of BSNL.
Static/Current Takeaways Important For RRB NTPC/IBPS RRB Mains:

Union Minister of Communications and Electronics & Information Technology: Ravi Shankar Prasad.





Agreements


10. SBI, NIIF in pact for funding infrastructure projects
i. The State Bank of India has signed a memorandum of understanding with National Investment and Infrastructure Fund to boost availability of capital for infrastructure projects. 
ii. The scope of the agreement includes equity investments, project funding, bond financing, renewable energy support and take-out finance for operating assets.
Static/Current Takeaways Important For ESIC:

SBI Chairperson: Rajnish Kumar, Headquarters: Mumbai, Founded: 1 July 1955.





MD & CEO of National Investment and Infrastructure Fund: Sujoy Bose.





Sports News  


11. Indian Pro Boxer Wins WBC Asia Title
i. Indian pro boxer Vaibhav Yadav has become the WBC Asia Silver Welterweight Champion. He defeated Thailand's Fahpetch Singmanassak in the title bout held in Pattaya, Thailand.
ii. The fight was conducted by the Asian Boxing Council and approved by the World Boxing Council (WBC).
Static/Current Takeaways Important For EPFO/LIC ADO Mains:

Thailand Capital: Bangkok, Currency: Baht.





Obituaries


12. Professional motorcycle racer, Carlin Dunne passes away
i. Professional motorcycle racer, Carlin Dunne passes away. 
ii. He unfortunately suffered a fatal crash during Ducati Streetfighter V4 prototype run at Pikes Peak Hill Climb. He was also known as “The King of the Mountain”.


Daily news 1-june-2019


National News



1. ‘Tribes India’ & ‘Go Tribal Campaign’ of Tribes India launched
i. The Minister of State for Tribal Affairs launched the following campaigns for the Tribes of India in New Delhi:

‘Go Tribal Campaign’ of Tribes India launched to promote the use of tribal handicrafts, handicrafts and natural products.





‘Tribes India’ launched globally through Amazon Global Selling to step up Exports of Tribal Products.



Static/Current Takeaways Important For ESIC Mains:

Minister of State for Tribal Affairs: Renuka Singh.





Brand Ambassador of Tribes India: MC Mary Kom.



2. ‘One nation one ration card’ scheme from July 1, 2020
i. ‘One Nation One Ration Card’ scheme will be available across the country from July 1, 2020. 
ii. The scheme will allow portability of food security benefits according to which the poor migrant workers will be able to buy subsidised rice and wheat from any ration shop in the country as long as their ration cards are linked to Aadhaar.
Static/Current Takeaways Important For EPFO/LIC ADO Mains:

Union Minister for Consumer Affairs, Food and Public Distribution: Ram Vilas Paswan.



3. Money in Swiss banks: India ranked 74
i. According to the Swiss National Bank (SNB)India has moved down one place to 74th rank in terms of money parked by its citizens and enterprises with Swiss banks
ii. U.K. has retained its top position.
iii. India was ranked 73rd last year, after jumping from its 88th rank a year ago.
4. UGC approves a scheme "STRIDE" to boost research culture in India
i. University Grants Commission has approved a ‘Scheme for Trans-disciplinary Research for India’s Developing Economy’ to boost research culture in India. 
ii. It will provide support to research projects that are socially relevant, locally need-based, nationally important and globally significant.
iii. An Advisory Committee has been set up by the UGC under the chairmanship of Prof Bhushan Patwardhan to oversee the entire scheme.
iv. Objectives of STRIDE:

To identify young talent, strengthen research culture, build capacity, promote innovation and support trans disciplinary research for India’s developing economy and national development.





To fund multi institutional network high impact research projects in humanities and human sciences.





Banking/Economy News



5. No charges on NEFT, RTGS money transfers from 1 July
i. As per Second Bi-monthly Monetary Policy Statement for 2019-20, the Reserve Bank of India will stop imposing additional charges on Fund transfer through RTGS and NEFT systems from 1st July, 2019
ii. This has been done to provide an impetus to digital funds movement.
Static/Current Takeaways Important For RRB NTPC/IBPS RRB Mains:

RBI 25th Governor: Shaktikant Das, Headquarters: Mumbai, Founded: 1 April 1935, Kolkata.





The real time gross settlement (RTGS) system is meant for large value instantaneous fund transfers and the national electronic funds transfer (NEFT) system is used for fund transfers of up to Rs 2 lakh.





State News



6. Tamil yeoman declared Tamil Nadu's state butterfly
i. Tamil yeoman (Cirrochroa thais) butterfly has been declared the state butterfly of Tamil Nadu
ii. These butterflies are also known as Tamil Maravan, which means warrior,  are found mainly in the hilly areas.
iii. Tamil Nadu is only the fifth state in the country to declare its state butterfly.
Static/Current Takeaways Important For RRB NTPC/IBPS RRB Mains:

Tamil Nadu Capital: Chennai, CM: Edappadi K. Palaniswami, Governor: Banwarilal Purohit.





Sports News  



7. Max Verstappen wins Austrian Grand Prix
i. Red Bull’s Max Verstappen won the Austrian Grand Prix for the second year in a row while champion Mercedes lost for the first time in this season.

Appointments



8. K. Natarajan has sworn in as the 23rd chief of ICG
i. K. Natarajan took over as the Director-General of the Indian Coast Guard (ICG). He has become the 23rd chief of India’s coastal security force. He took over from Rajendra Singh.

Important days



9. 2nd anniversary of GST to be celebrated today as "GST Day"
i. India will celebrate 1st July as the "Goods & Services Tax DAY". This year, it is the second anniversary of the implementation of historic tax reform of Goods & Services Tax.
ii. The introduction of GST in the Indian economy has replaced a multi-layered, complex indirect tax structure with a simple, transparent and technology-driven tax regime.
Static/Current Takeaways Important For ESIC:

GST was launched on 1st July 2017 in New Delhi. 





Chairperson of GST Council: Union Finance Minister of India.



10. National Doctors' Day: 1 July
i. India observe 1st July as the National Doctors' Day. The day is celebrated to recognize the contributions of physicians to individual lives and communities.
ii. National Doctor's Day is also celebrated to honour the legendary physician Dr. Bidhan Chandra Roy
iii. Dr Roy was honoured with the country's highest civilian award, Bharat Ratna on February 4, 1961.
11. International Day of Parliamentarism: 30 June
i. The United Nations observe 30 June as the International Day of Parliamentarism. This day celebrates parliaments and the ways in which parliamentary systems of government improve the day to day lives of people around the world.
ii. This day also acknowledges the formation of the Inter Parliamentary Union, the global organization of parliaments which was established in 1889.
Static/Current Takeaways Important For SBI PO/Clerk Mains:

United Nations Headquarters in New York, USA. It was founded on 24 October 1945.





Mr Antonio Guterres is the Secretary General of the United Nations.



12. International Asteroid Day: 30 June
i. The United Nations observe 30 June as International Asteroid Day. 
ii. The day is celebrated to raise public awareness about the asteroid impact hazard and to inform the public about the crisis communication actions to be taken at the global level in case of a credible near Earth object threat.