Wednesday, April 18, 2012

PROCESS MANAGEMENT

ps –ax                                      : display all processes
ps –u                                        : displays detailed results
ps –aux                                    : displays detailed redults of all processes
KILL pid                                  : force killing a process immediately
kill pid                                      : signals a interrupt
kill -STOP pid(CTRL + Z)       : freezes a program
kill -CONT pid                        : resumes the program
bg or fg                                   : resume a program previously freezed using (CTRL + Z)
  • Append '&' at the end of a command to make it run in the background mode

LINUX COMMANDS

$ sudo !!                     :Run the last command as root
cp filename{,.bak}    :Quickly backup or copy a file
echo $PATH                :displays current environment path
PATH=$PATH:dir        :add a path to environment variable

if there is a typing mistake in the previous command
eg: ehco instead of echo then type
    $^ehco^echo
it corrects the command in previous line and executes

save the bash history
$export HISTFILE=/home/.../todays_history

Installing software offlinefrom DVD in Fedora 15

make a dir to hold the RPMS and copy them from your DVD (mounted at /mnt/dvd I assume here) to this dir:

mkdir -p /F15repo/RPMS
find /mnt/dvd/ -name '*.rpm' -exec cp -v {} /F15repo/RPMS/ \;

Create the repo (might need to 'yum install createrepo' first
createrepo /F15repo

put the below contents in a file called /etc/yum.repos.d/F15local.repo
[F15local]
name=Fedora $releasever - $basearch - Local
baseurl=file:///F15repo/
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-fedora


now do this to make sure you can see your new F15local repo:
yum repolist

now list the available RPMS:
yum --disablerepo=* --enablerepo=F15local list available