Skip to main content

Posts

Showing posts from February, 2016

Telnet in Linux

Connect to remote host / Check the port availability. Some of commands while using telnet: # netstat -tulpn   This commands shows which ports are used in this system  # telnet localhost 80   If this command throws an error like connection refused then the port 80 is not in use. We can use this port.  If this command throws an error like connected then the port is in use. We cannot use this port/li> Telnet is used to check whether a particular port is used or not. To exit from telnet command press ctrl + j Default Ports: Port Number Service 21 FTP ( File Transfer protocol ) 22 SSH ( Secure Shell) 23 Telnet 25 SMTP ( Simple Mail Transfer Protocol) 53 DNS (Domain Name Server ) 8...

Hostname in Linux

It lists the name of the server. We can change hostname of the server in 2 ways: 1) Permanent Change : Go to the file located in /etc/hostname (We have to edit the hostname in this file)    # vi /etc/hostname Provide the name whichever you want the hostname and save the file and exit from the file. After performing this please restart the system. The command to restart the system is    # init 6 2) Temporary Change    # hostname <name> Exit and login the server. It will rename your hostname

Networking commands in Linux

Command Description hostname List hostname of the server ping Availability of the destination server over the network Ex: ping www.google.com wget Download packages / Softwares into a Linux system   Ex: wget <linux_downloadable_url> ifconfig List’s IP address of the server Ex: ifconfig / ifconfig -a telnet Connect to remote host / Check the port availability Ex: telnet localhost 8081 curl Access the application Ex: curl www.google.com

Managing files or Directories in Linux

  Command Description cp Copy content from one file to another Syntax : cp <source> <destination>  To copy files # cp file1 file2   To copy directories Ex: cp -r dir1 dir2 Note : If file2 & dir2 doesn’t exist it will create mv mv stands for move. mv is used to move one or more files or directories from one place to another in a file system like UNIX. It has two distinct functions: è It renames a file or folder. è It moves a group of files to a different directory. find Find command is used to find the files or directories path. It is exactly like the find option in windows where you can search a file. Syntax: find / -name filename grep Search for a pattern in a file cd Swi...