2009-08-22
비온뒤 맑은 날씨가 좋아서..
2009-03-05
[개발: Delphi] Grid 마우스 휠 사용..(질/답)
unit Fi233P;
..
..
private
..
procedure MouseWheelHandler(var Message:TMessage ); override;
public
end;
var
Fi233F: TFi233F;
implementation
{$R *.dfm}
begin
if not ( Message.msg = WM_MOUSEWHEEL ) then Exit;
if not ( ActiveControl is TDBgrid ) then Exit;
if ( Message.wParam > 0 ) then Keybd_Event( VK_UP, VK_UP, 0,0 );
if ( Message.wParam < 0 ) then Keybd_Event( VK_DOWN,VK_DOWN,0,0 );
end;
위처럼 하면 해당폼의 그리드를마우스휠로 위 아래로 움직일 수 있습니다.
문제는 모든 폼에 다 위 구문을 써 주어야 한다는 겁니다.뭐..복사..붙여넣기 하면 됩니다만..
저걸 메인폼(기타 다른폼..?)에 한번만 기록해 놓고 각 폼에서 적용 받을 수 있나요?
========> 답변 ------------------
삭제를 위한 암호를 넣어 주세요 | ||
![]() | ![]() |
거기서 하면 됩니다.
var aControl: TWinControl;
begin
if Msg.message = WM_MouseWheel then begin
aControl := FindControl(Msg.hWnd);
if (aControl is TDBGrid) then begin
if (Msg.wParam > 0) then Keybd_Event(VK_UP, VK_UP, 0,0);
if (Msg.wParam < 0) then Keybd_Event(VK_DOWN,VK_DOWN,0,0);
(aControl as TDBGrid).Invalidate; //그리드에 ▶ 표시를 없앤다..
end;
end;
-- 델마당 ---
[개발: Delphi] Build with runtime package?
Delphi에서 Package에서
Dynamic Library(Dll)은 *.bpl 이라는 확장자를 가지고
Static-Library는 **.lib 가집니다.
Delphi7에서 VCL은 vcl70.bpl 이 됩니다.
그런데 Build with runtime package를 켜두지 않으면
실행파일 ***.exe에 vcl70.lib 라는 static 파일이 같이 묶여서
배포할때 vcl70.bpl을 같이 배포하지 않아도 되게 되죠
하지만 Build with runtime package를 켜두면 vcl70.bpl은
exe가 loading될때 LoadLibrary로 로드 됩니다.
이경우 vcl70.bpl도 같이 배포해야죠
그런데 Build with runtime packag를 꺼두면
exe에서도 vcl을 사용하고 dll에서도 vcl을 사용하게 되면
vcl이 두개 load되게 됩니다.
꼭 vcl이 아니라 프로그램에서 사용하는 Package는 모두 마찬가지죠
델파이는 기본옵션이 Build with runtime package가 꺼져잇는데..
개인적으로 Build with runtime packag를 켜서 컴파일하길 권장합니다.
배포에 좀 신경써야 하지만 exe(또는 dll) 크기도 작아지고
package중복문제도 없어지고...
-- 델마당에서 퍼옴 ---
2009-02-17
[개발: Delphi] Form관련 팁

Forms
Delphi Applications without Forms?
From: bpeck@prairienet.org (Bob Peck)
You bet! First, select File|New Project and choose "CRT Application" from the Browse Gallery dialog. This will provide you with a project that is still a Windows program, but WriteLn, ReadLn will be allowed in a Window but work like they did in DOS. If you wish, you can remove the WinCrt unit from the uses statement (if no user input/output is required, but is nice for debugging).
I've done this before just to see how small an app can be and I've been able to create a simple EXE (it just beeps) that is only 3200 bytes or so in size! Try to do that in C++ these days!
BTW, these "formless" apps are still Windows applications, so they can still call the Windows API routines. You'll just need to add WinProcs, WinTypes to your uses clause. You'll probably also want to add SysUtils and any other unit you find yourself needing.
Showing own logo on start-up
From: "Mark R. Holbrook"
It's pretty simple.
Create a form and put the logo on it using a Timage component. My example below assumes you have created a logo form called "logoform" Go to your project options and set the form to NOT be autocreated.
Then in your PROJECT.DPR file just after the begin statement do something like the following:
logoform := TLogoform.Create(nil);
logoform.Show; { NOTE! show! NOT showmodal }
.
. { Do other app startup stuff here like open databases etc... }
.
. { Just after the block of code that creates all your forms and
before the Application.Run statement do: }
logoform.Hide;
logoform.Release;
This will display your logo form until you actually start the app running.
Moving a form without a caption bar
From: mger@sbox.tu-graz.ac.at (Matthias Gerstgrasser)
The following is from DKBS Helpfile (Delphi Knowledge Base System), they state, that this is one of Borland's TI's:
Q: How can I make a form move by clicking and dragging in the client area instead of on the caption bar?
A: The easiest way to do this is to "fool" Windows into thinking that you're actually clicking on the caption bar of a form. Do this by handling the wm_NCHitTest windows message...
type
TForm1 = class(TForm)
private
{ Private-Deklarationen }
public
{ Public-Deklarationen }
procedure WMNCHitTest(var M: TWMNCHitTest); message wm_NCHitTest;
end;
var
Form1: TForm1;
implementation
{$R *.DFM}
procedure TForm1.WMNCHitTest(var M: TWMNCHitTest);
begin
inherited; { call the inherited message handler }
if M.Result = htClient then { is the click in the client area? }
M.Result := htCaption; { if so, make Windows think it's }
{ on the caption bar. }
end;
Preventing the user from resizing my window vertically
From: Bill Dekleris
You must trap WM_GETMINMAXINFO message:
in your form's class declaration put this :
procedure WMGetMinMaxInfo(var Msg: TWMGetMinMaxInfo); message WM_GETMINMAXINFO;
and in the implementation section :
procedure TMyForm.WMGetMinMaxInfo(var Msg: TWMGetMinMaxInfo);
begin
{ ---------------------------------------------}
{ Put your numbers in place of }
{ MIN_WIDTH, MIN_HEIGHT, MAX_WIDTH, MAX_HEIGHT }
{ }
{ To allow only horizontal sizing, put }
{ form's 'Height' property in place of MIN_HEIGHT, MAX_HEIGHT }
{ ---------------------------------------------}
Msg.MinMaxInfo^.ptMinTrackSize := Point(MIN_WIDTH, MIN_HEIGHT);
Msg.MinMaxInfo^.ptMaxTrackSize := Point(MAX_WIDTH, MAX_HEIGHT);
inherited
end;
It should work fine.
Hack: Want VCL controls in a form's title bar caption area?
From: "James D. Rofkar"
Here's the trick:
Treat your controls like they belong in a separate modeless dialog that just so happens to track the movement and resizing of your main form. In addition, it always appear over the main form's caption area.
This said, here's a simple hack that involves 2 forms and a drop-down listbox. After running this program, the drop-down listbox will appear in the Main form's caption area. Two key issues are: 1) trapping the Main form's WM_MOVE message; and 2) returning focus back to the Main form after users press any focus-grabbing controls (like a TComboBox, TButton, etc.)
[FYI, I'm using 32-bit Delphi 2.0 Developer under Win95 -- even though this technique should work for all versions of Delphi]
Here's the source for the Main form:
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls;
type
TForm1 = class(TForm)
procedure FormResize(Sender: TObject);
procedure FormShow(Sender: TObject);
procedure FormHide(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
procedure WMMove(var Msg: TWMMove); message WM_MOVE;
end;
var
Form1: TForm1;
implementation
uses Unit2;
{$R *.DFM}
procedure TForm1.FormResize(Sender: TObject);
begin
with Form2 do
begin
{Replace my magic numbers with real SystemMetrics info}
Width := Form1.Width - 120;
Top := Form1.Top + GetSystemMetrics(SM_CYFRAME);
Left := ((Form1.Left + Form1.Width) - Width) - 60;
end;
end;
procedure TForm1.FormShow(Sender: TObject);
begin
Form2.Show;
end;
procedure TForm1.FormHide(Sender: TObject);
begin
Form2.Hide;
end;
procedure TForm1.WMMove(var Msg: TWMMove);
begin
inherited;
if (Visible) then FormResize(Self);
end;
end.
Here's the source for the pseudo-caption area form. This is the form that contains the VCL controls you wish to place in the Main form's caption area. Essentially, it's a modeless dialog with the following properties:
Caption='' {NULL string}
Height={height of caption area}
Width={width of all controls in form}
BorderIcons=[] {none}
BorderStyle=bsNone
FormStyle=fsStayOnTop
Anyhow, here's the source for Form2:
unit Unit2;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls;
type
TForm2 = class(TForm)
ComboBox1: TComboBox;
procedure FormCreate(Sender: TObject);
procedure ComboBox1Change(Sender: TObject);
procedure FormResize(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form2: TForm2;
implementation
uses Unit1;
{$R *.DFM}
procedure TForm2.FormCreate(Sender: TObject);
begin
Height := ComboBox1.Height - 1;
Width := ComboBox1.Width - 1;
end;
procedure TForm2.ComboBox1Change(Sender: TObject);
begin
Form1.SetFocus;
end;
procedure TForm2.FormResize(Sender: TObject);
begin
ComboBox1.Width := Width;
end;
end.
The project file (.DPR) is fairly straightforward:
program Project1;
uses
Forms,
Unit1 in 'Unit1.pas' {Form1},
Unit2 in 'Unit2.pas' {Form2};
{$R *.RES}
begin
Application.Initialize;
Application.CreateForm(TForm1, Form1);
Application.CreateForm(TForm2, Form2);
Application.Run;
end.
That's it!
Although some Delphi book authors state:
"You can't place a Delphi component on the title bar, so there's literally no way to put a button there."
you can at least "fake" the illusion...
Storing TForm and/or its properties in a BLOB
From: Oliver.Bollmann@t-online.de (Oliver Bollmann)
Hallo, here are examples you need, I hope:
procedure SaveToField(FField:TBlobField;Form:TComponent);
var
Stream: TBlobStream;
FormName: string;
begin
FormName := Copy(Form.ClassName, 2, 99);
Stream := TBlobStream.Create(FField, bmWrite);
try
Stream.WriteComponentRes(FormName, Form);
finally
Stream.Free;
end;
end;
procedure LoadFromField(FField:TBlobField;Form:TComponent);
var
Stream: TBlobStream;
I: integer;
begin
try
Stream := TBlobStream.Create(FField, bmRead);
try
{delete all components}
for I := Form.ComponentCount - 1 downto 0 do
Form.Components[I].Free;
Stream.ReadComponentRes(Form);
finally
Stream.Free;
end;
except
on EFOpenError do {nothing};
end;
end;
Removing icon on taskbar 
From: AVONTURE Christophe
ShowWindow (Application.Handle, SW_HIDE);
How can I hide the form caption bar??
From: "James D. Rofkar"
First, override the "CreateParams" method of your Form, by declaring this in either your Form's protected or public section:
procedure CreateParams(var Params: TCreateParams); override;
Then, in the actual CreateParams() method, specify something like this:
procedure TForm1.Createparams(var Params: TCreateParams);
begin
inherited CreateParams(Params);
with Params do
Style := (Style or WS_POPUP) and (not WS_DLGFRAME);
end;
Hopefully, you'll provide some UI mechanism for moving and closing the window.
Floating toolbar - here's some code to do it
From: ao@atlas.sto.foa.se (Anders Ohlsson)
Someone asked for some code to make a form with no title bar moveable, kind of like a floating toolbar, for example FreeDock. Actually, for some of the stuff in here I spied on the FreeDock sources...This requires the use of some WinAPI functions. All WinAPI functions are however available at a touch of a key (F1 - OnLine Help)...
Here's some code that does this (about 100 lines)...
To make this work like intended:
OR start a new project, make the form's borderstyle bsNone, add a panel, set the border style of the panel to bsSingle, add another panel with some caption, add a button that says 'toggle title bar', cut out the below code and insert it were it should be, enable the panel's three event handlers (MouseDown, MouseMove, MouseUp), enable the button's event handler (Click). Hope I didn't forget anything... ;-) It's done faster in Delphi than it's written here... ;-)
unit Unit1;
interface
uses
SysUtils, WinTypes, WinProcs, Messages, Classes, Graphics, Controls,
Forms, Dialogs, ExtCtrls, StdCtrls;
type
TForm1 = class(TForm)
Panel1: TPanel;
Panel2: TPanel;
Button1: TButton;
procedure Panel1MouseDown(Sender: TObject; Button: TMouseButton;
Shift: TShiftState; X, Y: Integer);
procedure Panel1MouseMove(Sender: TObject; Shift: TShiftState; X,
Y: Integer);
procedure Panel1MouseUp(Sender: TObject; Button: TMouseButton;
Shift: TShiftState; X, Y: Integer);
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
OldX,
OldY,
OldLeft,
OldTop : Integer;
ScreenDC : HDC;
MoveRect : TRect;
Moving : Boolean;
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.DFM}
procedure TForm1.Panel1MouseDown(Sender: TObject; Button: TMouseButton;
Shift: TShiftState; X, Y: Integer);
begin
if Button = mbLeft then begin
SetCapture(Panel1.Handle);
ScreenDC := GetDC(0);
OldX := X;
OldY := Y;
OldLeft := X;
OldTop := Y;
MoveRect := BoundsRect;
DrawFocusRect(ScreenDC,MoveRect);
Moving := True;
end;
end;
procedure TForm1.Panel1MouseMove(Sender: TObject; Shift: TShiftState; X,
Y: Integer);
begin
if Moving then begin
DrawFocusRect(ScreenDC,MoveRect);
OldX := X;
OldY := Y;
MoveRect := Rect(Left+OldX-OldLeft,Top+OldY-OldTop,
Left+Width+OldX-OldLeft,Top+Height+OldY-OldTop);
DrawFocusRect(ScreenDC,MoveRect);
end;
end;
procedure TForm1.Panel1MouseUp(Sender: TObject; Button: TMouseButton;
Shift: TShiftState; X, Y: Integer);
begin
if Button = mbLeft then begin
ReleaseCapture;
DrawFocusRect(ScreenDC,MoveRect);
Left := Left+X-OldLeft;
Top := Top+Y-OldTop;
ReleaseDC(0,ScreenDC);
Moving := False;
end;
end;
procedure TForm1.Button1Click(Sender: TObject);
var
TitleHeight,
BorderWidth,
BorderHeight : Integer;
begin
TitleHeight := GetSystemMetrics(SM_CYCAPTION);
BorderWidth := GetSystemMetrics(SM_CXBORDER)+GetSystemMetrics(SM_CXFRAME)-1;
BorderHeight := GetSystemMetrics(SM_CYBORDER)+GetSystemMetrics(SM_CYFRAME)-2;
if BorderStyle = bsNone then begin
BorderStyle := bsSizeable;
Top := Top-TitleHeight-BorderHeight;
Height := Height+TitleHeight+2*BorderHeight;
Left := Left-BorderWidth;
Width := Width+2*BorderWidth;
end
else begin
BorderStyle := bsNone;
Top := Top+TitleHeight+BorderHeight;
Height := Height-TitleHeight-2*BorderHeight;
Left := Left+BorderWidth;
Width := Width-2*BorderWidth;
end;
end;
end.
Comments
From: Steve Teixeira
unit Dragmain;
interface
uses
SysUtils, WinTypes, WinProcs, Messages, Classes, Graphics, Controls,
Forms, Dialogs, StdCtrls;
type
TForm1 = class(TForm)
Button1: TButton;
procedure Button1Click(Sender: TObject);
private
procedure WMNCHitTest(var M: TWMNCHitTest); message wm_NCHitTest;
end;
var
Form1: TForm1;
implementation
{$R *.DFM}
procedure TForm1.WMNCHitTest(var M: TWMNCHitTest);
begin
inherited; { call the inherited message handler }
if M.Result = htClient then { is the click in the client area? }
M.Result := htCaption; { if so, make Windows think it's }
{ on the caption bar. }
end;
procedure TForm1.Button1Click(Sender: TObject);
begin
Close;
end;
end.
Programming for different resolutions in Delphi 2.0
You need to download:Ti2861 - Form display with different screen resolutions.
from the Delphi Technical Support area of our web site at www.borland.com.
Cannot properly minimize a form on startup
From: abeldup@unison.co.za (Abel du Plessis)
I need to start my form minimized, unfortunetly it doesn't work. When I set the WindowState property of the main formThere was an article in The Delphi Magazine, Issue 19, March 1997 - the Delphi Clinic section which explained the problem.
to wsMinimized and run it, the form minimizes onto Win95 desktop instead of the taskbar how it properly should.
Does anyone know how to fix this bug?
Here is my adaptation of the fix:
unit Foobar;
interface
type
TfrmFoobar = class(TForm);
procedure DoRestore(Sender: TObject);
procedure FormCreate(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
implementation
procedure TfrmUVChannel.FormCreate(Sender: TObject);
begin
//Assign a temporary event handler for when the app gets restored
Application.OnRestore := DoRestore;
Application.Minimize;
end;
procedure TfrmFoobar.DoRestore(Sender: TObject);
begin
Application.ShowMainForm := True;
//Restore the application
Perform(wm_SysCommand, sc_Restore, 0);
//Ensure all components draw properly
Show;
//Disconnect this event handler so it will not be called again
Application.OnRestore := nil;
end;
initialization
//Hide the minimized main form for now
Application.ShowMainForm := False;
end.
How do I know a Form is 'ready' resizing?
From: rkroman@pacbell.net
The methods you might be concerned with are:
{Trap the GetMinMaxInfo message and set minimum window size}
{ using declared constants }
procedure TForm1.WMGETMINMAXINFO( var message: TMessage );
var
mStruct: PMinMaxInfo;
begin
mStruct := PMinMaxInfo(message.lParam);
mStruct.ptMinTrackSize.x := HORIZONTALSIZE;
mStruct.ptMinTrackSize.y := VERTICALSIZE;
message.Result := 0;
end;
Preventing a From from Resizing
Taken from Borland tech info articles
2958: Preventing a From from Resizing
In some cases, developers would want to create a regular window (Form) in Delphi that contains some of the characteristics of a dialog box. For example, they do not want to allow their users to resize the form at runtime due to user interface design issues. Other than creating the whole form as a dialog box, there is not a property or a method to handle this in a regular window in Delphi. But due to the solid connection between Delphi and the API layer, developers can accomplish this easily.The following example demonstrates a way of handling the Windows message "WM_GetMinMaxInfo" which allows the developer to restrict the size of windows (forms) at runtime to a specific value. In this case, it will be used to disable the functionality of sizing the window (form) at runtime.
Consider the following unit:
unit getminmax;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms,
Dialogs;
type
TForm1 = class(TForm)
private
{ Private declarations }
procedure WMGetMinMaxInfo(var Msg: TWMGetMinMaxInfo);
message WM_GETMINMAXINFO;
procedure WMInitMenuPopup(var Msg: TWMInitMenuPopup);
message WM_INITMENUPOPUP;
procedure WMNCHitTest(var Msg: TWMNCHitTest);
message WM_NCHitTest;
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.DFM}
procedure TForm1.WMGetMinMaxInfo(var Msg: TWMGetMinMaxInfo);
begin
inherited;
with Msg.MinMaxInfo^ do
begin
ptMinTrackSize.x:= form1.width;
ptMaxTrackSize.x:= form1.width;
ptMinTrackSize.y:= form1.height;
ptMaxTrackSize.y:= form1.height;
end;
end;
procedure TForm1.WMInitMenuPopup(var Msg: TWMInitMenuPopup);
begin
inherited;
if Msg.SystemMenu then
EnableMenuItem(Msg.MenuPopup, SC_SIZE, MF_BYCOMMAND or MF_GRAYED)
end;
procedure TForm1.WMNCHitTest(var Msg: TWMNCHitTest);
begin
inherited;
with Msg do
if Result in [HTLEFT, HTRIGHT, HTBOTTOM, HTBOTTOMRIGHT,
HTBOTTOMLEFT, HTTOP, HTTOPRIGHT, HTTOPLEFT] then
Result:= HTNOWHERE
end;
end. { End of Unit}
A message handler for the windows message "WM_GetMinMaxInfo" in the code above was used to set the minimum and maximum TrackSize of the window to equal the width and height of the form at design time. That was actually enough to disable the resizing of the window (form), but the example went on to handle another couple of messages just to make the application look professional. The first message was the "WMInitMenuPopup" and that was to gray out the size option from the System Menu so that the application does not give the impression that this functionality is available. The second message was the "WMNCHitTest" and that was used to disable the change of the cursor icon whenever the mouse goes over one of the borders of the window (form) for the same reason which is not to give the impression that the resizing functionality is available.
messagedlg centering
From: "Jonathan M. Bell"// Custom coding for The Knoxville News-Sentinel
//
// jmb 06/28/97 Completed MessageDlgCtr - centers message dialogs above
form
unit kns;
{$R-}
interface
uses Forms, Dialogs;
{ Centered message dialog }
function MessageDlgCtr(const Msg: string; DlgType: TMsgDlgType;
Buttons: TMsgDlgButtons; HelpCtx: Longint): Integer;
implementation
uses Consts;
{ This MessageDlg function centers the dialog above the active form }
function MessageDlgCtr(const Msg: string; DlgType: TMsgDlgType;
Buttons: TMsgDlgButtons; HelpCtx: Longint): Integer;
begin
with CreateMessageDialog(Msg, DlgType, Buttons) do
try
HelpContext := HelpCtx;
Left := Screen.ActiveForm.Left + (Screen.ActiveForm.Width div 2) -
(Width div 2);
Top := Screen.ActiveForm.Top + (Screen.ActiveForm.Height div 2) -
(Height div 2);
Result := ShowModal;
finally
Free;
end;
end;
end.
Center a Form
I had a problem with centering a form after I had changed its dimensions[Robert Meek, rmeek@ptdprolog.net]
at run-time. The poScreenCenter only works when the form is shown. But
if you change the dimensions at run time your form doesn't center
automatically.
I've used this in my FormCreate, but I guess it could be called during an OnPaint whenever you change the size of the form too couldn't it?
Form1.Left := (Screen.Width div 2) - (Form.Width div 2);
Form1.Top := (Screen.Height div 2) - (Form.Height div 2);
[Giuseppe Madaffari, giumad@antares.it]
if you use SetBounds, form won't be repainted twice (one time for Left assignment and other time for Top assignment).
Try:
procedure CenterForm(AForm:TForm);
var ALeft,ATop:Integer;
begin
ALeft := (Screen.Width - AForm.Width) div 2;
ATop := (Screen.Height - AForm.Height) div 2;
AForm.SetBounds(ALeft, ATop, AForm.Widht, AForm.Height);
end;
[Jaycen Dale, Jaycen@infoafrica.co.za]
Procedure CenterForm(aForm: TForm);
Begin
aform.left := (screen.width - aform.width) shr 1;
aform.top := (screen.height - aform.height) shr 1;
End;
Please email me and tell me if you liked this page.
Last modified 03/17/2007 21:36:59
This page has been created with | ![]() |
2009-02-09
2009-02-08
리눅스 명령어
1. ps ( process )
- 현재 진행중인 프로세스의 정보를 출력합니다.
2. pstree ( process tree)
- ps 에 의해 출력되는 프로세스 정보를 트리 형태로 나타냅니다.
3. top
- cpu와 메모리를 사용하는 작업들에 대한 시스템 정보를 출력합니다.
4. arch (architecture)
- 현재 사용하고 있는 cpu의 모델을 출력합니다.
5. cal (calendar)
- 현재의 달을 출력합니다. (ex : 원하는 월 ,연도)
* -j :율리우스달력
6. clock
- CMOS 설정 시간의 출력, 변경을 합니다.
7. date
- 현재 시간과 날짜를 출력합니다.
8. df (disk free)
- 하드의 전체 용량, 남은 용량을 알기위해 사용합니다.
* -h(human) 바이트 단위 출력
9. du (disk usage)
- 각각의 디렉토리, 파일들의 디스크 용량을 출력합니다.
10. free (free memory)
- 현재 사용중인 시스템 메모리 상태를 출력합니다.
* -m(Megabyte) 메가 바이트 단위 출력
* -k (Kilobyte) 킬로 바이트 단위 출력
11. hostname
- 자신의 컴퓨터에 부여된 이름을 출력합니다.
12. lsdev (list devices)
- 현재 시스템에 연결되어 있는 하드웨어에 관한 입출력 정보, IRQ 값 등을 출력합니다.
13. quota
- 각각의 사용자들이 사용할 수 있는 디스크의 용량을 나타냅니다.
14. rdev (root device)
- 내부에 ramsize, swapdev, vidmode, rootflag의 프로그램이 구성되어 있습니다.
15. uname (unix name)
- 사용중인 운영체제에 대한 정보를 출력합니다.
* - a(all) 현재 사용중인 운영체제, 커널의 컴파일 정보 등을 출력
16. su
- 다른 사용자로 login합니다.
17. shutdown
- 시스템을 종료 합니다.
* - t n 옵션 t 뒤에 n 초 후에 경고 메시지와 kill 신호 보냄
* - h (halt) 완전히 닫음
* - r (reboot) 종료후 재부팅
* - f (fast) 빠른 리부팅(파일 시스템 검사 생략 )
* - c (cancel) 예약 되어 있는 종료 취소
* - k (kidding) 정상상태에서 종료 시간시 프로그램 정지
18. reboot
- 재부팅을 합니다.
* - q 현재의 실행프로그램을 종료하지 않고 재부팅
19. kill
- 프로세스 종료, 현재 실행중인 프로세스를 강제 종료시 사용합니다.
* -2 : 실행 중인 프로세스에게 인터럽트 키 신호 보냄
* -9 : 가장 확실하게 실행 중인 프로세스를 종료
20. tty
- 현재 사용하고 있는 단말기 장치의 경로명, 파일명을 알려줍니다.
21. whereis
- 실제 프로그램이 어떤 디렉토리에 존재하는지 모든 경로명을 보여줍니다.
22. fsck (file system check)
- 파일 시스템의 상태 검사하고 잘못된 것을 수정 합니다.
* - a : 검사도중 발견된 에러를 자동 복구
* - r : 검사도중 에러가 발견되면 복구 여부 확인
* - s : 순차적인 방법으로 검색
* - V : 검색 중 각종 정보 보여줌
* - N : 실제로 검사 작업 미 실시
═════════════════════════════
텔넷에서 FTP 리눅스 명령어 정리
┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉
→ ftp> quit or bye
:ftp를 종료시킨다
→ ftp> get
:다른 사이트에 있는 파일을 현재 로그인된 ftp 사이트로 복사
예) ftp> get 다른사이트의파일명 현재사이트로복사될파일명
ps) ftp>reget remote_file [local_file] local 디렉토리에 같은 이름의 파일이 있으면 부분적으로 전송된 파일로 간주되어 이어받기
→ ftp>put
: 현재 로그인된 ftp 사이트의 파일을 다른 ftp사이트로 복사할 때
→ ftp>cd
: 상대방 사이트의 디렉토리를 이동시킬 때
예) ftp>cd 상대방사이트의 절대경로명이나 상대의 패스
→ ftp>lcd
: ftp하에서 현재로그인한 디렉토리를 이동시킬 때 사용
예)lcd 현재사이트의 절대경로명이나 상대경로명
→ ftp>type
: 파일을 전송하기전 전송하는 데이터의 단위를 선택하는 것으로 binary와 문자(ASCII) 두 가지 방법으로 나뉜다.
Binary일 경우는 전송단위가 2진법으로 실행파일이나 압축파일의 경우 사용되고 보통문자일경우는 ASCII로 전송한다
예) ftp>type binary , ftp>type ascii
→ ftp>mget
: 상대방 ftp 사이트에 있는 특정 디렉토리에서 여러 개의 파일을 동시에 가져오고자 할 때 사용하는 것으로 파일명을 하나하나 입력할 필요가 없을 때 사용. 파일의 전송중 user에게 전송여부 확인메세지가 나타나는데 y 또는 n(no)를 응답
예) ftp>mget parameter
parametet -> 메타문자(혹은 wildcard문자)를 사용한 파일명으로 이들 문자는 특정 문자열이 공통으로 들어갈 부분만 명시하고 나머지는 아스티링(astrik)를 처리함으로써 같은 문자열을 찾아내기 위한 방법으로 사용한다.
즉 파일명이 cest, test1, est, testtest, esttt는 *est*로 표시될수 있다.
→ ftp>mput
: mget의 반대로 현재의 로그인된 사이트에서 다른 사이트로 파일을 전송하고자 할 때 메타문자를 이용하여 여러 개의 파일을 전송할 수있다. 파일의 전송중 사용자에게 전송여부를 확인하는 메시지가 나타나는데 전송여부에 따라 y 또는 n으로 응답
예) ftp>mput parameter
parameter -> 메타문자(wildcard문자)를 사용한 파일명
→ ftp>prompt
: 앞의 mget나 mput는 사용자로하여금 전송여부를 시스템이 확인하는데 이때 대량의 파일을 주고받을 때 사용자는 일일이 이를 y나 n로 응답하는 불편함이 있다. 응답을 주지않고 무조건 실행하려할 때 쓰이는 명령어
예) ftp>prompt parameter
parameter -> y일 경우는 응답에 따라 실행하라는 의미, n 일 경우 무조건 실행하라는 뜻. 본래 prompt는 y 값을 가진다.
–pr 이라고 해도 됨
→ ftp>ls
: 현재 디렉토리의 파일 확인
예)ftp>ls parameter
parameter 에 –l 을 주면 각 파일에 대해 파일명과 함께 부수적인 정보를 나열 parameter 에 –al을 주면 파일인지 디렉토리 인지의 여부 및 파일의 제반특성, 크기등을 보여준다
→ ftp>pwd
: 현재 위치를 알아보는 명령어
→ ftp>mkdir
: 특정 디렉토리를 만드는 명령어, 예) mkdir 디렉토리명
→ ftp>rmdir
: 특정 디렉토리를 제거하는 명령어, 예)rmdir 디렉토리명
→ ftp>verbose -> ver 라고도 함
: ftp명령어 수행중 전송중에 발생하는 정보를 화면에 보여줄 것인지에 대한 여부를 결정하는 명령어(시간과 파일사이즈)
예) ftp>verbose parameter
parameter -> on 또는 off 로 on일 경우에 화면에 보여주고 off일 경우는 보여주지 않는다.
→ ftp> delete
: 파일을 지우는 명령어, ftp>delete 파일명
→ ftp>user
: 현재 ftp 사이트에서 다른 사용자명으로 전환하고자 할 때 사용. 동일 사이트의 다른 계정으로 옮기고자 할 때 사용
예) ftp>user parameter
parameter -> 현재 사이트의 다른 계정의 사용자명
→ ftp>open
: 일반사용자가 ftp 명령어를 입력하고 return키를 누른다음 ftp>라는 프롬프트에서도 연결시키는 경우가 있을수 있는데 이때 open 이라는 명령어를 사용
예) ftp>open parameter
parameter -> 호스트명, 호스트명.도메인명, IP Address
→ ftp> close
: 현재사이트 연결끊고 다른사이트로 연결
→ ftp>rename
: ftp로 특정 사이트를 연결시킨 후, 사용자가 현재사이트에있는 파일명을 바꿀 때 사용
예)rename 현재파일명 바꾼후의파일명
++++정리++++
open(주소 또는 도메인) - ftp 서버에 연결
close -------------- 해당ftp 접속종료
bye --------------- ftp 프로그램 종료
ls ---------------- list, 목록보기
cd(디렉토리명) ------ 디렉토리 바꾸기
ascii -------------- 텍스트 파일 전송모드
bin --------------- 이진파일 전송 모드
get 파일명 -------- 하나의 파일 내려받기
mget 파일명 ------- 여러 개의 파일 내려받기, wildcard 문자 사용가능
put 파일명 --------- 하나의 파일 올리기
mput 파일명 ------- 여러 개의 파일 올리기, wildcard 문자 사용가능
pwd -------------- 현재 경로보기
hash ------------ 파일전송과정 보여주기(버터단위 ‘#” 표시
? --------------- 도움말
rstatus ----------- remote 시스템의 상황 표시
status ----------- 현재 연결된 ftp 세션 가지 모드에 대한 설정을 보여준다
dir ------------remote 시스템의 디렉토리 내용을 디스플레이
1. FTP 서버에 접속하기
●방법 1 : ftp (도메인 네임) 혹은 (IP)를 입력한다.
예) ftp ftp1.netscape.com
●방법 2 : ftp 후에 프롬프트가 “ftp>”로 뜨면 “open (도메인 네임) 혹은 (IP주소)”를 입력한다.
예) open ftp1.netscape.com
●프롬프트가 “ftp>”인 상태에서 여러 가지 명령을 입력할 수 있다.
2. 디렉토리(Directory) 보기와 바꾸기
FTP 서버에서 자료는 디렉토리 구조에 따라서 정리되어 있다. 따라서 사용자의 컴퓨터에서처럼 디렉토리의 내용을 보거나 원하는 디렉토리로 바꾸는 등의 작업이 필요하다. 이 작업들은 “ftp>” 프롬프트 상태에서 “ls”명령어로 확인하고, ”cd” 명령어를 사용하여 바꿀 수 있다.
●ls : list라는 의미로 FTP서버의 디렉토리 구조를 보여 준다. 예) ls -al (list all)
●cd (디렉토리) : Change Directory의 약자로 원하는 디렉토리로 이동한다. 예) cd hnc
3. 전송 모드
FTP에는 아스키(ASCII)와 이진(Binary)라는 두 가지 전송 모드가 있다.
●ASCII : 일반적인 텍스트 문서 전송
●BINARY : 그림이나 실행파일 등 모든 형식 파일 지원
●모드 전환
: ascii : ASCII 전송 모드로 바뀜
: bin : 이진 모드로 바뀜. 일반적으로 이진 모드를 사용하는 것이 편리하다.
4. 파일 받기
파일 받기 명령은 get과 mget이 있다.
●get 파일명 예) get test.doc
: 파일이름으로 지정된 파일을 전송 받으므로 정확한 이름(Full Name)을 저정한다.
●mget 파일명 예) mget *.doc
: Multiple get의 뜻을 가지고 있으며 여러 개의 파일을 동시에 전송받을 때 사용한다.
명령어. 파일이름 부분에서는 ‘*’, ’?’과 같은 만능문자(Wild Card)도 사용할 수 있다.
5. 파일 보내기
파일을 보내는 경우에는 받는 경우와 달리 계정이 필요한 경우가 많다. 일반적으로 anonymous 계정은 특정한 디렉토리를 제외하고는 쓸 수가 없으며 이는 바이러스 등의 침입을 막기위한 것이다. 파일을 전송할 때에는 put과 mput명령어를 사용한다.
●put 파일명 예) put test.doc
: 파일이름으로 지정된 파일을 전송하므로 정확한 이름(Full Name)을 입력한다.
●mput 파일명 예) mput *.doc
: Multipe put의 뜻을 가지고 있으며 여러 개의 파일을 동시에 전송할 때 사용하는 명령어이다.
Mget처럼 파일이름 부분에서 ‘*’,’?’ 과 같은 만능문자 사용도 가능하다
6.도스 FTP명령어
ftp cim ⇒ k8317610 ⇒ 4751 ⇒ ftp> ⇒ ls -l ⇒ bin, asc ⇒ get 가져오기 ⇒ hash
(파일전송 보여주기) ⇒ !dir a:( a드라이브 보기) ⇒ put a:money.html
════════════════════════════
그냥 쓸만한 리눅스 명령어들
┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉
addbib - 도서목록 형식의 데이터베이스를 만들거나, 확장
apropos - 사용설명서의 키워드 검색
ar - 라이브러리 만들기, 관리
at, batch - 원하는 시간에 원하는 명령을 실해하게 하는 명령
awk - 패턴 검색과 언어 처리
banner - 큰 글자(배너) 만들기
basename - 경로 이름에서 마지막에 있는 이름만 출력
biff - 자신에게 편지가 배달되면 알려주는 명령
bin-mail, binmail - 예전에 사용한 전자우편 프로그램
cal - 달력보기
calendar - 간단한 일정표
cat - 파일 병합과 내용 보기
cb - 간단한 C 프로그램 beautifier(?)
cc - C 컴파일러
cd - 작업 디렉토리 바꾸기
checknr - nroff 또는 troff 입력 파일 검사; 오류를 보여준다
chgrp - 파일의 사용자 그룹 바꾸기
chmod - 파일의 접근 권한 바꾸기
clear - 터미날 화면 깨끗이 하기
cmp - 두 파일을 바이트 단위로 비교
colcrt - troff 파일의 밑줄 속성 문자 처리
comm - 지정 두파일의 줄 단위 비교와 그 처리
compress, uncompress, zcat - 파일 압축관련 유틸리티들
cp - 파일 복사
cpio - copy file archives in and out
cpp - C 언어 전처리기
csh - C 문법과 비슷한 쉘 스크립트 문법과 기타 여러 기능이 내장된 쉘
ctags - ex 나 vi 편집기에서 사용될 tag 파일을 만드는 명령
date - 시스템 시간 보기나 지정하기
dbx - 소스 수준의 디버거
deroff - nroff, troff, tbl, eqn 관련 내용 지움
df - disk free: 디스크의 남은 용량 보기
diff - 두 파일의 차이점 비교
du - disk used : 디스크 사용량 보기
echo - 인자를 표준 출력으로 출력
ed, red - 기본 줄 편집기
eqn, neqn, checkeq - 수식 표현 포멧 도구
error - 컴파일러 오류 메시지 목록
ex, edit, e - 줄 편집기
expand, unexpand - TAB 문자를 공백문자로 바꿈, 또는 그 반대로
expr - 인자를 수식으로 처리
file - 파일 형식 알아보기
find - 파일 찾기
finger - 사용자 정보 알아보기
fmt, fmt_mail - 간단한 문서나, 편지 포멧 도구
fold - 긴 줄 출력 방법 지정
ftp - 파일 전송 프로그램
gcore - 실행 중인 프로세스의 core 이미지를 구한다.
gprof - call-graph profile data(?)를 보여줌
grep - 문자열 찾기
groups - 사용자의 그룹을 보여줌
history - 이전 명령 보기
hostname - 현재 시스템 이름을 보여줌
imake - makefile 만드는 프로그램
indent - C 프로그램 소스 파일을 들여쓰기 하는 포멧 도구
install - 파일 설치
join - 관계형 데이터베이스 연산자
kill - 프로세스 죽이기 - "마누라 죽이기"와 상관없음 :-)
last - 사용자가 마지막 접속 상태를 보여줌
ld, ld.so - 링크 편집기, 동적 링크 편집기
leave - 자신의 접속 종료 시간을 알려줌
less - more 명령의 확장
lex - 어휘 분석 프로그램 생성기
lint - C 프로그램 verifier
ln - 파일의 하드, 심벌릭 링크 명령
login - 시스템 접속 명령
look - 시스템 디렉토리나, 정열된 목록에서 단어 찾기
lookbib - 도서목록형 데이타베이스에서 찾기
lorder - 오브젝트 라이브러리의 관계 찾기
lp, cancel - 인쇄 시작, 취소
lpq - 인쇄 작업 상황 보기
lpr - 인쇄
lprm - 인쇄 작업 지우기
ls - 디렉토리 내용 보기
mail, Mail - 전자 우편 프로그램
make - 실행 파일을 만들거나, 특정 작업 파일을 만들 때 사용하는 도구
man - 온라인 사용자 설명서를 보는 명령
mesg - 메시지 수신 상태를 보거나 지정
mkdir - 디렉토리 만들기
mkstr - C 소스 파일을 참조로 오류 메시지 파일을 만듬.
more, page - 텍스트 파일 보기 명령
mv - 파일 이동이나, 이름 바꾸기
nawk - 패턴 검색과 언어 처리
nice - 낮은 우선권에서 명령 실행
nm - 심블 이름 목록 보기
nroff - 문서 포멧 도구
od - 8진수, 10진수, 16진수, ascii 덤프
passwd, chfn, chsh - 비밀번호, 핑거정보, 쉘 바꾸기
paste - 여러파일의 서로 관련 있는 줄 연결시키기
pr - 문서 파일 양식화 도구
printenv - 현재 환경 변수들의 내용과 그 값 알아보기
prof - profile 자료 보기
ps - 현재 프로세스 정보 보기
ptx - permuted(순열화된?, 교환된?) 색인 만들기
pwd - 현재 작업 디렉토리 보기
quota - 한 사용자에게 지정된 디스크 할당량보기
ranlib - archive를 random 라이브러리로 변화
rcp - 리모트 카피
rcs - RCS 파일 속성 바꾸기
rcsdiff - RCS revisions 비교
rev - 한 줄의 문자열 꺼꾸로
rlogin - 리모트 로그인
rm, rmdir - 파일, 디렉토리 지우기
roffbib - 도서목록형 데이터베이스 보기 또는 양식화
rsh - 리모트 쉘
rup - 로칼 머쉰의 호스트 상태 보기(RPC version)
ruptime - 로칼 머쉰의 호스트 상태 보기
rusers - 현재 접속자 보기 (RPC version)
rwall - 모든 사용자에게 알림(RPC)
rwho - 현재 접속자 보기
sccs - Source Code Control System (SCCS)
sccs-admin, admin - SCCS 사용 내역 파일을 만들고, 관리
sccs-cdc, cdc - SCCS 델타의 델파 주석을 바꿈
sccs-comb, comb - SCCS 델타 조합
sccs-delta, delta - SCCS 파일에 데해 델타를 만듬
sccs-get, get - SCCS 파일 버전확인
sccs-help, help - SCCS 오류나 경고 메시지 검색
sccs-prs, prs - SCCS 사용내역의 선택된 부분 보기
sccs-prt, prt - SCCS 파일에서 델타 테이블 정보를 봄
sccs-rmdel, rmdel - SCCS 파일에서 델타를 지움
sccs-sact, sact - SCCS 파일의 편집 상태를 봄
sccs-sccsdiff, sccsdiff - SCCS 파일들의 버전 비교
sccs-unget, unget - SCCS 파일의 미리 얻은 것(?)을 취소한다.
sccs-val, val - SCCS 파일 유요화
script - 화면 갈무리
sed - stream editor
sh - 유닉스 표준 쉘
size - 오브젝트 파일의 크기들을 보여줌
sleep - 지정한 시간 만큼 실행 보류
sort - 줄 정열과 검색
sortbib - 도서목록형 데이터베이스 정열
spell, hashmake, spellin, hashcheck - 맞춤범 검사(물론 영어겠지요)
split - 파일 나누기
strings - 오브젝트 파일이나, 실행 파일에서 문자열 찾기
strip - 오브젝트 파일에서 심벌 테이블과 중복된 비트 삭제
stty - 터미날 설정
su - super-user, 임시적으로 새 ID로 바꿈
symorder - 심벌 순서 바꿈
tabs - 터미날 tab 크기 지정
tail - 파일의 끝 부분 보기
talk - 다른 사용자와 이야기하기
tar - 여러 파일 묶기 또는 묶긴 파일 풀기
tbl - nroff 또는 troff의 도표 작성 도구
tee - 표준 출력으로 방향 전환
telnet - TELNET 프로토콜을 이용한 원격 리모트 호스트 접속
test - 주워진 환경이 참인지, 거짓인지를 돌려줌
tftp - 간단한 ftp.
time - 명령 실행 시간 계산
touch - 파일 날짜 관련 부분을 바꿈
troff - 문서 양식화 도구
true, false - 쉘 스크립트에서 사용되는 참/거짓을 리턴하는 명령
tsort - topological sort
tty - 현재 터미날 이름 보기
ue - MICROemacs
ul - 밑줄 속성 문자 표현
unifdef - cpp 입력 줄에서 ifdef 부분 바꾸거나 지움
uniq - 중복되는 빈줄 지우기
units - 프로그램 변환도구
uptime - 시스템 부팅 기간 보기
users - 현재 접속 사용자 보기
uucp, uulog, uuname - 시스템 간의 복사
uuencode, uudecode - 이진 파일을 아스키파일로 인코딩, 반대로 디코딩
uusend - 리모트 호스트에 파일 보내기
uux - 리모트 시스템 명령 실행
vacation - 자동으로 편지 답장하기
vgrind - grind nice program listings
vi, view, vedit - ex 바탕의 편집기
vtroff - 문서 양식화 도구
w - 현재 누가 접속해 있으며, 무엇을 하고있는지
wait - 프로세스가 마치기를 기다림
wall - 모든 사용자에게 알림
wc - 단어, 줄, 바이트 계산
what - 파일에서 SCCS 버전 정보 알아냄
whatis - 명령의 간단한 설명 보여줌
whereis - 찾는 명령의 실행파일, 소스, 맨페이지가 어디 있는지 경로를 보여줌
which - 명령만 찾음.
who - 시스템에 접속되어 있는 사람만 보여줌
whoami - 현재 사용하고 있는 자신이 누군지 보여줌
write - 다른 사용자의 화면에 특정 내용을 알림
xargs - 명령행 인자 처리 명령
xstr - extract strings from C programs to implement shared strings
yacc - yet another compiler-compiler: 파싱(형태소분석) 프로그램 생성기
yes - 항상 yes만 응답하는 명령
zcat - 압축 파일 내용보기
════════════════════════════
리눅스 기본 명령어
┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉
adduser 또는 useradd---사용자 추가
# adduser thkim
thkim란 아이디를 만든다.
# adduser -p world -g class -s '/bin/bash' -d '/home/thkim' thkim
비밀번호가 world이고 그룹은 class 쉘은 bash 홈디렉토리는 /home/thkim 인 thkim란 아이디를 만든다.
userdel ---사용자 삭제
# userdel thkim
thkim란 아이디를 삭제한다.
# userdel -r thkim
thkim란 사용자의 홈 디렉토리까지 삭제한다.
passwd ---비밀번호 지정
# passwd thkim
thkim란 아이디에 패스워드를 부여한다.
ls ---파일과 디레토리에 대한 정보를 출력한다.
# ls -al
-l: 파일의 모든 정보 출력
-c: 최근 변경한 시간 순서데로 출력
-d: 디렉토리 명만 출력
-F: 파일의 특성을 출력( /디렉토리 *실행화일)
-a: dot(.)으로 시작하는 파일의 이름을 포함한 모든 내용을 출력
현재 디렉토리의 모든 파일을 상세히 본다.
cd ---디렉토리 사이를 이동한다.[현재 디렉토리 변경]
# cd -
방금 전의 디렉토리로 이동한다
# cd ~
홈 디렉토리로 이동한다
# cd ..
한 단계 위의 디렉토리로 이동한다
# cd /
최상위 디렉토리로 이동한다
# pushd .
현재 디렉토리를 기억한다
# popd
기억된 디렉토리로 이동한다[한 번만 가능]
cp ---파일을 다른 디렉토리로 복사하거나 다른 이름으로 복사한다.
# cp thkim /root
thkim란 파일을 /root 로 복사한다.
mv ---파일을 다른 디렉토리로 이동하거나 파일명을 변경한다.
# mv thkim hoho
thkim란 파일을 hoho로 바꾼다.
# mv thkim /work
thkim란 파일을 /work/로 이동 시킨다.
rm ---파일을 삭제한다.
# rm /root
/root 디렉토리를 지운다 :)
mkdir ---디렉토리를 생성한다.
# mkdir thkim
thkim란 디렉토리를 만든다.
rmdir ---디렉토리를 삭제한다.
# rmdir thkim
thkim란 디렉토리를 지운다
# rm -r tmp
tmp 디렉토리와 모든 내용을 지운다.
man ---지정한 명령어에 대한 설명 또는 도움말을 출력한다.
# man ls
ls에 대한 설명을 본다.
info ---man명령어 보다 자세히 나와 있음
# info ls
ls에 대한 설명을 본다.
more ---지정한 파일의 내용을 한 화면에 출력하면서 잠시 멈춘다.
# more thkim
thkim 파일을 본다
종료는 q
cat ---지정한 파일의 내용을 출력한다.
# cat thkimmore
thkim 파일을 한 화면씩 본다.
grep ---특정 파일내의 지정한 패터[문자열]과 일치하는 행을 출력한다.
# cat thkimgrep thkim
thkim란 파일에 thkim라는 문자열을 찾는다.
chmod ---파일의 접근권한[도스에서의 속성]을 변경한다.
# chmod go-rwx /root or chmod 700 /root
/root 디렉토리에 그룹과 기타 사용자의 읽기 쓰기 실행 권한을 없앤다.
u: 파일 소유자, g: 그룹, o: 기타 사용자, a: 모든 사용자
+: 사용허가부여, -: 사용허가박탈, =: 허가 취소
r: 읽기 허가, w:쓰기 허가, x: 실행 허가
r = 4, w = 2, x = 1
chown ---파일의 소유자를 변경한다.
# chown thkim file
file의 소유권을 thkim로 바꾼다.
df ---사용가능한 디스크의 용량을 출력한다.
# df
사용 가능한 디스크 용량을 출력한다.
du ---지정해준 디렉토리내의 파일이 차지하는 용량을 알아내는 명령어
# du -b /home
/home 디렉토리 밑의 용량을 바이트로 표시한다.
# du -sh /usr
/usr 디렉토리 밑의 용량을 메가바이트 단위로 보여준다.
cfdisk --- 디스크 정보를 출력한다.
# cfdisk
hdparm ---하드 디스크 인터페이스
# hdparm -c3 -d1 /dev/hda
hda드라이브 32bit전송 dma모드를 On 시킨다.
find ---주어진 파일명과 동일한 파일을 찾고, 그 경로를 출력한다.
# find / -name thkim -print
최상위 루트 디렉토리부터 검색하여 검색된 파일을 한 행에 하나씩 표준 출력
# find . -name thkim -print
현제의 작업 디렉토리에서 검색
# find / -size +1000 -print
최상위 루트에서 크기가 1000블록 이상인 파일 검색
# find . -size -1000 -print
현 디렉토리에서 크기가 1000블록 이하인 파일 검색
# find . -mtime +10 -print
10일 이전에 수정된 파일 검색
# find . -mtime -10 exec rm {} \:
10일 이내에 수정한 파일을 검색하여 모두 지운다
# find / -cmin 5 -print
5분전에 마지막으로 수정된 파일을 찾을 수 있다.
# find /home -empty -print
/home 디렉토리에 용량이 0인 파일과 디렉토리를 찾는다.
# find / -perm -4000 -print
퍼미션이 4000 이상인 파일을 모두 출력한다.
finger ---호스트에 사용자가 로긴했는지 검사
# finger thkim@thkim.com
thkim.com이란 호스트에 thkim란 사용자가 접속 했는지 검사하구 있다.
chfn --- finger 정보를 수정한다.
# chfn thkim
thkim의 finger정보를 수정한다.
file --- 파일에 대한 간략한 정보를 본다.
# file ls
ls파일에 대한 정보를 출력한다.
jops ---실행중인 프로그램을 확인한다.
# jops
실행중인 프로그램을 확인한다.
env ---현재 사용하고 있는 terminal 정보를 볼 수 있는 명령이다.
# env
현재 사용하고 있는 terminal 정보를 볼 수 있는 명령이다.
history ---최근에 사용했던 명령어를 기억하는 명령
# set history=100 set savehist=100
최근에 사용했던 100개의 명령어를 기억하기
whereis ---binary, source, manual page files의 위치를 찾을 수 있는 명령
# whereis ls
ls 파일의 위치를 찾아 그 경로를 표시한다.
which ---각 사용자가 정의한 ~/.cshrc 화일에서 정의 한 내용을 이용하여 사용자에게 명령의 위치를 알려줌
# which mail
which 명령이 활용하는 내용은 다음과 같다.
1 ~/.cshrc 화일의 경로를 따라 명령이 있는곳을 검색
2 ~/.cshrc 화일에서 정의한 alias의 검색
kill --- 실행중인 프로그램을 종료시킨다.
# kill -9 555
pid가 555인 프로세스를 종료 시킨다
mount ---기억장치 디렉토리에 붙여쓰기
# mount -t iso9660 /dev/cdrom/ /mnt/cdrom
시디롬을 /mnt/cdrom이란 디렉토리에 마운트 시킨다
tar ---파일들 묶기/풀기
# tar -zcvf thkim /etc
/etc 디렉토리를 thkim란 파일로 압축시킨다.
# tar -zxvf thkim /etc
압축된 thkim란 파일을 /etc디렉토리에 압축을 푼다.
# tar -zcvf thkimall thkim thkim2 thkim3
thkim thkim2 thkim3 파일을 thkimall 파일로 압축한다.
clear ---화면지우기
# clear
현재 화면을 깨끗이 한다
touch ---내용이 없는 빈 파일을 생성, 이미 생성된 파일의 수정 시간 갱신
# touch [option] [시간] [파일명]
who or w---현재 사용자 확인
# who
현재 리눅스를 이용하는 사용자를 확인한다.
ps ---프로세스 상태 보여주기
# ps axgrep netscape
현재 netscape가 실행 되었는지 확인한다.
pwd ---현제 디렉토리 표시
# pwd
현재 디렉토리가 출력된다.
cal ---달력을 표시한다
# cal 9 1999
1999년 9월 달력을 출력한다.
date ---현재 시간과 날짜를 화면에 표시한다.
# date
현재 시간과 날짜를 화면에 표시한다.
alias ---자주 쓰이는 명령어를 쓰기 편하게 바꾸는 명령
# alias dir='ls -al'
ls -al명령어를 dir로 실행 가능하게 만든다.
# alias 복사=cp
자 이제 cp명령 대신 '복사'라는 명령을 내려도 된다.
whoami ---현재 사용자를 표시한다.
# whoami
유사 명령어 who am i
shutdown ---리눅스 시스템을 종료시 쓰는 명령어
# shutdown -h now
시스템을 종료 시킨다.
# shutdown -r now
시스템을 리부팅 시킨다.
# shutdown -r -t 12:00
시스템을 오전 12시에 리부팅 시킨다.
halt ---리눅스 시스템을 종료시 쓰는 명령어
# halt
시스템을 종료 시킨다.
reboot ---리눅스 시스템을 리부팅시 쓰는 명령어
# reboot or [ Ctrl + Alt + Del ]
시스템을 리부팅 시킨다.
════════════════════════════════════
비슷한 기능을 하는 linux / dos 명령어
┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉
list 보기 ls / dir
디렉토리 생성 mkdir / mkdir , md
디렉토리 삭제 rmdir / rmdir , rd
디렉토리 트리 ls -R / tree
파일 삭제 rm / del , erase
파일 복사 cp / copy
파일 이동 mv / move
이름 변경 mv / rename
change directory cd / cd
현재 디렉토리 표시 pwd / cd
화면 정리 clear / cls
명령어 해석기 sh, csh, bash / command.com
파일 내용 표시 cat / type
도움말, 메뉴얼 man / help
쉘 종료, 도스창 종료 exit / exit
시간 표시 date / time
그대로 출력 echo / echo
환경변수 표시 set,env / set
경로 보기 echo $PATH / path
버전 정보 uname -a / ver
예전에 도스를 배울 때
내부 명령, 외부 명령 나눠서 배웠습니다.
제 기억에 위에 나열한 것은 내부 명령이 될 것이고
아래에 나열하는 명령은 외부 명령이 될 겁니다.
대부분 linux 에 있는 이름과 동일하거나 비슷하고 기능도 같거나 유사합니다.
<>
사용자 정보 출력 finger / finger
ping ping / ping
라우팅 테이블 route-n / route print
네임서버 쿼리 툴 nslookup / nslookup
telnet telnet / telnet
ftp ftp / ftp
네트워크 경로 trace traceroute / tracert
< 파일, 디렉토리, 문자열 관련 >
파일 안의 문자열 찾기 find / find
파일 안의 문자열 찾기 grep / findstr
긴 파일 한 화면씩 출력 more / more
2개 파일 내용 비교 diff / fc, comp
라인 에디터 ed / edlin
문자열, 라인별 정렬 sort /sort
하위 디렉토리까지 복사 cp-R / xcopy
file 속성 표시 lsattr / attrib
현재 경로를 저장 후 이동 pushd / pushd
pushd로 저장한 경로로 이동 popd / pupd
화일 감추기 mv file .file / ATTRIB +h or -h
압축 tar, zip / pkzip
< 시스템 관련 >
프로세스 정보 ps, top / taskmgr
컴퓨터 호스트명 hostname / hostname
scheduling at, cron / at
프로세스 종료 kill, killall / tskill
시스템 종료 shutdown, halt, init 0 / shutdown
file system 관련 mke2fs / format
ip표시,interface표시, 설정 ifconfig / ipconfig
fdisk fdisk / fdisk
디스크 검사 fsck /chkdsk
free memory 보기 free, top / mem
scandisk fsck, debugfs / scandisk
< 기타 >
파일 인쇄 lpr / print
프린트 큐 보기 lpq / print
윈도우즈 시작(windows 3.1), X-window 시작 startx / win
Delphi : DateUtils.pas 날짜함수 정리
http://www.delmadang.com/community/bbs_view.asp?bbsNo=21&bbsCat=0&indx=209893&page=41 델파이에 날짜함수를 모아둔 DateUtils.pas 가 있습니다. ...
-
<자료형(data types)> 단순형 문자열형 구조형 포인터형 가변형 정수형 문자형 대수형 열거형 범위형 실수형 단문자열형 장문자열형 광포(Wide) 문자열형 배열형 레코드형 집합형 무...
-
uses WinInet; const INTERNET_RAS_INSTALLED = $10 ; INTERNET_CONNECTION_OFFLINE = $20 ; INTERNET_CONNECTION_CONFIGUR...
-
[팁] 프로젝트의 실행파일을 UPX로 압축하는 메뉴추가하기 양병규 (bkyang) 2001-11-20 오후 3:22:37 카테고리:강좌 2902회 조회 첨부파일 다운로드 3_upx.exe 델파이의 Tools메뉴에 upx를 추가하고 Pa...