1 切換到root用戶
創新互聯公司成立于2013年,是專業互聯網技術服務公司,擁有項目網站設計制作、成都做網站網站策劃,項目實施與項目整合能力。我們以讓每一個夢想脫穎而出為使命,1280元濱海新區做網站,已為上家服務,為濱海新區各地企業和個人服務,聯系電話:18980820575
[linux@localhost ~]$ su root
密碼:
[root@localhost ~]#
2 查看/etc/sudoers文件權限,如果只讀權限,修改為可寫權限
[root@localhost ~]# ll /etc/sudoers
-r--r-----. 1 root root 4030 12月 10 09:55 /etc/sudoers
[root@localhost ~]# chmod 777 /etc/sudoers
[root@localhost ~]# ls -l /etc/sudoers
-rwxrwxrwx. 1 root root 4030 12月 10 09:57 /etc/sudoers
3 修改/etc/sudoers文件,執行命令如下:
/ username是你的用戶名 /
[root@localhost ~]# echo 'username ALL=(ALL) ALL' /etc/sudoers
可以在root權限下找到 root ALL=(ALL) ALL的字段,在下一行追加:
username ALL=(ALL) ALL
( 我這里的username 是hk )
5分鐘之后密碼過期,下次需要重新輸入,如果不想如此麻煩,可以用以下方法
username ALL=(ALL) NOPASSWD: ALL
說明:格式為{用戶名 網絡中的主機=(執行命令的目標用戶) 執行的命令范圍}
4 保存退出,并恢復/etc/sudoers的訪問權限為440
[root@localhost ~]# chmod 440 /etc/sudoers
[root@localhost ~]# ll /etc/sudoers
-r--r-----. 1 root root 4030 12月 10 09:59 /etc/sudoers
OK,這樣就完成了,經測試絕對可以。
開機時間過長 或者用的服務器版 偶爾會卡一下 一般linux是比較效率的
主要是域名解析影響了route
和
ssh
的速度,可能是域名解析用的時間太長,如果你沒有需要可以把dns服務器刪除掉。修改/etc/resolv.conf
就可以了
首先介紹一下我自己使用的有效方法,一般matlab啟動初始化很慢主要的原因是在找注冊文件,一般是由于安裝了MAC類的軟件引起的,所以我按照下文提供的方法“在【目標】中,鍵入如下內容”$MATLAB\bin\win32\MATLAB.exe” -c “Full Path to the MATLAB license file including file name””,我在快捷方式里面目標路徑中鍵入:"C:\Program Files\MATLAB\R2009b\bin\win32\MATLAB.exe" -c "C:\Program Files\MATLAB\R2009b\bin\win32\lic_standalone.dat",即解決了這個問題,感謝網友無私的分享精神。注意上面路徑中lic_standalone.dat是自己的許可文件,換換就可以了!
Matlab隨著版本的升級體積越來越大,帶來的問題就是啟動速度也越來越慢,下面就我注意到的幾個影響MATLAB啟動速度的問題集中和大家分析下解決辦法。
一、preferences方面原因
問題產生原因:
大家都知道,preferences參數很多,如果首選參數設置的不得當,或者文件太大,Matlab啟動的時候加載preferences設置就需要較長時間
問題解決方法:
以管理員權限登錄,以保證自己有查看隱藏文件的權限。
windows
(1)退出Matlab,一定要確保Matlab不再運行
(2)進入c:\Documents and Settings\ your username\Application Data\MathWorks\MATLAB\ 復制代碼真實該路徑可以在Matlab中鍵入prefdir得到
(3)將上述路徑中,以Matlab版本號為文件名(比如R2009a)的文件夾,重命名為R2009a_old(其實這一步是在備份preferences文件)
(4)重啟Matlab,此時predir下會重新創建一個R2009a文件夾,里面包含了所有的preferences設置,只是屬性值都是默認的,當然以前對Matlab的設置全部沒有了
(5)如果覺得不滿意,那么將新生成的R2009a刪除,將R2009a_old重新改為R2009a就可以恢復以前的設置了。
Linux, Unix, or Mac
1) Quit MATLAB. Ensure that MATLAB is no longer running.
2) Rename the “.matlab/” directory in the users home directory, to “.matlab_old/”.
3) Restart MATLAB.
二、License方面原因
問題產生原因:
每次Matlab啟動的時候會自動搜索Matlab的License文件,而計算機系統變量LM_LICENSE_FILE,則是用來告訴所有的應用程序從哪里找到對應的License文件
另外系統變量LM_LICENSE_FILE也可能導致初始化很慢,但是該變量只對Matlab負責,LM_LICENSE_FILE是對所有的程序負責
但是假如你的Matlab使用的是網絡版的License,你計算機沒有聯網就會導致無法找到network license
解決方法:
方法一
windows
(1)右擊【我的電腦】選擇【屬性】
(2)在【高級】選項卡中,點擊【環境變量】
(3)在下面的【系統變量】找到【LM_LICENSE_FILE】,如果沒有,點擊【新建】創建一個變量名為LM_LICENSE_FILE的變量
(4)將LM_LICENSE_FILE的屬性值設置為Maltab的License文件的絕對路徑
(5)重啟Matlab
Unix,Linux,or Mac
Check to see if there is an environment variable set. Where this is located depends on the shell you are using. Look in your home folder. This file may be called: .cshrc (c-shell), .profile (bash), or .bashrc (bash)
You can also create an environment variable for that shell session from the command line using export or setenv (depending on your shell), but the above file needs to be edited for a permanent change.
For example:export MLM_LICENSE_FILE /usr/bin/matlab/license.dat
如果你只有一個License,那么你可以當Matlab啟動的時候,在Maltab快捷方式或者命令行中指定License路徑
windows
(1)右擊Matlab快捷方式,選擇【屬性】
(2)在【目標】中,鍵入如下內容”$MATLAB\bin\win32\MATLAB.exe” -c “Full Path to the MATLAB license file including file name”
復制代碼其中$MATLAB是Matlab安裝根目錄,可以在Matlab中鍵入matlabroot得到,Path to the MATLAB license file是License文件的絕對路徑
(3)重啟Matlab
Unix,Linux,or Mac
Use a -c switch to point directly at the license file when launching.
If the MATLAB installer has created symbolic links, runmatlab -c Full Path to the MATLAB license file including file name
If symbolic links were not created, run from $MATLAB/bin/./matlab -c Full Path to the MATLAB license file including file name
Where $MATLAB is the root MATLAB directory and Path to the MATLAB license file is the absolute path to your license file, likely in your $MATLAB/licenses directory.
本文名稱:linux執行命令反應慢 linux命令卡死不執行
標題網址:http://m.newbst.com/article40/dogpeho.html
成都網站建設公司_創新互聯,為您提供網站排名、自適應網站、網站制作、關鍵詞優化、網站策劃、營銷型網站建設
聲明:本網站發布的內容(圖片、視頻和文字)以用戶投稿、用戶轉載內容為主,如果涉及侵權請盡快告知,我們將會在第一時間刪除。文章觀點不代表本網站立場,如需處理請聯系客服。電話:028-86922220;郵箱:631063699@qq.com。內容未經允許不得轉載,或轉載時需注明來源: 創新互聯