Professional Documents
Culture Documents
LINUX COMMANDS
1
Naveenkumar +91 8553557585
2
Naveenkumar +91 8553557585
23) Command to find the file which are more than 100mb in size delete that files?
find . -type f -name -size +100m -exec rm rm
find / -size +100M -exec rm -rm
The Between 50mb to 100mb
find / -size +50M -size +100/M
24) What is the use of Symbolic Link and hardlink files?
Softlink It create a separate in ode for linked file. We should not delete the original
file to access the softlink.
Hardlink It does t ha e a separate i ode. Hard link file will be deleted when we
delete the original file.
25) Command to find a string in a file?
find . <Directory path> -name <file name>
26) Command to find particular file in a directory?
find . -name <file name>
27) Command to check NIC cards are enabled or not?
Enable: The NIC sta ds for Net ork I terfa e Card. The up or ifup flag ith
Interface name (eth0) activates an Network Interface.
Ifconfig eth0 up
Desible: The do or ifdo flag ith i terfa e eth0 Dea ti ates the spe ified
Network interface.
Ifconfig eth0 down
28) What is the use of FTP?
The File Transfer Protocol (FTP) is a Standard Network Protocol used to Transfer
Computer files from one host to another host over a TCP such as the Internet. The FTP is
built on a Client Server Architecture and users separate Control and data Connections
between the Client and Server.
ftp <ip address>
ftp> <username>
ftp> <password>
ftp> mput <file1> <file2> .<file n> /dirput multiple files to unix box a particular
dir.
ftp> get <filename> get a file from unix box to windows.
ftp> mget <file1> <file2> .<file n> get multiple file from unix box to windows
ftp> quit used to quit from unix box.
29) Explain the procedure to transfer files from one UNIX box to other unix box by using
FTP?
scp <filename1> <username>@<ip address or hostname>:<path where to
copy>
Eg: scp naveen.txt kumar@192.168.32.64:/root/Desktop/naveen.txt
Copy file sample.txt to 192.168.32.64 box /root/Desktop/raj directory.
3
Naveenkumar +91 8553557585
4
Naveenkumar +91 8553557585
5
Naveenkumar +91 8553557585
56) I want to execute a script, everyday at 5:00 p.m. Write a cronjob Syntax to achieve that?
<Min> <Hour> <Date of the Month> <Month> <Day of the Week> <path of
script>*17***<Path of the script>
57) How to list and edit the crontabs?
Crontab Command manages the cron table that is used by the cron to execute the cron
jobs. This article explain the various command line options of the crontab command.
crontab -l (-l stands for list. This displays the crontab of the current user.
i e I logged i as root, this ill displa the ro jo s of root user.
crontab -e(-e stands for edit. This allows you to edit the crontab of the
current user
ccrontab -r(-r stands for remove. This will remove all the cron job
entries of the current user as shown below.
58) What is the cronjob syntax?
crontab -i <direct path > <file name>
59) What is the difference between kill -3, kill -9 and kill -15?
Kill 3 <PID> To ge erate the Thread du ps
kill 9 <PID> To kill the process forcibly
kill 15 <PID> It will wait to kill the process until the child processes are
killed.
60) How to check port is opened or not by using telnet and how to use telnet a d hat s the
output?
The Port Numbers Opened= netstat -an
netstat -a | fi d
Out Put= telnet 192.168.131.128 23
61) How to find a process id with a port number?
netstat -antp|grep <portno>
62) How to find a port number with a process id?
netstat -antp|grep <pid>
63) What is the command to create a tar file and extract a tar file?
tar -cvf <filename>.tar <path of the desired folder>
Extract the tar file
tar -xvf <filename>.tar /<directory to extract>
64) How to set javapath in linux?
Edit ~/ .bashrc and place below two lines in that file and save the file
Vi ~/.bashrc
JAVA_HOME = /user/lib/jvm/jre-1.6.0 openjdk
Export $JAVA_HOME
65) What is the differe e et ee diff a d p commands?
Cmp: it o pares t o files a d gi es the output like Li e o. a d B te
which indicates the first difference.
Syn: cmp
Diff: it compares two files or directories and gives the output which words are
different when comparing the files, which files are different when comparing the
directories.
6
Naveenkumar +91 8553557585
7
Naveenkumar +91 8553557585
8
Naveenkumar +91 8553557585
9
Naveenkumar +91 8553557585
10
Naveenkumar +91 8553557585
11
Naveenkumar +91 8553557585
12
Naveenkumar +91 8553557585
Abbreviations In WAS
13