一些linux小筆記

來源:互聯網
上載者:User

標籤:



1、crontab

(1)crontab每10秒執行一次
* * * * * /bin/date >>/tmp/date.txt
* * * * * sleep 10; /bin/date >>/tmp/date.txt
(2)還可以用以下方式表達
string            meaning  
------           -------  
@reboot        Run once, at startup.  
@yearly         Run once a year,  " 0 0 1 1 * ".  
@annually      (same as  @yearly)  
@monthly       Run once a month,  " 0 0 1 * * ".  
@weekly        Run once a week,  " 0 0 * * 0 ".  
@daily           Run once a day,  " 0 0 * * * ".  
@midnight      (same as  @daily)  
@hourly         Run once an hour,  " 0 * * * * ”.


2、踢使用者下線  
[email protected]:~# w
 10:15:27 up 1 day, 19:20,  2 users,  load average: 0.00, 0.01, 0.05
USER     TTY      FROM             [email protected]   IDLE   JCPU   PCPU WHAT
jediael  pts/0    218.107.55.252   09:15   31.00s  0.13s  0.13s -bash
root     pts/1    218.107.55.252   10:15    1.00s  0.02s  0.00s w
[email protected]:~# pkill -kill -t pts/0

3、關於幾個bin目錄
/bin:與開機相關的命令,包括單一使用者模式時用於系統的修複  如 cp mv bash dmsg grep chmod
/sbin:同上,且一般是允許root使用 如 init iptables lvm
/usr/bin:與開機無關的命令  java tail gcc
/usr/sbin:同上,一般root使用的命令 useradd usermod
/usr/local/bin:當同一軟體需要不同版本,但又不想刪除原有版本時,就將新軟體安裝在這裡
/user/local/sbin:同上,一般root使用的命令

4、在proc檔案系統中查看記憶體及cpu資訊
cat /proc/cpuinfo
cat /proc/meminfo


5、一些常用命令及選項
cat /etc/passwd | cut -d ‘:‘ -f 1
apt-cache dumpavail | grep  ‘Package: mysql’
cat /etc/passwd | sort -t ‘:‘ -k 3 -n
last | cut -d ‘ ‘ -f 1 | sort | uniq -c


10、磁碟分割基本步驟
(1)建立分區 fdisk
(2)格式化分區 mkfs
(3)磁碟檢查 fsck
(4)磁碟掛載 mount

一些linux小筆記

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.