自拍偷在线精品自拍偷,亚洲欧美中文日韩v在线观看不卡

6個(gè)你可能不熟悉的Linux實(shí)用命令

系統(tǒng) Linux
Linux是一個(gè)強(qiáng)大的操作系統(tǒng),這篇文章收集了6個(gè)你可能沒有用過的Linux命令,但卻相當(dāng)?shù)挠杏?,供大家參考?/div>

Linux是一個(gè)強(qiáng)大的操作系統(tǒng),這篇文章收集了6個(gè)你可能沒有用過的Linux命令,但卻相當(dāng)?shù)挠杏茫┐蠹覅⒖肌?/p>

[[349335]]

1. bc

這個(gè)Linux命令用于精度比較高的數(shù)學(xué)運(yùn)算。如:開平方根等。下面利用bc命令寫個(gè)腳本(文件名:sqrt)

  1. #!/bin/bash 
  2. if [ $ 
  3. then 
  4.     echo 'Usage: sqrt number' 
  5.     exit 1 
  6. else 
  7.     echo -e "sqrt($1)\nquit\n" | bc -q -i 
  8. fi 

接著,可使用這個(gè)腳本進(jìn)行平方根運(yùn)算:

  1. [hchen@RHELSVR5]$ ./sqrt 36 
  2. [hchen@RHELSVR5]$ ./sqrt 2.0000 
  3. 1.4142 
  4. [hchen@RHELSVR5]$ ./sqrt 10.0000 
  5. 3.1622 

2. split

如果你的文件很大,卻接到命令要把它分割成小文件,那么這個(gè)命令就派上用場了。

  1. [hchen@RHELSVR5 applebak]# ls -l largefile.tar.gz 
  2. -rw-r--r-- 1 hchen hchen 436774774 04-17 02:00 largefile.tar.gz 
  3. [hchen@RHELSVR5 applebak]# split -b 50m largefile.tar.gz LF_ 
  4. [hchen@RHELSVR5]# ls -l LF_* 
  5. -rw-r--r-- 1 hchen hchen 52428800 05-10 18:34 LF_aa 
  6. -rw-r--r-- 1 hchen hchen 52428800 05-10 18:34 LF_ab 
  7. -rw-r--r-- 1 hchen hchen 52428800 05-10 18:34 LF_ac 
  8. -rw-r--r-- 1 hchen hchen 52428800 05-10 18:34 LF_ad 
  9. -rw-r--r-- 1 hchen hchen 52428800 05-10 18:34 LF_ae 
  10. -rw-r--r-- 1 hchen hchen 52428800 05-10 18:35 LF_af 
  11. -rw-r--r-- 1 hchen hchen 52428800 05-10 18:35 LF_ag 
  12. -rw-r--r-- 1 hchen hchen 52428800 05-10 18:35 LF_ah 
  13. -rw-r--r-- 1 hchen hchen 17344374 05-10 18:35 LF_ai 

反而來,合并也只需要簡單的合并就行,如:

  1. [hchen@RHELSVR5]# cat LF_* >largefile.tar.gz 

3. pgrep

pgrep名字前有個(gè)p,可以猜想它可能和grep有關(guān),確實(shí)這是進(jìn)程相關(guān)的grep命令。不過,這個(gè)命令主要是用來列舉進(jìn)程ID的。如:

  1. $ pgrep -u hchen 
  2. 22441 
  3. 22444 

這個(gè)命令相當(dāng)于:

  1. ps -ef | egrep '^hchen' | awk '{print $2}' 

4. nl

nl命令其它和cat命令很像,只不過它會(huì)打上行號。如下所示:

  1. [hchen@RHELSVR5 include]# nl stdio.h | head -n 10 
  2.      1  /* Define ISO C stdio on top of C++ iostreams. 
  3.      2     Copyright (C) 1991,1994-2004,2005,2006 Free Software Foundation, Inc. 
  4.      3     This file is part of the GNU C Library. 
  5.      4     The GNU C Library is free software; you can redistribute it and/or 
  6.      5     modify it under the terms of the GNU Lesser General Public 
  7.      6     License as published by the Free Software Foundation; either 
  8.      7     version 2.1 of the License, or (at your option) any later version. 
  9.      8     The GNU C Library is distributed in the hope that it will be useful, 

5. ldd

這個(gè)命令,用來可執(zhí)行文件所使用了動(dòng)態(tài)鏈接庫。如:

  1. [hchen@RHELSVR5 ~]# ldd /usr/bin/java 
  2.         linux-gate.so.1 => (0x00cd9000) 
  3.         libgij.so.7rh => /usr/lib/libgij.so.7rh (0x00ed3000) 
  4.         libgcj.so.7rh => /usr/lib/libgcj.so.7rh (0x00ed6000) 
  5.         libpthread.so.0 => /lib/i686/nosegneg/libpthread.so.0 (0x00110000) 
  6.         librt.so.1 => /lib/i686/nosegneg/librt.so.1 (0x009c8000) 
  7.         libdl.so.2 => /lib/libdl.so.2 (0x008b5000) 
  8.         libz.so.1 => /usr/lib/libz.so.1 (0x00bee000) 
  9.         libgcc_s.so.1 => /lib/libgcc_s.so.1 (0x00aa7000) 
  10.         libc.so.6 => /lib/i686/nosegneg/libc.so.6 (0x0022f000) 
  11.         libm.so.6 => /lib/i686/nosegneg/libm.so.6 (0x00127000) 
  12.         /lib/ld-linux.so.2 (0x00214000) 

6. col

這個(gè)命令,能將man文件轉(zhuǎn)成純文本文件。如下示例:

  1. PAGER=cat 
  2. # man less | col -b > less.txt 

 

責(zé)任編輯:趙寧寧 來源: 今日頭條
相關(guān)推薦

2021-10-26 12:05:47

Linux命令Java

2020-11-05 07:58:12

CSS變量Web

2009-05-13 10:28:28

Linux命令

2020-03-19 19:00:01

Linux命令

2018-10-15 12:27:50

iPhone設(shè)計(jì)蘋果

2015-10-22 17:20:46

命令工具Linux

2023-11-06 18:02:28

Linux實(shí)用命令

2022-04-30 19:22:35

Python編程語言

2016-01-12 10:38:58

Angular.js代碼調(diào)試

2020-05-03 14:14:48

Linux 命令 代碼

2020-09-28 15:14:31

Linux常用命令實(shí)用命令

2022-08-13 09:19:07

Bash命令Linux

2023-10-17 16:31:07

人工智能GitHub

2016-09-05 13:14:11

2019-03-22 08:00:01

Git命令GitHub

2022-09-20 11:58:27

NpmNode.js

2021-11-02 08:54:35

Linux CPULinux 系統(tǒng)

2009-09-04 11:06:06

Linux桌面Linux操作系統(tǒng)linux

2014-05-06 10:31:21

KillallLinux命令行

2015-05-13 11:03:29

LinuxLinux工具
點(diǎn)贊
收藏

51CTO技術(shù)棧公眾號