Creating links to files and directories

Get Bitcoin Now and make some money!

Creating links to files and directories

You may need to make a file accessible from more than one directory, and by more than one user, but still keep it as a single file. This is often the case when you need to share the data in a file with your colleagues. To prevent different versions of the file from proliferating, only one copy of the file exists, but links are created that allow you and your colleagues to access the file from your home directories or another convenient location.


NOTE: There is the danger of a file becoming corrupted if more than one person tries to edit it at the same time.


Creating a link to a file

To create a link to a file, use the ln(1) command, as follows:

ln filename linkname

For example, suppose you have a file called user_guide which is located in /u/workgrp/tasks/projects. To work on this file you would normally cd to that directory before opening the file. However, by creating a link to the file, you can access it from your current directory (without needing to enter the full path of the file). To do this, type the following:

   $ ln /u/workgrp/tasks/projects/user_guide my_guide

(more…)

Linux Command – du

Get Bitcoin Now and make some money!
du -sh *

will give you the size of all the directories,files etc in current directory in human readable format.

You can use the df command to know the free space in the disk:

df -h .

How to Get Root and User SSH Login Email Alerts

Get Bitcoin Now and make some money!

Reposted from tecmint.com

Whenever we install, configure and secure Linux servers in production environment, it’s very crucial to keep track of what is happening with servers and who logs into server as far as concerned about security of the server.

Get SSH Root Login Email Alerts

Why, because if someone logged into server as root user using brute force tactics over SSH, then think about how he will destroy your server. Any user who gains root access can do whatever he wants. To block such SSH attacks, read our following articles that describes how to protect servers from such attacks.

  1. Block SSH Server Brute Force Attacks Using DenyHosts
  2. Use Pam_Tally2 to Lock and Unlock SSH Failed Logins
  3. 5 Best Practices to Secure and Protect SSH Server

So, it’s not a good practice to allow direct root login via SSH session and recommend to create non root accounts with sudo access. Whenever root access needed, first logged in as normal user and then use su to switch over to root user. To disable direct SSH root logins, follow our below article that shows how to disable and limit root login in SSH.

(more…)

Linux – Find files by wildcard

Get Bitcoin Now and make some money!

Wildcard beginning and end of file name by using ( find . -name “*searchqueryhere*” -print )

OR

Wildcard just first part of file name by using ( find . -name “*filename.txt” -print )

Contact Us