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
2.cal
display current month calendar
3.df
display current amount of free space on your disk
4.free
display free memory
(Chapter2) - Navigation
1.pwd (현재작업폴더)
print name of current working directory
2.cd (폴더이동)
change directory
3.ls (폴더의 내용물 리스트)
listing the contents of a directory
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
2.less
view the contents of the file. To exit less
(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.
2.mv (이동)
move/rename files and directories
3.mkdir (폴더만들기)
create directories
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.
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
symbolic link
(Chapter5) - Working With Commands
1.type
Indicate how a command name is interpreted
type command
2.which
Display which executable program will be executed
3.help
Get help for shell builtins
4.man
Display a command’s manual page
5.info
Display a command’s info entry
7.whatis
Display a very brief description of a command
8.alias
Create an alias for a command
alias test='cd java_src; ls; pwd'
(Chapter6) - Redirection
1. cat
Concatenate files
*Pipelines
command1 | command2 : the standard output of one command can be piped into the
standard input of another.
2. sort
Sort lines of text
3. grep
Print lines matching a pattern
grep pattern [file....]
4. wc
Print newline, word, and byte counts for each file
5. head
Output the first part of a file
6. tail
Output the last part of a file
(Chapter7) - Seeing The World As The Shell Sees it
1. echo
Display a line of text
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
(Chapter9) - Permissions
1. id
Display user identity
2. chmod
Change a file’s mode
3. sudo
Execute a command as another user (superuser privileges가 필요할 때 super user로 접근)!
4. passwd
Change a user’s password
#(Chapter10) - Processes
1. ps
Report a snapshot of current processes
2. top
Display tasks
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.
Subscribe to Ykss's Coding Space
Get the latest posts delivered right to your inbox