[Ubuntu] time

OS/Linux 2015. 12. 20. 18:04

특정 명령의 실행시간을 알고 싶을때 time 명령을 통해 확인 가능하다.

  • time [command]
  • ex) time du -sh * | sort -n -r


'OS > Linux' 카테고리의 다른 글

[Ubuntu] Dash home에서 불필요한 프로그램 shortcut 삭제  (0) 2015.12.24
[Shell] Bash shell 팁  (0) 2015.12.20
[Ubuntu] disk usage  (0) 2015.12.20
UNIX TOOLBOX  (2) 2015.08.26
[Ubuntu] libssl-dev  (0) 2014.08.17
Posted by leechwin
,

[Ubuntu] disk usage

OS/Linux 2015. 12. 20. 17:31

현재 디렉토리 혹은 하위의 디렉토리의 disk usage 관련 정보를 shell에서 du 명령을 통해 확인 가능하다.


Usage: du [OPTION]... [FILE]... 

    or:  du [OPTION]... --files0-from=F

Summarize disk usage of the set of FILEs, recursively for directories.


Mandatory arguments to long options are mandatory for short options too.

  -0, --null            end each output line with NUL, not newline

  -a, --all             write counts for all files, not just directories

      --apparent-size   print apparent sizes, rather than disk usage; although

                          the apparent size is usually smaller, it may be

                          larger due to holes in ('sparse') files, internal

                          fragmentation, indirect blocks, and the like

  -B, --block-size=SIZE  scale sizes by SIZE before printing them; e.g.,

                           '-BM' prints sizes in units of 1,048,576 bytes;

                           see SIZE format below

  -b, --bytes           equivalent to '--apparent-size --block-size=1'

  -c, --total           produce a grand total

  -D, --dereference-args  dereference only symlinks that are listed on the

                          command line

  -d, --max-depth=N     print the total for a directory (or file, with --all)

                          only if it is N or fewer levels below the command

                          line argument;  --max-depth=0 is the same as

                          --summarize

      --files0-from=F   summarize disk usage of the

                          NUL-terminated file names specified in file F;

                          if F is -, then read names from standard input

  -H                    equivalent to --dereference-args (-D)

  -h, --human-readable  print sizes in human readable format (e.g., 1K 234M 2G)

      --inodes          list inode usage information instead of block usage

  -k                    like --block-size=1K

  -L, --dereference     dereference all symbolic links

  -l, --count-links     count sizes many times if hard linked

  -m                    like --block-size=1M

  -P, --no-dereference  don't follow any symbolic links (this is the default)

  -S, --separate-dirs   for directories do not include size of subdirectories

      --si              like -h, but use powers of 1000 not 1024

  -s, --summarize       display only a total for each argument

  -t, --threshold=SIZE  exclude entries smaller than SIZE if positive,

                          or entries greater than SIZE if negative

      --time            show time of the last modification of any file in the

                          directory, or any of its subdirectories

      --time=WORD       show time as WORD instead of modification time:

                          atime, access, use, ctime or status

      --time-style=STYLE  show times using STYLE, which can be:

                            full-iso, long-iso, iso, or +FORMAT;

                            FORMAT is interpreted like in 'date'

  -X, --exclude-from=FILE  exclude files that match any pattern in FILE

      --exclude=PATTERN    exclude files that match PATTERN

  -x, --one-file-system    skip directories on different file systems

      --help     display this help and exit

      --version  output version information and exit 


  • ex) 현재 디렉토리의 하위 디렉토리의 용량을 순서대로 조회
    • du -sh * | sort -n -r


'OS > Linux' 카테고리의 다른 글

[Shell] Bash shell 팁  (0) 2015.12.20
[Ubuntu] time  (0) 2015.12.20
UNIX TOOLBOX  (2) 2015.08.26
[Ubuntu] libssl-dev  (0) 2014.08.17
[Ubuntu] build-essential  (3) 2014.08.17
Posted by leechwin
,

UNIX TOOLBOX

OS/Linux 2015. 8. 26. 17:45

Unix/Linux/BSD command 를 잘 정리해놓은 링크

PDF버전


'OS > Linux' 카테고리의 다른 글

[Ubuntu] time  (0) 2015.12.20
[Ubuntu] disk usage  (0) 2015.12.20
[Ubuntu] libssl-dev  (0) 2014.08.17
[Ubuntu] build-essential  (3) 2014.08.17
[Ubuntu] Terminal 관련 단축키  (0) 2014.06.08
Posted by leechwin
,

[Ubuntu] libssl-dev

OS/Linux 2014. 8. 17. 19:26

 Ubuntu 에서 아파치웹서버나 TLS/SSL 에 관한 서비스 개발등을 이용하려고 할때 다음과 같은 에러가 발생하는 경우가 있다.

  • SSL/TLS libraries were missing or unusable

 이런경우는 SSL 개발에 관련된 라이브러리가 설치가 안되어서 발생하는 문제로 다음 명령어로 libssl-dev

build-essential 패키지를 설치하면 해결이 된다.

  • sudo apt-get install libssl-dev


 libssl-dev 패키지는 SSL 개발에 필요한 라이브러리와 헤더파일등을 가지고 있으며 아래에 링크에 자세한 내용을 살펴 볼수 있다.


'OS > Linux' 카테고리의 다른 글

[Ubuntu] disk usage  (0) 2015.12.20
UNIX TOOLBOX  (2) 2015.08.26
[Ubuntu] build-essential  (3) 2014.08.17
[Ubuntu] Terminal 관련 단축키  (0) 2014.06.08
[Ubuntu] grep 으로 원하는 문자열이 들어있는 파일 검색  (0) 2013.04.23
Posted by leechwin
,

[Ubuntu] build-essential

OS/Linux 2014. 8. 17. 19:17

 Ubuntu 에서 C, C++ 등을 개발하려고 컴파일을 할 때 다음과 같은 에러 메시지가 나오는 경우가 있다.

  • stdio.h: No such file or directory

 이런 경우는 개발에 필요한 stdio.h 등의 기본 라이브러리가 설치가 안되어서 발생하는 문제로 다음 명령어로 build-essential 패키지를 설치하면 해결이 된다.

  • sudo apt-get install build-essential


  build-essential 패키지는 개발에 필요한 기본 라이브러리와 헤더파일등을 가지고 있으며 아래에 링크에 자세한 내용을 살펴 볼수 있다.


'OS > Linux' 카테고리의 다른 글

UNIX TOOLBOX  (2) 2015.08.26
[Ubuntu] libssl-dev  (0) 2014.08.17
[Ubuntu] Terminal 관련 단축키  (0) 2014.06.08
[Ubuntu] grep 으로 원하는 문자열이 들어있는 파일 검색  (0) 2013.04.23
[Ubuntu] 한글 입력 설정  (1) 2013.04.19
Posted by leechwin
,

 Ubuntu 에서 많이 쓰는 Terminal 관련 유용한 단축키 정리


  • Ctrl + Alt + T : 바탕화면에서 터미널을 실행
  • Ctrl + Shift + T : 터미널내에서 새탭으로 터미널을 실행
  • Ctrl + Shift + N : 터미널내에서 새로운 터미널을 실행
  • Ctrl + Shift + W : 탭으로 실행된 터미널을 종료
  • Ctrl + Shift + Q : 현재 터미널을 종료(탭포함)
  • Ctrl + Shift + F : 터미널내에 문자열검색
  • Alt + 숫자 : 탭간에 이동
  • Ctrl + PageUp/PageDown : 다음/이전 탭으로 이동


Posted by leechwin
,

우분투에서 많은 파일중에 원하는 문자열이 들어있는 파일을 검색하고 싶은 경우가 있다.

일일이 검색하거나 툴을 사용하여 검색을 할 수 도 있지만, shell 상에서 간단히 검색하는 방법이 있다.


바로 grep 명령을 사용하면 원하는 문자열이 들어있는 파일을 바로 검색 할 수 있다.

  • Usage: grep [OPTION]... PATTERN [FILE]...
  • Example: grep -i 'hello world' menu.h main.c



원하는 위치에서 하위폴더를 포함하여 원하는 문자열을 검색하려면 다음과 같이 수행하면 된다.

  • grep -r  word .
    • -r : 하위폴더까지 검색
    • word : 검색하고자하는 문자열
    • . : 현재폴더를 최상위 폴더로 지정하고 검색시작
  • 예제


Posted by leechwin
,

Ubuntu 를 설치한 이후 한글을 입력할려고 하면 방법이 없어서 당황하게 된다.


Ubuntu 에서 한글 입력을 가능하게 설정하는 방법에 대해 알아보도록 한다.

메뉴에서 Language Support  설정을 들어가보면 다음과 같이 기본 Keyboard input method system 으로 ibus 가 설정되어 있는데 한글지원이 잘 안된다.




Ubuntu 14.04 Version

1. Text Entry 설정에서 한글을 추가하고, 전환키를 설정한다.

  • 재부팅후 한글 전환 및 동작이 잘 이루어진다.


Ubuntu 12.04 Version

1. 한글을 이용하기위해서 추가적으로  nabi 언어팩 패키지를 설치한다.

  • sudo apt-get install nabi

설치가 완료되면 Language Support 설정에서  Keyboard input method system 으로 nabi 를 설정한다.



이후 재부팅을 하면 다음과 같이 nabi 설정 트레이박스가 나타나게 된다.





2. 부팅시 항상 nabi 설정 트레이박스가 나타나는데 다음과 같은 설정으로 트레이박스를 상단의 패널에 넣을 수 있다.


  • 패널 리스트 조회
    • gsettings get com.canonical.Unity.Panel systray-whitelist
  • 패널 리스트 설정
    • gsettings set com.canonical.Unity.Panel systray-whitelist "['JavaEmbeddedFrame', 'Wine', 'Update-notifier', 'Nabi']"
    • 위와 같이 마지막에 'Nabi' 메뉴를 추가한 후 재부팅을 하면 더이상 트레이박스는 따로 나타나지 않는다.


3. 한글과 영어 전환

  • 한/영 전환은 기본으로는 Shift + Space 키로 되어있다.


Posted by leechwin
,

리눅스에서 *.so 파일에 대해서 심볼 Name 이나 Type 등을 검색할 수 있는 방법에 대해 알아보자.


nm 명령어로 so 파일의 내용에 대해 심볼값, 심볼타입, 심볼이름을 알 수 있다.


예제)

 $ nm -Ca /lib/mylib.so.1

  • C 옵션
    • C++ 같은경우에는 네임맹글으로 제대로된 심볼네임이 나타나지 않을수 있는데 디맹글링을 하여 사람이 알아 볼 수 있는 심볼 이름으로 표현해준다.
  • a 옵션
    • 보통 출력하지 않는 디버거용 심볼을 포함하여 모든 심볼을 출력한다.



Posted by leechwin
,

Ubuntu 에서 apt-get install {Package} 로 설치가능한 유용한 패키지에 대해 정리

  • PC Recoreder
    • gtk-recordmydesktop
    • xvicap
  • Screen Shot
    • shutter
  • 공유
    • samba
  • Browser
    • chrome
    • firefox
  • Package management
    • rpm
  • Source management
    • git
  • Util
    • synergy
      • 자동시작: Menu > System > Preference > Startup Application > add


'OS > Linux' 카테고리의 다른 글

[Ubuntu] 한글 입력 설정  (1) 2013.04.19
[Ubuntu] NM 으로 so 파일 심볼을 검색하는 방법  (0) 2013.03.01
[Ubuntu] ulimit 설정  (0) 2013.02.17
[Ubuntu] RPM 간단 명령어  (0) 2013.02.17
[Ubuntu] Ubuntu 에 Oracle JDK 1.6 설치하기  (0) 2013.01.22
Posted by leechwin
,