=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
                             UNIX GURU UNIVERSE
                                UNIX HOT TIP

                       Unix Tip 2413 - August 10, 2006

                   http://www.ugu.com/sui/ugu/show?tip.today
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=

접속에 대한 별명(바로가기?, 단축키?)만들기

원격시스템에 좀더 빠르게 접속하기 위해서는 시간을 아끼기 위해 각자의
telnet, ssh, ftp 또는 rlogin 접속에 별명을 만들어줘라.

alias srocket 'ssh -l myaccount rocket.foo.bar.com'
alias sfrocket 'sftp -l myaccount rocket.foo.bar.com'
alias trocket 'telnet rocket.foo.bar.com'
alias rrocket 'rlogin -l myaccount rocket.foo.bar.com'

@@@@@@@@@@@@@@@@@@@@[ 원문 ]@@@@@@@@@@@@@@@@@@@@

ALIAS YOUR CONNECTIVITY

For quicker access to remote systems
alias your telnet, ssh, ftp, or rlogin
connections to save time.

alias srocket 'ssh -l myaccount rocket.foo.bar.com'
alias sfrocket 'sftp -l myaccount rocket.foo.bar.com'
alias trocket 'telnet rocket.foo.bar.com'
alias rrocket 'rlogin -l myaccount rocket.foo.bar.com'

반응형
Posted by She쥐포s

2007. 11. 3. 21:35 Unix

디렉토리만 나열하기

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
                             UNIX GURU UNIVERSE
                                UNIX HOT TIP

                       Unix Tip 2391 - July 19, 2006

                   
http://www.ugu.com/sui/ugu/show?tip.today
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=

디렉토리만 나열하기

오랜되었지만 좋은 팁...

유닉스에서 디렉토리만 나열하기 위한 빠른 방법 중 하나:

ls -al | grep "^d"

@@@@@@@@@@@@@@@@@@@@[ 원문 ]@@@@@@@@@@@@@@@@@@@@
 
LISTING DIRECTORIES ONLY

Oldie but a goodie.....


A quick way to list just
directories in Unix:

ls -al | grep "^d"
반응형
Posted by She쥐포s

2007. 11. 3. 21:34 Unix

vi상에서 명령실행

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
                             UNIX GURU UNIVERSE
                                UNIX HOT TIP

                       Unix Tip 2388 - July 16, 2006

                   
http://www.ugu.com/sui/ugu/show?tip.today
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=

vi에서 실행

vi에서 쉘스크립트를 작성하는 동안 명령어들을 커맨드라인에서 테스트하기 위해
vi를 빠져나오기 위해 시간을 허비한다고 생각해본적이 있는가?
 
생산성을 증가시키기 위해 스크립트를 작성하기 전에 편집기 내에서 이 명령들을
실행하고 결과를 볼 수 있다면 상당히 빠르게 작성할 수 있을 것이다.

방법은 가능하고 상당히 직관적이다. vi에서 다음을 입력하라.

:!testscript

(콜론과 느낌표)

다음 $ 또는 # 프롬프트에서 했던 것처럼 명령어를 입력하라.
 
명령이 실행되고 결과가 표시될 것이며 다음작업을 계속하기 위해 return 키를
입력하라는 프롬프트가 뜨게 된다.

@@@@@@@@@@@@@@@@@@@@[ 원문 ]@@@@@@@@@@@@@@@@@@@@

VI EXECUTION

While writing shell scripts
in vi, have you ever considered
the time wasted by going in
and out of vi to test your
commands by executing them on
the command line.

To increase your productivity,
it would be a lot quicker if you
could execute these commands
from within the editor and view
their output before writing them
to your script.

This is possible and quite
straight forward.  Enter the
following within vi

:!testscript

(i.e. colon exclamation mark)

Then enter your command as you
would at the $ or # prompt.

The command executes, the result
is displayed and you are propmted
to press return to continue.
반응형
Posted by She쥐포s
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
                             UNIX GURU UNIVERSE
                                UNIX HOT TIP

                       Unix Tip 2390 - July 18, 2006

                   http://www.ugu.com/sui/ugu/show?tip.today
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
대문자 파일명을 소문자로
 
스크립트는 현재 디렉토리에 있는 모든 파일명을 대문자에서 소문자로 변경하는데
사용할 수 있다.
 
나는 이 스크립트를 윈도우 시스템에서 유닉스 기반의 웹서버에 업로드하려고 할 때
파일 이름이 원하지 않게 대문자로 변경되었을 경우 사용한다.

###########################

for uppercase in `ls`
do
 for lowercase in `ls $uppercase|tr [A-Z] [a-z]`
 do
    mv $uppercase $lowercase 2>/dev/null
 done
done

############################
譯者 註)
1번줄 : ls의 결과를 "uppercase"라는 변수로 받아 for문
2번줄 : 主반복문 실행
3번줄 : "uppercase" 변수를 tr을 통해 대문자를 소문자로 변환후
        "lowercase" 변수에 저장
4번줄 : 하위반복문 실행
5번줄 : "uppercase" 변수 내용을 "lowercase" 변수 내용으로 변환
        원문의 스크립트가 잘못되어있다. 주의요망
6번줄 : 하위반복문 종료
7번줄 : 主반복문 종료
 
@@@@@@@@@@@@@@@@@@@@[ 원문 ]@@@@@@@@@@@@@@@@@@@@
 
FILNAMES UPPER TO LOWER

This script can be used to
renames all the file in
current directory with
UPPERCASE letters to lowercase.

I uses it because some time when
I try to upload some files from
a Windows system to a unix based
web server, the files somehow gets
converted to UPPERCASES, which is
undesirable.

###########################

for uppercase in `ls`
do
 for lowercase in `ls $uppercase|tr [A-Z] [a-z]`
 do
    mv $lowercase $uppercase 2>/dev/null
 done
done

############################
반응형
Posted by She쥐포s

2007. 11. 3. 21:32 Unix

rm *

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
                             UNIX GURU UNIVERSE
                                UNIX HOT TIP

                       Unix Tip 2384 - July 12, 2006

                   
http://www.ugu.com/sui/ugu/show?tip.today
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=

rm *
 
디렉토리의 파일들의 뜻하지 않은 삭제를 방지하기 위해서는 "-i"라는 파일을 만들어
주면 된다. 이 파일은 본쉘에서는 다음과 같이 입력을 하면 된다.
 
$ > -i
(여기서 $는 프롬프트 기호. 따라서 입력할 것은 >-i임.
 바로 리다이렉션을 하여 -i 파일로 저장함)

파일은 디렉토리의 맨 처음에 있어서 다음과 같이 입력한다면

rm *

rm 명령은 다음과 같이 입력한 것으로 가정하여 처리한다.

rm -i *
 
@@@@@@@@@@@@@@@@@@@@[ 원문 ]@@@@@@@@@@@@@@@@@@@@
 
OOPS.. RM STAR

To prevent accidental removal
of files in a directory you
can create a file called "-i"
this is done from a bourne
shell by typing:

> -i

this will be the first file in
the directory so if you type:

rm *

The rm command assumes you have typed:

rm -i *
반응형
Posted by She쥐포s

2007. 11. 3. 21:31 Unix/Solaris

OS 비트수 확인

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
                             UNIX GURU UNIVERSE
                                UNIX HOT TIP

                       Unix Tip 2383 - July 11, 2006

                   
http://www.ugu.com/sui/ugu/show?tip.today
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=

비트인가?

64비트 모드인지 32비트 모드인지 알려주는 솔라리스 명령어가 있다.

isainfo -vk
 
@@@@@@@@@@@@@@@@@@@@[ 원문 ]@@@@@@@@@@@@@@@@@@@@
 
HOW MANY BITS?

There is a Solaris command
to tell you if your in 64
or 32 bit mode:

isainfo -vk
반응형
Posted by She쥐포s

2007. 11. 3. 21:30 Unix

일일 백업 확인

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
                             UNIX GURU UNIVERSE
                                UNIX HOT TIP

                       Unix Tip 2382 - July 10, 2006

                   
http://www.ugu.com/sui/ugu/show?tip.today
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=

일일 백업 확인

시스템 관리자는 다양한 방법으로 일일 백업이 성공적으로 완료되었는지
확인해야 한다.

백업이 완료되었을 때마다 4~5 줄을 기록하는 짧은 로그 파일을 유지하는 것은
한가지 방법이 될 수 있다.

시스템 관리자가 다음 명령을 .profile 파일에 추가한다면 로그인 할 때마다 가장
최근의 백업결과를 자동으로 확인할 수 있을 것이다.

tail -5 /PATH/SHORT_LOG_FILE.log
 
@@@@@@@@@@@@@@@@@@@@[ 원문 ]@@@@@@@@@@@@@@@@@@@@

DAILY BACKUP CHECK

System administrators have to
check by various means whether
the daily backup is sucessfully
completed.

One way is to
maintain a short log file which
will log 4 or 5 lines everytime
the backup is completed.

The latest backup results will be
automatically checked by System
administrator on login, if he adds
these lines at the end of his
.profile file.

tail -5 /PATH/SHORT_LOG_FILE.log
반응형
Posted by She쥐포s
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
                             UNIX GURU UNIVERSE
                                UNIX HOT TIP

                       Unix Tip 2381 - July  9, 2006

                   
http://www.ugu.com/sui/ugu/show?tip.today
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=

파일을 거꾸로 출력하기

팁은 Linux 팁이다.(?)

만일 텍스트 파일의 모든 라인을 거꾸로 출력하고 싶다면 "tac"를 사용하라.
이 명령어는 cat과 반대로 동작한다.
 
@@@@@@@@@@@@@@@@@@@@[ 원문 ]@@@@@@@@@@@@@@@@@@@@

OUTPUT A FILE IN REVERSE

A Linux Tip, you flavor
may very.

If you want to output all
the lines in a text file
backwords use "tac".  It
does just the opposite of
cat.
반응형
Posted by She쥐포s

2007. 11. 3. 21:28 Unix

make 과정 보기

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
                             UNIX GURU UNIVERSE
                                UNIX HOT TIP

                       Unix Tip 2379 - July  7, 2006

                   
http://www.ugu.com/sui/ugu/show?tip.today
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=

make 과정 보기

소프트웨어를 컴파일 할 때, 단순히 'make'만 입력하여 실행하지 마라! 오류를
절대 잡아낼 수 없다!

'make > Make.Out &'
실행하고

'tail -f Make.Out'
실행하라
위의 명령어는 연속적으로 Make.Out 파일의 마지막 라인을 보여줄 것이며, 여러분이
"저게 뭐야"라고 나오는 부분이 있으면 ^C를 입력하고 compile을 중단하지 않고
Make.Out 파일에 grep을 실행할 기회를 준다.
 
@@@@@@@@@@@@@@@@@@@@[ 원문 ]@@@@@@@@@@@@@@@@@@@@
 
WATCHING MAKE

When compiling software,
don't just type 'make'
and let run!  You will
never be able to catch
your errors!

Do 'make > Make.Out &'
and then do

'tail -f Make.Out'.

That will continuously show
you the end of your Make.Out
file, giving you the chance
to go "Hey, what was that?!?",
hit ^C, grep Make.Out, and not
interrupt your compile.
반응형
Posted by She쥐포s
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
                             UNIX GURU UNIVERSE
                                UNIX HOT TIP

                       Unix Tip 2380 - July  8, 2006

                   
http://www.ugu.com/sui/ugu/show?tip.today
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=

파일 찾을 때 du 사용하기

일반적으로:

find . -name *.txt -print

파일을 찾기 위한 명령어이다.
하지만 du와 grep을 이용하여 find를 보다 효율적으로 대체할 수 있다.

다음을 사용하라:

du -a |grep *.txt

명령어는 현재 디렉토리에서 .txt 확장자를 갖는 모든 파일을 나타낼 것이다.
 
@@@@@@@@@@@@@@@@@@@@[ 원문 ]@@@@@@@@@@@@@@@@@@@@
 
USE DU TO FIND FILES

Normally:

find . -name *.txt -print

is the command to find a file.
But you can locate find more
efficiently using du and grep

Use:

du -a |grep *.txt

This will locate all the files
with the extension .txt in the
current directory.
반응형
Posted by She쥐포s

블로그 이미지
She쥐포s
Yesterday
Today
Total

달력

 « |  » 2024.5
1 2 3 4
5 6 7 8 9 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25
26 27 28 29 30 31

최근에 올라온 글

최근에 달린 댓글

글 보관함