歡迎來到Linux教程網
Linux教程網
Linux教程網
Linux教程網
Linux教程網 >> Linux基礎 >> Linux教程 >> Ubuntu注意事項提醒

Ubuntu注意事項提醒

日期:2017/2/28 17:06:14   编辑:Linux教程

0.Shell
GNU Linux的命令解釋器,提供了用戶和操作系統之間的接口。當輸入一個命令後,shell將對命令進行解釋,並調用相應的程序。Linux中有許多shell,其中最常用的之一就是Bash Shell。它是最初Unix shell之一的Bourne Shell的增強版本。

Shell除了具有解釋鍵盤命令並發送到操作系統的功能外,還是一種高級編程語言。Shell命令可組織在一個文件中供以後執行,這些文件在Linux系統中稱為shell腳本,在DOS和Windows系統中被稱為批處理文件。從而使用戶利用精巧的命令生成能夠完成復雜操作的shell腳本。

1.sudo注解
sudo意思就是super-user do,讓當前用戶暫時以root身份來執行各項命令。

Ubuntu為了防止用戶誤操作以及黑客以及惡意代碼的攻擊,默認情況下將root根用戶禁用了。

通常情況下,我們可以在受限用戶的shell中通過"sudo passwd root"命令來啟用和設定root的密碼;同時我們也可以以"sudo -s -H"的命令在終端機(The Shell)模式下以root身份進行操作。

1.5* su是用來改變當前用戶的,su root,就是將當前用戶切換為root,用了su root之後,下面所有的命令就可以不用打sudo了,因為當前用戶已經是管理員root了。

2.諸多命令
** --help:顯示命令工具的信息
man ** :對bash shell命令符進行解析
info **:顯示工具信息
less 分頁程序
more 分頁程序

3.訪問ubs盤
using the su command to switch to root user--> mkdir /mnt/USB --> /dev/sda1 /mnt/USB auto noauto,owner,kuzu 0 0 --> mount /dev/sda1
using the su command to switch to root user--> mkdir /mnt/USB -->mount /dev/sda1 /mnt/USB
Note: The “auto” on the above line means auto detection of filesystem. If your system unable to determine the filesystem type, change it accordingly to the USB drive’s filesystem (e.g. vfat or ntfs or ext2 or ext3).
If you know the filesystem of the USB drive or the system unable to determine the correct filesystem, the -t option can be used to the filesystem type of the USB device:
mount -t vfat /dev/sda1 /mnt/usb (for vFAT filesystem)
mount -t ntfs /dev/sda1 /mnt/usb (for NTFS filesystem)

4.VMware虛擬機直接訪問宿主機文件(虛擬機中的LINUX系統訪問物理硬盤的windows系統文件)

方法一:安裝vmware-tools;
方法二:在linux上架設ftp服務器;
方法三:

ps:Sudo 增加了運行命令的日志記錄 (在 /var/log/auth.log). 如果你陷入困境, 你總是可以返回並看見那些運行的命令.

Copyright © Linux教程網 All Rights Reserved