'리눅스'에 해당되는 글 4건

  1. 2008.12.19 ls 명령어의 file type
  2. 2008.11.10 SRM - Secure RM
  3. 2008.11.07 Fedora Core 9 의 차이점 6
  4. 2008.11.04 리눅스에서 디렉토리 이름 변경시 주의사항 2
Linux2008. 12. 19. 20:05
man find

       -type c
              File is of type c:

              b      block (buffered) special

              c      character (unbuffered) special

              d      directory

              p      named pipe (FIFO)

              f      regular file

              l      symbolic link; this is never true if the -L option or the -follow option is in effect,
                     unless  the symbolic link is broken.  If you want to search for symbolic links when -L
                     is in effect, use -xtype.

              s      socket

              D      door (Solaris)


'ls -l'을  실행하면
$ ll
total 1922
drwxr-xr-x   2 root root    4096 Nov 15 04:17 bin
drwxr-xr-x   4 root root    1024 Apr 11  2008 boot
drwxr-xr-x  12 root root    3900 Nov 14 13:07 dev
drwxr-xr-x 101 root root   12288 Dec 15 04:15 etc
drwxr-xr-x  10 root root    4096 Aug 19 13:59 home
drwxr-xr-x  14 root root    4096 Apr 11  2008 lib
drwx------   2 root root   16384 Apr 10  2008 lost+found
drwxr-xr-x   2 root root    4096 Nov 14 13:07 media
drwxr-xr-x   2 root root       0 Nov 14 13:07 misc
drwxr-xr-x   2 root root       0 Nov 14 13:07 mnt
drwxr-xr-x   2 root root       0 Nov 14 13:07 net
drwxr-xr-x   2 root root    4096 Jun 19  2008 nfsroot
drwxr-xr-x   3 root root    4096 May 29  2008 opt
dr-xr-xr-x 195 root root       0 Nov 14 13:06 proc
drwxr-x---  29 root root    4096 Dec 17 11:00 root
drwxr-xr-x   2 root root   12288 Apr 11  2008 sbin
drwxr-xr-x   2 root root    4096 Apr 10  2008 selinux
drwxr-xr-x   2 root root    4096 Oct 11  2006 srv
drwxr-xr-x  12 root root       0 Nov 14 13:06 sys
drwxr-xr-x   2 root root    4096 Dec 17 13:30 tftpboot
drwxrwxrwt  16 root dev    90112 Dec 19 20:01 tmp
drwxr-xr-x  15 root root    4096 May 30  2008 usr
drwxr-xr-x  24 root root    4096 Apr 10  2008 var

이런식으로 퍼미션과 파일의 종류가 출력이 된다.
아무튼 일반적으로 보이는 녀석들은

- 일반 파일
b Block device
c Character device
d Directory
l symbolic Link

인데 드물게 보이는 녀석들이 존재 한다.
prw------- 1 morpheuz dev        0 Jul 15 13:21 initctl
crw-rw---- 1 morpheuz dev  61,   0 May 30  2008 lirc
srwxr-xr-x 1 morpheuz dev        0 Oct 20 19:57 lircd
brw-rw---- 1 morpheuz dev   7,   0 May 30  2008 loop0

이 녀석들의 의미는 역설적이게도.. find에서 찾아 냈다.

p name Pipe
s Socket


Posted by 구차니
Linux2008. 11. 10. 15:11
리눅스에서 파일을 완전 소거 하는 방법이 필요 해서 검색을 해봤더니
sourceforge project로 SRM이라는 것이 발견 되었다.

rpm 버전이 있는지는 모르겠고,
make install로 설치를 하도록 되어 있다.

 srm(1)                                                                  srm(1)

NAME
       srm - securely remove files or directories

SYNOPSIS
       srm [OPTION]... FILE...

DESCRIPTION
       srm  removes each specified file by overwriting, renaming, and truncat-
       ing it before unlinking. This prevents other people from undeleting  or
       recovering  any  information  about  the file from the command line. By
       default srm uses 35 passes to overwrite the file?셲  contents.  If  this
       seems  overkill  you  can  use  use  the --dod or --openbsd or --simple
       option which use less passes.

       srm, like every program that uses the  getopt  function  to  parse  its
       arguments,  lets  you  use the -- option to indicate that all following
       arguments are non-options.  To remove a file called ??f??in the current
       directory, you could type either
              rm -- -f
       or
              rm ./-f

OPTIONS
       Remove (unlink) the FILE(s).

       -d, --directory
              ignored (for compatability with rm(1))

       -f, --force
              ignore nonexistent files, never prompt

       -i, --interactive
              prompt before any removal

       -r, -R, --recursive
              remove the contents of directories recursively

       -s, --simple
              only overwrite the file with a single pass of random data

       -P, --openbsd
              OpenBSD  compatible  rm. Overwrite regular files before deleting
              them.  Files are overwritten three times, first  with  the  byte
              pattern  0xff,  then  0x00, and then 0xff again, before they are
              deleted.  Files with multiple links will  be  unlinked  but  not
              overwritten.

       -D, --dod
              Dod compliant 7-pass overwrite.

       -v, --verbose
              explain what is being done

       -h, --help
              display this help and exit

       -V, --version
              output version information and exit

NOTES
       srm can not remove write protected files owned by another user, regard-
       less of the permissions on the directory containing the file.

       Development and discussion of srm  is  carried  out  at
       http://source-forge.net/project/?group_id=3297   which   is   also   accessible   via
       http://srm.sourceforge.net.

SEE ALSO
       rm(1)

Matt Gauthier                        1.2.9                              srm(1)


윈도우용 완전 소거 프로그램과 비슷하게
소거 알고리즘에 의해서 7pass / 35pass으로 삭제 하며, 기본값은 35pass 라고 되어 있다.

[주소 : http://srm.sourceforge.net/]

----
2011.10.24 추가
우분투에서는 secure-delete 패키지로 존재한다. 
Posted by 구차니
Linux/Fedora Core2008. 11. 7. 12:15
생각을 해보니.. 회사 서버랑은 Fedora Core 8 이었는데..
일단 조금은더 Ubuntu 스러워졌다.(욕아님)

일단 보안 강화를 위해서 Gnome 자체에서 권한을 상당히 자주 물어 보게 되고,
X-windows 로그인시 Root로 로그인을 할 수 없다.(LiveCD에서 이미 겪었었지만..
실제 Live가 아닌 것에도 적용이 될줄이야 ㄱ-)

결정적으로 SCIM이 없다(다국어 입력기). 한글로 설정하면 한글은 잘나오는데 입력할 방법이 없다 ㄱ-

검색을 해보니 SCIM으로는 linux 네이트온 한글 입력이 안된다고 하는데
nabi 라는 녀석을 추천해 주던데 이녀석은 libhangul.so 종속성 땜시 이것저것 요청해서 귀차니즘.



결론 : 리눅스는 역시.. gcc 없으면 단팥없는 호빵.. 프로그램 설치를 위해서라도 반드시 gcc가 필요 하다
결론2 : 그러니까 오늘 다시 포맷 OTL 덤으로 윈도우로 파티션 조정? ㅠ.ㅠ
Posted by 구차니
Linux2008. 11. 4. 14:43
졸지에 낙시글이 되것 같아. 디렉토리 이름 변경하는 방법 급조 -ㅁ-
리눅스에서는 엄밀하게 디렉토리 이름 바꾸는 방법은 존재하지 않습니다.
리눅스의 모든 것들은 파일로 관리 되기 때문이죠.

그런 이유로 리눅스에서 디렉토리 이름을 변경하려면 mv
다른 이름으로 디렉토리를 옮기면 됩니다.

예) test_1 디렉토리를 test_opps로 바꾸기
$ mv test_1 test_oops

---------------------------------------------
오늘 작업을 하다가 신기한 현상을 발견했다.

리눅스에서 컴파일 하고, 윈도우에서 samba와 cvs로 관리하는 시스템인데,
리눅스 에서 열어 놓은 디렉토리를 윈도우에서 다른 이름으로 변경하고
리눅스에서 열린 디렉토리의 이름으로 cvs checkout을 했다.(그러니까 백업본을 가져왔다)

그리고 나서 소스를 변경하고 다시 컴파일 하는데, 변경사항이 없음?!?!?!
먼가 이상해서 경로를 빠져 나왔다가 다시 들어 가니 그 제서야 제대로 컴파일이 된다.

결론만 말하자면, linux에서 directory는 이름으로 확인하는것이 아니라 inode로 확인하므로,
다른 곳에서 디렉토리를 수정했을 경우, 반드시 cd 명령어로 다시 경로를 이동해서 사용하자!!


삭제 테스트
step 1. 임의의 디렉토리를 만든다. (귀찮으니 tt라고 하자)
           [user@hostname ~] $ mkdir tt

step 2. 임의의 디렉토리로 들어간다.
           [user@hostname ~] $ cd tt

step 3. 임의의 디렉토리의 inode를 확인해본다.
           [user@hostname tt] $ ls -ali
           11044597 drwxrwxr-x 2 user hostname 4096 Nov  4 14:38 .
            3866626 drwxrwxrwx 9 user hostname 4096 Nov  4 14:38 ..

step 4. 임의의 디렉토리를 다른 콘솔이나 윈도우의 다른 창에서 삭제한다.

step 5. 다시 inode를 출력해본다.
           [user@hostname tt] $ ls -ali
           total 0

step 6. 현재 경로를 알아본다.
           [user@hostname tt] $ pwd
           /home/user/tt

'Linux' 카테고리의 다른 글

파일 존재 유무 확인하기(how to check existence of file on C,linux)  (2) 2008.12.16
execl() - excute a file  (0) 2008.12.08
fork : Not Enough Memory  (2) 2008.12.08
mkfs - ext2 & ext3  (4) 2008.11.21
SRM - Secure RM  (0) 2008.11.10
Posted by 구차니