/ LINUX

Open Source Software - Lab mission 2 - linux command line

Linux Command Line

[Lab mission]


(Chapter1) - What Is The Shell?

1.date

display the current time and date

52190802364

2.cal

display current month calendar

52190804954

3.df

display current amount of free space on your disk

52190812811

4.free

display free memory

52190816349


(Chapter2) - Navigation

1.pwd (현재작업폴더)

print name of current working directory

52190865535

2.cd (폴더이동)

change directory

52190872983

3.ls (폴더의 내용물 리스트)

listing the contents of a directory

52190754748

ls -a : list all file
ls -l : display result in long format

(Chapter3) - Exploring The System

1.file

print a brief description of the file’s contents

52191009071

2.less

view the contents of the file. To exit less

52191076214


(Chapter4) - Manipulating Files And Directories

1.cp (복사)

copy files and directories

cp -a : copy the files and directories and all of their attributes, including 	
	    ownerships and permissions.
cp -r : Recursively copy directories and their contents.

52191115831

2.mv (이동)

move/rename files and directories

52191126635

3.mkdir (폴더만들기)

create directories

52191120257

4.rm (삭제)

remove files and directories

rm -i : Before deleting an existing file, prompt the user for confirmation.
rm -r : Recursively delete directories. This means that if a directory being   
        deleted has subdirectories, delete them too. To delete a directory, this 
        option must be specified.
rm -f : Ignore nonexistent files and do not prompt. This overrides the interactive 
        option.

52191170379

5.ln (링크만들기)

create hard and symbolic links

To create a hard link : ln file link
To create a symbolic link where "item" is file or directory : ln -s item link

hard link

52191226554

symbolic link

52191262157


(Chapter5) - Working With Commands

1.type

Indicate how a command name is interpreted

type command

52191312939

2.which

Display which executable program will be executed

52191317125

3.help

Get help for shell builtins

52191323810

4.man

Display a command’s manual page

52191328938

5.info

Display a command’s info entry

52191341319

7.whatis

Display a very brief description of a command

52191336456

8.alias

Create an alias for a command

alias test='cd java_src; ls; pwd'

52191370325


(Chapter6) - Redirection

1. cat

Concatenate files

52257536366

*Pipelines
command1 | command2 : the standard output of one command can be piped into the  
                      standard input of another.
2. sort

Sort lines of text

53603636633

3. grep

Print lines matching a pattern

grep pattern [file....]

52575460653

4. wc

Print newline, word, and byte counts for each file

52205760653

5. head

Output the first part of a file

52434346644

6. tail

Output the last part of a file

52325353552


(Chapter7) - Seeing The World As The Shell Sees it

1. echo

Display a line of text

52236250654

Arithmetic Expansion
echo $((2 + 2))
4
$((expression))

<Operator Description>
+ Addition - Subtraction 
* Multiplication 
/ Division 
(but remember, since expansion only supports integer arithmetic, results are integers).
% Modulo, which simply means, “ remainder.”
** Exponentiation

(Chapter8) - Advanced Keyboard Tricks

1.clear

Clear the screen

52205253654

52205255354


(Chapter9) - Permissions

1. id

Display user identity

52435750654

2. chmod

Change a file’s mode

52465250654

3. sudo

Execute a command as another user (superuser privileges가 필요할 때 super user로 접근)!

52435246654

4. passwd

Change a user’s password

36435250654


#(Chapter10) - Processes

1. ps

Report a snapshot of current processes

52435360654

2. top

Display tasks

52565250654

3. jobs

List active jobs

4. kill

Send a signal to a process

kill [-signal] PID...
5. shutdown

Shutdown or reboot the system

sudo reboot 
sudo shutdown -h now
6. pstree

Outputs a process list arranged in a tree-like pattern showing the parent/child relationships between processes.

52435730654