1 minute read

1. startup file

1-1 PATH

  • setting CWD(current working directory)
PATH=$PATH:.

* .: current working directory

  • print path
echo $PATH

1-2 startup file details

  • when bash starts, it reads configuration scripts ‘startup file’

  • Login shell session startup file

/etc/profileglobal configuration
~/.bash_profileuser's configuration
~/.bash_loginwhen ~/.bash_profile not found
~/.profilewhen ~/.bash_profile, ~/.bash_login not found
  • Non-login shell session startup file
/etc/bash.bashrcglobal configuration
~/.bashrcuser's configuration

1-3 alias

  • command for nickname(alias)

  • invalid when logout -> set in login configuration file

  • both command, pathname can be set

alias nickname="target"

1-4 source

  • changing config file cannot affect right now until restart shell

  • forcing to affect right now

source configfile



2. process command

2-1 terminologies

processactive entity
tasksingle or multiple process
jobcollections of job

therefore, process $\in$ task $\in$ job

  • foreground

   current task

  • background

   running behind the scene

   if write & in end of command, running in background process

   sub-shell: no stdin(keyboard)

   to prevent print on the screen: redirect to file

2-2 keystroke with ctrl

ctrl + cinterrupting
ctrl + dEOF
ctrl + hbackspace
ctrl + zstop foreground process and place in background

2-3 process

ps

usually pipelined with |

* option

-aall user process
-uuser info
-xall process whether not attached in shell
-einclude all running process
-ffull string
-llong list

2-4 top

top

viewing process dynamically

press q to quit

2-5 job

job

showing job ID

2-6 kill

  • to kill process
kill PID
  • to kill job
kill %jobID

Categories:

Updated:

Leave a comment