Whatis UNIX: Topics
Whatis UNIX: Topics
Whatis UNIX: Topics
Whatis UNIX
Filesystem
- navigating
- modifying
- permissions
- archiving / compression
- helpers
- commands
- process
- communication
File processing
- simple commands
- piping
- devices
Whatis UNIX
UNIX is a so called operating system for workstations and has mainly ben developped at
Berkley University (BDS-UNIX). One of the striking difference between UNIX ans
many other operating systems is, that it has been a multiuser and multiprocess
environment from the very beginning. Multiprocess / multiuser means that different tasks
can be run on the same system by different people with different priviliges at the same
time.
The system used by SGI is a derivate from the original UNIX, a so called dialect, named
IRIX.
Filesystem
The following commands are all crucial for navigating in the structure of the filetree.
Unlike other systems, in UNIX a filesystem cannot only incorporate files and directorys
that are stored locally on the hard drive. It can also merge (shared) drives on other
systems (hosts) or external devices like tape drives or printers, keyboards etc.
Navigation
Ls ls [-RadLCxmlnogrtucpFbqisf1AM] [names]
Lists the content of a directory
ls -ls List in short form
ls -la All files (including .-files)
ls ./mydir List content of mydir
Pwd pwd
Print working directory name
pwd
Cd cd [ directory ]
Change working directory
cd Change to home directory
cd ~ Change to home directory
cd .. Change to parent directory
cd /usr/lib Change to absolute path /usr/lib
cd doc/letters Change to relative path doc/letters
Du du [-sarklmL] [name . . .]
Summarize disk usage
du -k Show disk usage in kblocks (1024 bytes)
du -ks * Summarize all directorys (*) and show as kblocks
Df df [-b][-f][-i][-k][-l][file-system ...]
Report number of free disk blocks. Shows usage of disks. Usefull to find out
if there is enough room to save / copy a project or file.
df -k Display disk usage in kblocks
Modifying
Permissions
Command interpretation
alias zipall 'gzip *' 'zipall' will gzip all files in the
current directory
which which [-a] [-f] [name...]
Locate a program file including aliases and path (csh only!) Searches the
command aliases and your binaries-path for the command that would have
been executed if you had entered the requested string. Sometimes, you
think that a command should be executed, but it is not. Then it is often
useful to check your aliases with 'which'.
which ll Will tell you that 'll' is aliased to 'ls -la'
(if defined like above)
Processes
ps ps [ options ]
Report process status
ps List all active processes
ps -al List all processes in long format
ps -aledf List all processes in long format with
additional information
top top [ -i interval ] [ -D fullpathname ]
Display processes having highest CPU usage. If your workstation seems to
be very slow it is often due to a running process. You can identify it using
'top' and close the application that causes the load. If the process is not yours,
you will have to ask either the owner of a superuser to shut down that
process for you.
top Updates every 5 seconds
top -i1 Updates every second
kill kill [-signal] pid
Terminate a process by default. To do so, you need the PID (process ID).
You can get that, using either the 'ps' or the 'top' command.
kill 42310 Kills the process with the number 42310 if
yours
kill -INT 42310 Sends the process 42310 the INT signal
(ctrl-c)
Communication
File processing
Since UNIX systems base heavily on plain text files for configuration, there are many
powerful tools that allow you to process such files. Since processing such files often
requires executing many commands after each other, there is something called 'piping'
that allows you to direct the output of a command into the input of the next command.
You can thus execute command chains, without saving the intermediate results to a file.
Below, you will find the simple commands first, and the chaining of them into complex
command sequences in the 'redirection & piping' section that follows.
Simple commands
Redirection:
The first thing you can do when interlinking processes, is that you
redirect input or output from / to processes.
Redirected output:
ls -la > listing.txt List dir and output to
listing.txt
Redirected input:
cat < data.txt Read the file data.txt as input
for 'cat'
Piping:
Another thing is piping data streams through a multitude of commands.