一些常用Linux, Unix 命令

1.      Communication between two Linux systems.

SSH (Secure SHell):

SSH’s main job is to provide access to acommand-line over a network.

ssh <username>@<computer name or IPaddress>

ssh joe@laptop

ssh mike@192.168.1.1

scp ~/home/test joe@192.168.118.18:~/home

sftp avoids that massive security risk bytransmitted everything in encrypted form. It is much, much harder to intercept.

When sshd receives a request for connection from aclient, it creates a new process for that particular connection.

sshfs make a remote file system available over SSHact as if it was inside a folder on your own system.

 

PuTTY is a popular graphical SSH client and itsupports Windows and Linux.

 

2.      Unix Soft (Symbolic) Link and Hard Link

ln [-f] [-n][-s] existingfile newname

-f:       Link files without questioning the user,even if the mode of target forbids writing. This is the default if the standardinput is not a terminal.

-n:      Does not overwrite existing files.

-s:      Make it so that it does not create a symboliclink.

The difference between hard and symbolic link:

Unix filesconsist of two parts: the data part and the file name part.

The file namepart carries a name and an associated inode number.

The data partis associated with something called “inode”.

More than onefile name can reference the same inode number, there files are said to be “hardlinked” together.

“hard link”is also considered as an alias name of the file.

On the other hand, there is a special file type whose data part carries a path to another file. Since it is a special file, the OS recognizes the data as a path, andredirects opens, reads, and writes so that, instead of accessing the datawithin the special file, they access the data in the file named by the data inthe special file. This special file is called a “soft link” or “symbolic link”.

 

“ln –s test softln”

“ln test hardln”

1)      When create one hard link, the inode count + 1. If file linked is deleted, because the inode count > 0, so the real file can not be restored and the inodecount - 1. The hard link is also useful to access the target file.

2)      Because when create a symbolic link, it creates a new inode, so soft links can be used between different systems or partitions.

“test” and “hardln”reference to the content of “test”.

“softln” is linked with the file reference “test”.

When remove “test”,we can also use hardln to access the content of “test”, but softln has error and can not see the content of test again by accessing softln.

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值