❌

Normal view

There are new articles available, click to refresh the page.
Before yesterdayMain stream

Features of Java

By: Elavarasu
7 March 2024 at 14:40

1. Java is simple:

Java is a simple programming language. Because syntax is derived from C & C++ language. Java has removed some complex topics like Pointers, Operator Overloading, and Multiple Inheritance explicit memory allocation. Java has an Automatic Garbage Collection.

2. Java is Robust :

  • Java is Robust which means Strong | Reliable
  • It uses strong memory management.
  • Java provides automatic garbage collection which runs on the JVM to get rid of objects that are not being used by a Java application anymore.
  • There is exception handling and the type checking mechanism in Java
  • It is developed in such a way that it puts a lot of effort into checking errors as early as possible, which is why the Java compiler can detect even those errors that are not easy to detect by another programming language.

3. Java is Platform Independent :

Operating System – Os is interface between Human Being and Machine. Platform is nothing but Processor + Os .

  • Java has two level translation – Compilation and Interpretation.
  • Java Development Kit – JDK
  • Compiler is the part of jdk. Error checking mechanism is also present in jdk.
  • First jdk will check the error. If in case error is present in the code compilation is not allowed. So translator need error free file for translation process.
  • .Java file is converted into .classfile using JDK. It will check whole file into single run. Classfile is otherwise called Bytecode.
  • This byte code or .Classfile is Platform Independent code. Because .classfile is common for all the Platform(Os).
  • Java virtual machine – JVM . Jit compiler is part of JVM
  • JVM is part of JRE – Java Runtime Environment.
  • .Class file is converted into binary code using interpreter. It will check line by line. Binary code is otherwise known as Machine code.
  • This compilation is Platform Dependent conversion.
  • Jit compiler : Just in time compiler. Converting Byte code into Binary code.

Reference :

https://www.geeksforgeeks.org/java

https://www.javatpoint.com/features-of-java

Features of Java

By: Elavarasu
7 March 2024 at 14:40

1. Java is simple:

Java is a simple programming language. Because syntax is derived from C & C++ language. Java has removed some complex topics like Pointers, Operator Overloading, and Multiple Inheritance explicit memory allocation. Java has an Automatic Garbage Collection.

2. Java is Robust :

  • Java is Robust which means Strong | Reliable
  • It uses strong memory management.
  • Java provides automatic garbage collection which runs on the JVM to get rid of objects that are not being used by a Java application anymore.
  • There is exception handling and the type checking mechanism in Java
  • It is developed in such a way that it puts a lot of effort into checking errors as early as possible, which is why the Java compiler can detect even those errors that are not easy to detect by another programming language.

3. Java is Platform Independent :

Operating System – Os is interface between Human Being and Machine. Platform is nothing but Processor + Os .

  • Java has two level translation – Compilation and Interpretation.
  • Java Development Kit – JDK
  • Compiler is the part of jdk. Error checking mechanism is also present in jdk.
  • First jdk will check the error. If in case error is present in the code compilation is not allowed. So translator need error free file for translation process.
  • .Java file is converted into .classfile using JDK. It will check whole file into single run. Classfile is otherwise called Bytecode.
  • This byte code or .Classfile is Platform Independent code. Because .classfile is common for all the Platform(Os).
  • Java virtual machine – JVM . Jit compiler is part of JVM
  • JVM is part of JRE – Java Runtime Environment.
  • .Class file is converted into binary code using interpreter. It will check line by line. Binary code is otherwise known as Machine code.
  • This compilation is Platform Dependent conversion.
  • Jit compiler : Just in time compiler. Converting Byte code into Binary code.

Reference :

https://www.geeksforgeeks.org/java

https://www.javatpoint.com/features-of-java

Id | Sudo | Su

By: Elavarasu
29 February 2024 at 13:58

To know the user is using id command

id username

sudo

permits the user to execute a command as a super user at the admin level


su

su --> switch user
su -username
id
exit

Zip

zip filename file
zip filename *.txt
zip -sf filename.zip
to view the zipped file.

unzip

unzip filename 

to make another directory to unzip the file or rename the exisisting file.


ulimit

to manage the resources of the particular user.

ulimit -a

soft limit cannot more than hard limit

cat  /etc/security/limits.conf

type> can have the two values:

-β€œsoft” for enforcing the soft limits

– β€œhard” for enforcing hard limits


type

to know where the command it will present

type command

which 

where the command will locate

which mv


whatis

to know the description of the command


whereis

locate the binary, source, and manual page files for a command


apropos

search the manual page names and descriptions


change attribute

which makes the file unchangeable in the same location. but will copy the file in another location and edit the file.

sudo chattr +i filename
lsattr
sudo chattr -i file

it will convert unchangeable file to changeable file

sudo chattr -R +i dir1
sudo chattr -R -i dir1

to change the directory to unmutable


pid | pwdx

By: Elavarasu
29 February 2024 at 08:06
pidof ---> find the process ID of running program
vi test --> new process
ps -ef | grep vi
pidof vi
pwdx 8279
to know the present working directory of vi using pid.

nice value

NI –> (-20 to 19) highest priority to lowest priority range.

1 to 19 –> non root users will aslo set the ni values

-20 to -1 –> root user only set the value

to modify the program priority.
ps -l --> process list
to change the priority of the running program
nice -n 11 ps -l

renice

changing the priority of the running program.


user-management

useradd

create a new user or update default new user information.

tail /etc/passwd –> userslist

adduser –> adduser, addgroup – add a user or group to the system

sudo passwd sample
to set a password for sample user.
sudo passwd -Sa
to check all the users having password or not.
set a password for the sample user

after setting the passwd for sample user

sudo passwd -d sample
d --> delete
NP --> no passwd

user-delete

sudo userdel sample
sudo userdel -r sample --> to delete with home

Group

to create group with user

to create a group

addgroup :

deletegroup :

sudo groupdel groupname
sudo delgroup groupname
sudo usermod -aG sudo username
permission to using i commands for new user
to give sudo or root previlage for new user.

Id | Sudo | Su

By: Elavarasu
29 February 2024 at 13:58

To know the user is using id command

id username

sudo

permits the user to execute a command as a super user at the admin level


su

su --> switch user
su -username
id
exit

Zip

zip filename file
zip filename *.txt
zip -sf filename.zip
to view the zipped file.

unzip

unzip filename 

to make another directory to unzip the file or rename the exisisting file.


ulimit

to manage the resources of the particular user.

ulimit -a

soft limit cannot more than hard limit

cat  /etc/security/limits.conf

type> can have the two values:

-β€œsoft” for enforcing the soft limits

– β€œhard” for enforcing hard limits


type

to know where the command it will present

type command

which 

where the command will locate

which mv


whatis

to know the description of the command


whereis

locate the binary, source, and manual page files for a command


apropos

search the manual page names and descriptions


change attribute

which makes the file unchangeable in the same location. but will copy the file in another location and edit the file.

sudo chattr +i filename
lsattr
sudo chattr -i file

it will convert unchangeable file to changeable file

sudo chattr -R +i dir1
sudo chattr -R -i dir1

to change the directory to unmutable


pid | pwdx

By: Elavarasu
29 February 2024 at 08:06
pidof ---> find the process ID of running program
vi test --> new process
ps -ef | grep vi
pidof vi
pwdx 8279
to know the present working directory of vi using pid.

nice value

NI –> (-20 to 19) highest priority to lowest priority range.

1 to 19 –> non root users will aslo set the ni values

-20 to -1 –> root user only set the value

to modify the program priority.
ps -l --> process list
to change the priority of the running program
nice -n 11 ps -l

renice

changing the priority of the running program.


user-management

useradd

create a new user or update default new user information.

tail /etc/passwd –> userslist

adduser –> adduser, addgroup – add a user or group to the system

sudo passwd sample
to set a password for sample user.
sudo passwd -Sa
to check all the users having password or not.
set a password for the sample user

after setting the passwd for sample user

sudo passwd -d sample
d --> delete
NP --> no passwd

user-delete

sudo userdel sample
sudo userdel -r sample --> to delete with home

Group

to create group with user

to create a group

addgroup :

deletegroup :

sudo groupdel groupname
sudo delgroup groupname
sudo usermod -aG sudo username
permission to using i commands for new user
to give sudo or root previlage for new user.

MariaDb

By: Elavarasu
27 February 2024 at 11:22
sudo apt install mariadb-server mariadb-client

sudo systemctl status mariadb.servcie

to check the mariadb services.

sudo systemctl enable mariadb.service
sudo systemctl start mariadb.service
sudo systemctl stop mariadb.service
sudo mysql_secure_installation

enter into the database using

mysql -u root -p

to view the default databases which present in mariadb using

show databases;
create new database using 
create database name;
show created database
show databases:
to use the exsisting database
use databasename;

MariaDb

By: Elavarasu
27 February 2024 at 11:22
sudo apt install mariadb-server mariadb-client

sudo systemctl status mariadb.servcie

to check the mariadb services.

sudo systemctl enable mariadb.service
sudo systemctl start mariadb.service
sudo systemctl stop mariadb.service
sudo mysql_secure_installation

enter into the database using

mysql -u root -p

to view the default databases which present in mariadb using

show databases;
create new database using 
create database name;
show created database
show databases:
to use the exsisting database
use databasename;

Join

By: Elavarasu
25 February 2024 at 15:57
join file1 file2

join lines of two files on a common field. if no common fields are there then error should be occurs.

join -1 2 -2 1 s3.txt s4.txt

print unpairable lines using column number where FILE NUM is 1 or 2, corresponding to FILE1 or FILE2.


File

to determine the file type.

file filename
file -b filename
b --> brief
file *

it display all the file type including directory.


touch

It will create a empty file the it will change the time snap.

touch filename
touch file{1..20}.txt

It will create 20 empty files. file size are user defined we can create more files.

touch -d tomorrow filename

It will change the day

touch -r s1.txt s2.txt
r --> reference

time reference from s1.txt


Calendar

It display calendar


Reverse

Reverse the character


Redirection

> output Redirection | < input redirection

cat > filename
it will create a new file and we can give input to the file
cat < filename
it will display the file content
 wc < text.txt > text1.txt
cat < text1

it will save the wc of the file to file1
cat >> filename
adding the content to exisiting file
>> append

Tee

tee – read from standard input and write to standard output and files

df -Th | tee df.txt

Grep

grep – print lines that match patterns

grep "word" filename
grep "word" file1 file2
grep -i "word" file1 file2

Join

By: Elavarasu
25 February 2024 at 15:57
join file1 file2

join lines of two files on a common field. if no common fields are there then error should be occurs.

join -1 2 -2 1 s3.txt s4.txt

print unpairable lines using column number where FILE NUM is 1 or 2, corresponding to FILE1 or FILE2.


File

to determine the file type.

file filename
file -b filename
b --> brief
file *

it display all the file type including directory.


touch

It will create a empty file the it will change the time snap.

touch filename
touch file{1..20}.txt

It will create 20 empty files. file size are user defined we can create more files.

touch -d tomorrow filename

It will change the day

touch -r s1.txt s2.txt
r --> reference

time reference from s1.txt


Calendar

It display calendar


Reverse

Reverse the character


Redirection

> output Redirection | < input redirection

cat > filename
it will create a new file and we can give input to the file
cat < filename
it will display the file content
 wc < text.txt > text1.txt
cat < text1

it will save the wc of the file to file1
cat >> filename
adding the content to exisiting file
>> append

Tee

tee – read from standard input and write to standard output and files

df -Th | tee df.txt

Grep

grep – print lines that match patterns

grep "word" filename
grep "word" file1 file2
grep -i "word" file1 file2

Format | Head |Tail

By: Elavarasu
22 February 2024 at 14:49
fmt filename

collecting all the words and making it us a paragraph

fmt -u filename

Removing unwanted spaces and making it us a paragraph


Head

head filename
head filename1 filename2

it display first 10 values. because default value is 10

head -q filename filname2

it display first 10 values in each file and name cannot be displayed.


Tail

tail -n 3 filename

It display last 3 values

tail -f filename

it will display realtime values


Numbering

nl filename

It will display the content with numbers and only used for numbering purpose.

nl -s "/" filename

to add a string using -s .


Split

split filename

It will split the content then create new file and it will save the splitted content into the new file.

split -l2 tech.txt split1.txt

It will split the content with two lines then create the new file and saved it into the splitted content.


Tac

 tac filename

it will reverse the content


Last

last 

displays a list of all users logged in (and out) since that file was created.


Translate

tr

Translate, squeeze, and/or delete characters from standard input, writing to standard output.

tr [a-z] [A-Z] < tech.txt | head -n 3 > translated.txt

Sed

sed β€˜s/unix/linux/’ sample1.txt

sed  's/unix/linux/g'  sample1.txt

stream editor for filtering and transforming text.A stream editor is used to perform basic text transformations on an input stream (a file or input from a pipeline). g –> globally change the content without g it will change only first word. s -> search.


Paste

paste -d "||" state.txt tech.txt | head -n 3

Merge lines of files. Write lines consisting of the sequentially corresponding lines from each FILE, separated by TABs, to standard output.

d –> delimeter , β€œ|” it seperate the two merged files.

terminal

By: Elavarasu
22 February 2024 at 00:31
hostname -i

It displays host-id

hostname

It display hostname

$ --> it represent home
# --> it represent root
sudo su -

redirect to the root user

cd ~

to change history size using shell

which $SHELL

to know which shell is used.

vim ~/.bashrc
edit the history size and modify it.
press tab to auto fill the command
ls -a

to display the hidden files

ls -lah

to display hidden files with human readable

Format | Head |Tail

By: Elavarasu
22 February 2024 at 14:49
fmt filename

collecting all the words and making it us a paragraph

fmt -u filename

Removing unwanted spaces and making it us a paragraph


Head

head filename
head filename1 filename2

it display first 10 values. because default value is 10

head -q filename filname2

it display first 10 values in each file and name cannot be displayed.


Tail

tail -n 3 filename

It display last 3 values

tail -f filename

it will display realtime values


Numbering

nl filename

It will display the content with numbers and only used for numbering purpose.

nl -s "/" filename

to add a string using -s .


Split

split filename

It will split the content then create new file and it will save the splitted content into the new file.

split -l2 tech.txt split1.txt

It will split the content with two lines then create the new file and saved it into the splitted content.


Tac

 tac filename

it will reverse the content


Last

last 

displays a list of all users logged in (and out) since that file was created.


Translate

tr

Translate, squeeze, and/or delete characters from standard input, writing to standard output.

tr [a-z] [A-Z] < tech.txt | head -n 3 > translated.txt

Sed

sed β€˜s/unix/linux/’ sample1.txt

sed  's/unix/linux/g'  sample1.txt

stream editor for filtering and transforming text.A stream editor is used to perform basic text transformations on an input stream (a file or input from a pipeline). g –> globally change the content without g it will change only first word. s -> search.


Paste

paste -d "||" state.txt tech.txt | head -n 3

Merge lines of files. Write lines consisting of the sequentially corresponding lines from each FILE, separated by TABs, to standard output.

d –> delimeter , β€œ|” it seperate the two merged files.

terminal

By: Elavarasu
22 February 2024 at 00:31
hostname -i

It displays host-id

hostname

It display hostname

$ --> it represent home
# --> it represent root
sudo su -

redirect to the root user

cd ~

to change history size using shell

which $SHELL

to know which shell is used.

vim ~/.bashrc
edit the history size and modify it.
press tab to auto fill the command
ls -a

to display the hidden files

ls -lah

to display hidden files with human readable

History commands

By: Elavarasu
9 February 2024 at 13:04
history

to display the last 1000 commands we executed in our machine. we can increase the limit and the default size is 1000.

history 10

execute last 10 commands

history | head

it display first 10 commands

history | tail

it displays last 10 commands

history ! 950

execute the specific command using event number like 950

history -d 950

delete the command using also event number

history -c

delete all the 1000 commands permanently

Basic Commands -history

By: Gowtham G
6 February 2024 at 14:53

Here,we discuss about a new and important command named β€œhistory”.

history

Just,simply write β€œhistory” in the terminal and see the result.
It showed the entire commands which we are used from the initial stage of installing the linux to upto date.
This will brings us the previous commands to know the steps if we have any issues facing in re-usability of an application.

history | head
history | tail

| head ==> denotes the first 10 commands which we used.
| tail ==> denoted the last 10 commands we used.

history 50

The number 50 denotes the last 50 commands.We can pass any numbers.

!127

β€˜!’ ==> brings the command to perform that particular action now.For eg:-
127 git push -u origin master
In my history the 127th command i use to push some files to git master branch.This number is called as β€œEvent Numberβ€œ.
if i pass the above command,it perform the action on the 127th line what is previously declared.

history -d 920

-d ==> denotes deletion.
If you want to delete a particular command in the history.Use the above command line and recheck once again the history,you will see the result.

history -c

-c ==> indicates clear entire history.
It will remove your entire command history.User cannot recover this.
IMP : Be aware for using this command.

NOTE:–
Linux store every 1000 commands as default.
If you crossed above 1000 commands,it takes 1000 from your current line.
For eg:
1005 ls
i use ls command as my 1005th one.
Linux stores from 5 – 1005 as the default.
If we use β€œhistory | headβ€œ
It displays 5 – 15 as the first 10 commands.
We can modify it’s default value at any time.

Read the manual for additional commands in the history family.

Basic Commands -history

6 February 2024 at 14:53

Here,we discuss about a new and important command named β€œhistory”.

history

Just,simply write β€œhistory” in the terminal and see the result.
It showed the entire commands which we are used from the initial stage of installing the linux to upto date.
This will brings us the previous commands to know the steps if we have any issues facing in re-usability of an application.

history | head
history | tail

| head ==> denotes the first 10 commands which we used.
| tail ==> denoted the last 10 commands we used.

history 50

The number 50 denotes the last 50 commands.We can pass any numbers.

!127

β€˜!’ ==> brings the command to perform that particular action now.For eg:-
127 git push -u origin master
In my history the 127th command i use to push some files to git master branch.This number is called as β€œEvent Numberβ€œ.
if i pass the above command,it perform the action on the 127th line what is previously declared.

history -d 920

-d ==> denotes deletion.
If you want to delete a particular command in the history.Use the above command line and recheck once again the history,you will see the result.

history -c

-c ==> indicates clear entire history.
It will remove your entire command history.User cannot recover this.
IMP : Be aware for using this command.

NOTE:–
Linux store every 1000 commands as default.
If you crossed above 1000 commands,it takes 1000 from your current line.
For eg:
1005 ls
i use ls command as my 1005th one.
Linux stores from 5 – 1005 as the default.
If we use β€œhistory | headβ€œ
It displays 5 – 15 as the first 10 commands.
We can modify it’s default value at any time.

Read the manual for additional commands in the history family.

❌
❌