기본 콘텐츠로 건너뛰기

[리눅스 명령어 모음]

[소스코드 라인수 알아내는 방법 - 빈줄 포함] $find -name "*.java" | xargs -i{} grep -c '[^[:space:]]' {} | paste -s -d'+' | bc [소스코드 라인수 알아내는 방법 - 빈줄 제외] $find -name "*.java" | xargs -i{} wc -l {} | awk '{print $1}' | paste -s -d'+' | bc [UUID 알아내는 법] $ ls -l /dev/disk/by-uuid lrwxrwxrwx 1 root root 10 11. Okt 18:02 53cdad3b-4b01-4a6c-a099-be1cdf1acf6d -> ../../sda2 $ blkid /dev/sda1 /dev/sda1: LABEL="/" UUID="ee7cf0a0-1922-401b-a1ae-6ec9261484c0" SEC_TYPE="ext2" TYPE="ext3" $sudo blkid sample output: /dev/sda1: TYPE="ntfs" UUID="A0F0582EF0580CC2" /dev/sda2: UUID="8c2da865-13f4-47a2-9c92-2f31738469e8" SEC_TYPE="ext2" TYPE="ext3" /dev/sda3: TYPE="swap" UUID="5641913f-9bcc-4d8a-8bcb-ddfc3159e70f" /dev/sda5: UUID="FAB008D6B0089AF1" TYPE="ntfs" /dev/sdb1: UUID="32c61b65-f2f8-4041-a5d5-3d5ef4182723" SE...

[리눅스 명령어] Unix command-line interface programs and shell builtins

source:  http://en.wikipedia.org/wiki/Iconv v   t   e Unix   command-line interface  programs and  shell builtins File system cat   cd   chmod   chown   chgrp   cksum   cmp   cp   dd   du   df   file   fsck   fuser   ln   ls   mkdir   mount   mv   pax   pwd   rm   rmdir   size   split   tee   touch   type   umask Processes at   bg   chroot   cron   fg   kill   killall   nice   pgrep   pidof   pkill   ps   pstree   time   top User environment clear   env   exit   finger   history   id   logname   mesg   passwd   su   sudo   uptime   talk   tput   uname   w   wall   who   whoa...

[리눅스 명령어] iconv 인코딩 명령어

사용예: jinuine@BROKEBACK:/tmp$ cat Intro.html <H4>ȸ�� �Ұ�</H4> �Ѻ��̵���(��)�� ���� 15�� ���� ���� ��ǻ��/�������� �о��� ������ ���Ҿ� IT ���������� dz���� �ǹ������� ���� ���Ͽ츦 å���� �Ⱓ�ϸ鼭 �ش� �о��� IT �����ڵ��� �Բ� ������ �Խ��ϴ�. jinuine@BROKEBACK:/tmp$ iconv -f CP949 -t utf8 Intro.html <H4>회사 소개</H4> 한빛미디어(주)는 지난 15년 동안 국내 컴퓨터/정보통신 분야의 성장과 더불어 IT 전문가들의 풍부한 실무경험과 현장 노하우를 책으로 출간하면서 해당 분야의 IT 개발자들과 함께 발전해 왔습니다.

[리눅스 서블릿] I want to access to my web app only with its directory name on url!!

Suppose: Web Application Directory: "example" What is easy: localhost:8080/webapps/example/intro.html What I want: localhost:8080/example/intro.html Solution: There's a hint on the welcome page when you enter: localhost:8080 which says, It works ! If you're seeing this page via a web browser, it means you've setup Tomcat successfully. Congratulations! This is the default Tomcat home page. It can be found on the local filesystem at:  /var/lib/tomcat7/webapps/ROOT/index.html Tomcat7 veterans might be pleased to learn that this system instance of Tomcat is installed with  CATALINA_HOME  in  /usr/share/tomcat7  and  CATALINA_BASE  in  /var/lib/tomcat7 , following the rules from  /usr/share/doc/tomcat7-common/RUNNING.txt.gz . Therefore, you can install your own web applications under this directory - /usr/share/tomcat7/webapps - to access

[리눅스 서블릿] Where System.out.printXX writes in a servlet?

source: Question: I am just curious to know, what happens when System.out.print() is called in a servlet? Where does it write the text? I cannot find any file named stdout_<date>.log on my filesystem. Answer: It depends on your servlet container. For  Tomcat  : When running Tomcat on unixes, the console output is usually redirected to the file named catalina.out. The name is configurable using an environment variable. (See the startup scripts). Whatever is written to System.err/out will be caught into that file. for example /var/log/tomcat7/catalina.out

[리눅스 마운트] FSTAB: Adding spaces in the mount point path

source:  http://en.kioskea.net/faq/2287-fstab-adding-spaces-in-the-mount-point-path Question: File System table  or  FSTAB  refers to system configurations which are usually used on a Linux environment. Sometimes users may have problems with  adding spaces  in mouth point path. This mainly happens because here  various options are separated by a space . To get rid of this problem, one has to type "0/040" instead of space  in the configurations. After that,  adding spaces  in mouth point path should not be an issue. Answer: This limitation is easily bypassed by typing "\ 040" instead of a space in the configuration file. Example: /dev/sda1 /mnt/first\040disk ext3 options 0 0 UUID=9d49c47e-91c4-49f0-806c-bc97910ad5eb /home/jinuine/VirtualBox\040VMs ext4 defaults 0 2

[리눅스 마운트] Is it possible to mount an ext4 partition with designating "owner and group" at the mounting point?

source:  http://askubuntu.com/questions/159992/how-to-mount-ext4-partition Question: How do I mount an ext4 partition as my user account so I wouldn't require root access to r/w on it? I used  -o uid=flint,gid=flint  on the  mount  command but I keep getting mount: wrong fs type, bad option, bad superblock on /dev/sda7, missing codepage or helper program, or other error In some cases useful info is found in syslog - try dmesg | tail or so Another thing, I want avoid using  udisks  for now as it doesn't let me mount to my specified mount point name. Answer: You don't. The files in the fs are owned by whoever owns them, and you can not change that at mount time. Instead you need to change the permissions to give yourself access with  sudo chown yourname.yourname /path/to/mount . On a freshly formatted filesystem, the root directory is owned by root, so you will need to change it and from then on, you will be able to cr...