Unix sees :
files - object
processes - actions
- When a command is executed, it becomes a process
Files - file-system
types - regular, directory, symbolic, pipe, etc.
ownership - user, group, other.
permissions - read, write, execute, SUID, SGID, sticky bit.
Processes - process control mechanism
access based on ownership and type.
- real - person who 'created' the command being run.
- effective - person executing the command being run.
execution control
- foreground/background
- priority
- suspension and termination
Process interaction.
redirection (batch) - takes input from file or saves to file.
piping - allows output of one process to connect to input of another.
Command format : command [options] [arguments]
- Command - shell build-in, binary program, shell-script
- options - usually preceded by -, modify command behavior.
- arguments - provide data to program. May be filename or actual data.
Depending on command, options and arguments may be optional.
File-system view from the login shell (bash).
The home directory is the active or current working directory you are "in"
on login.
- Home is specified in system's password 'file'.
- Doesn't change unless modified in the password system.
echo $HOME
Ways to return home from another directory.
- cd $HOME
- uses the environmental variable set on login.
- cd
- by itself should return you to home in the bash shell.
- cd ~
- tilde refers to your absolute home path in bash and can be used
with commands.
Current working directory
Current working directory is the directory list that a command will use
when accessing a file if no additional path information is provided.
To change current working directory, use cd and a valid directory
path and name as an argument :
cd bin
To identify current working directory, use one of the following :
echo $PWD
- variable set by the bash shell each time you change the working directory.
- useful in scripts.
pwd
- command that prints current working dircctory.
- bash shell built-in
- /bin/pwd is a separate binary executable (original).