Beruflich Dokumente
Kultur Dokumente
GUI:
system-config-date
- Adjust the date and time manually
- On Time zone tab the system clock can be set for localtime or enable
UTC (Greenwich Mean Time)
PROCESS:
PS
ps
PROCESS STATES:
Running
Sleeping
Zombie
HUP
TERM -The process is shutdown cleanly: that is, child process are terminated
first and any pending I/O operations are completed.
KILL
-If the process will not respond to a TERM signal, the KILL can be used.
However, the process may not be ended cleanly. The KILL signal should
be used only if a process will not respond to a Ctrl+C or a TERM signal.
Using KILL signals on a routine basis may cause zombie process and data
loss
SCHEDULING PRIORITY
Every running process has a scheduling priority: a ranking among running
processes determining which should get the ent ire attention of the processor.
User can change priority by setting 'niceness' value
Values range from -20(least nice, highpriority) to 19 (most nice, lowest priority)
but default to 0
Viewed with ps -o comm,nice
Non-privileged users may not set niceness value to less than zero: that is they
may not request a higher than normal priority for their processes
nice -n 5 firefox
vim /root/anaconda-ks.cfg
Press ctrl-z
Now the process is suspended, it can be resumed in the background
using bg command or resumed in the foreground using fg command
jobs
bg 1
fg 1
jobs
Now the job resumes in the foreground.
SCHEDULING TASKS:
at: scheduling one time jobs
at <time>
at -l (or) atq
at 0200
at 5:30pm December 4
at 9 am monday
at midnight + 15 minutes
at now+4 minutes
Ex:
at now+10min
at> cat /etc/passwd
at> ctrl-d
at -l
(or)
atq
CRONTAB:
crontab -eu <username>
field
allowed values
-------------------minute
0-59
hour
0-23
day of month 1-31
month
1-12
day of week
0-7 (0 or 7 is Sun, or use names)
A field may be an asterisk (*), which always stands for first and last.
Ex:
which
which - shows the full path of (shell) commands
which fdis k
/sbin/fdisk
last, lastb
last, lastb - show listing of last logged in users
BASH VARIABLES:
HI="Hello, and welcome to $(hostname)."
$ echo $HI
Hello, and welcome to stationX
COMMANDS
set | less
env | less
CONFIGURATION VARIABLES
PS1: Appearance of the bash prompt
PS1="\u@\h:\w <\!>\$"
\h hostname
\u user name
\w the current working directory
\! history number of the current command
\$ shows $ when non-privileged user, # w hen root user.
Ex:
echo $PS1
PS1=Red Hat ->
PS1=\h \w $
ALIAS
TEMPERORARY
alias c =clear
PERMENANTLY
vim /root/.bashrc
alias cp='cp -i'
alias mv='mv -i'
alias c ='clear'
Note: This is entry will be activated only after logout of that session.
LOCATE
locate <file name>
The locate database must be generated by an administrator running the
'updatedb' command
Database updates can be also automated by an administrator enabling
the DAILY_UPDATE option in /etc/updatedb.conf
locate -i <file name>
locate -r '\.txt$'
FIND
May only search directories where the user has read and execute permission
10
WEBCLIENTS:
web browser by default
http://www.google.co.in
links / elinks in the command mode
links www.redhat.com
Dow nload webpage in command mode using the command:
wget www.google.com
SSH:
/opt
11
Ex:
ping 192.168.0.254
ping -c5 192.168.0.254
ping server1.example.com
pup
Applications->System Tools- >Software Updater
List and install software updates
pirut
Applications->Add/Remove Software
View, install and un-install other packages
INODES:
An inode table contains a list of all files in an ext2 or ext3 filesystem
An inode (index node) is an entry in the table, containing information
about a file (the metadata), including:
file type, permissions, UID, GID
the link count (count of path names pointing to this file)
the file's size and various time stamps
CP AND INODES
THE CP COMMAND:
o
Allocates a free inode number, placing a new entry in the inode table
MV AND INODES
Deletes the old directory entry with the old file name
12
Has no impact on the inode table (except for a time stamp) or the location of
data on the disk: no data is moved!
RM AND INODES
THE RM COMMAND:
Decrements the link count, thus freeing the inode number to be reused
Data is not actually removed, but will be overwritten when the data blocks
are used by another f ile
HARDLINK:
A hard link adds an additional pathname to reference a single file
One physical file on the filesystem
Each directory references the same inode number
Increments the link count
The rm command decrements the link count
File exists as long as at least one link remains
When the link count is zero, the file is removed
Cannot span drives or partitions
Syntax:
ln filename [linkname]
13
Syntax:
ln -s filename linkname
MOUNT CDROM:
mount /media/cdrom /mnt
mount /dev/cdrom /mnt
eject
TAR:
tar -cvf <file name> <source dir name>
-c create
-v verbose
-f archive file name
-x extract
14
GZIP:
gzip <file with tar extension>
Ex: gzip etc.tar
ls
etc.tar.gz
GUNZIP:
gunzip <f ile na me>
Ex: gunzip etc.tar.gz
BZIP2:
bzip2 <f ile w ith tar extension>
Ex: bzip2 etc.tar
BUNZIP2:
bunzip2 <f ile name>
Ex: bunzip2 etc.tar.bz2
=======================================================
15