Linux: Basic Concepts and Command Line Usage Unit 2 ... - University of Ulm
[Pages:10]Linux: Basic Concepts and Command Line Usage Unit 2
Process Monitoring, Redirection
Steinbuch Centre for Computing (SCC)
Funding:
bwhpc-c5.de
Outline
Redirection Process Management Debugging Tools
2
Linux Shell
Redirection and pipes
Redirect output
program program > out.txt program 2> out.txt program &> out.txt
prints everything to the terminal stdout file stderr file stdout AND stderr file
program | otherprogram stdout becomes the input of otherprogram
3
Linux Shell
Redirection and pipes
Pipes
ls -l | less
This command takes the output of the long format directory list command "ls -l" and pipes it through the "less" command
du -sch * | sort -n | tail "du -sch *" lists the sizes of all files and directories, "sort -h" orders the output from smallest to largest size, "tail" displays last few
Example output: 146M Programming 403M sage-6.3.tar.gz 1.4G Downloads 4.6G sage-6.3 7.2G total
4
Linux Shell
Process management
Show running processes
top
List of run processes
htop
Shortcuts (examples):
F1 help screen
Extended version of "top"
u show only processes which belong to a certain user
F9 kill a process SIGTERM signal or SIGKILL
6
Linux Shell
Process management
7
Linux Shell
Debugging Tools
... when ps, top etc are not enough... strace: prints all system calls a process does usual usage: strace -e open someprogram
lsof: shows all open files gdb: the gnu debugger
8
Linux Shell
shell scripts
Shell script: list of shell commands in a file
Example: script1.sh
cd $HOME echo "Biggest files in my home directory:" du -sch * | sort -n | tail
Make this file executable:
chmod u+x script1.sh
Start the script:
./script1.sh
9
Linux Shell
................
................
In order to avoid copyright disputes, this page is only a partial summary.
To fulfill the demand for quickly locating and searching documents.
It is intelligent file search solution for home and business.
Related download
- bash redirections cheat sheet
- an illustrated guide to shell magic standard i o redirection
- cst8207 linux o s i idallen
- welcome to cyber aces online module 1 linux this module provides a
- module 8 pipes redirection and regex
- linux command cheat sheet share this cheat sheet loggly
- linux bash shell scripts university of wisconsin madison
- redirect stderr to stdout to file north marking
- uunniixx lliinnuuxx sshheellll iinnppuutt tutorials point
- princeton university cos 217 introduction to programming systems the
Related searches
- basic concepts and types of information systems
- linux command line pdf
- linux command line commands
- linux command line cheat sheet
- linux command line in windows
- linux command line cheat sheets
- linux command line switches
- linux command line rename file
- linux command line tutorial
- linux command line base64 decode
- linux command line basics
- the linux command line pdf