I want to
write here with some importance Command of Red Hat Linux Essential. If
you follow this command you can make yourself as a Linux Essential experts. I
believe that you are able to improve your
knowledge in Linux.
Follow The bellow Command ...
Red hat Essential
Follow The bellow Command ...
Red hat Essential
#startx
#vim /etc/issue
Welcome!
#passwd student
#su - student
#id student
#date
#date 10 21 05 42
2011
#cal 5 2010
#whatis cal
#cal --help
#man -K|k keyword
#man print
#info vim
#foo -y -abc
one.txt two.txt
#pwd
#ls -l /lv1
#ls -la /tmp
#ls -ld /etc
#cd
#ls -lR /home/users
#cd ..
#cd /etc/system
#cd -
#cp /etc/passwd
/tmp
#cp -r /etc/ /tmp
#cp /pearctice/*
/tmp
#cp -r /practice/*
/tmp
#cp -rpv
/etc/sysconfig /backup/sysconfig12102011
#mv /practice /tmp
#touch /newfile
#touch
{report,graph}_{jan,feb,mar}
#rm -rf /tmp/newdir
(dir with file)
#rmdir
/tmp/practice (empty dir)
#mkdir /test
#mkdir -p
/practice/new/user
#file /etc/passwd
(prints file type)
#chown root
/practice/new
#chown -R root
/practice/ (recursively)
#chown
root:marketing /practice
#chgrp accounting
/practice/new
#chgrp -R
accounting /practice/
#chmod u|g|o| +|-|=
r,w,x,s,t /practice
#chmod u+w
/practice
#chmod o+t
/practice
#chmod 764
/practice
#echo ?o*
#history
#!! (repeats last
cmd)
#!ca (repeats
command begins with "ca")
#!232 (repests
command with history number)
#vim .bashrc
export HISTCONTROL=ignoreboth
alias c='clear'
#alias c=clear
#echo file {1,2,3}
#echo "this
system's name is $(hostname)" (command expansion)
#echo "this
system's name is `hostname`" (command expansion)
#vim /script
#!/bin/bash
/bin/echo hello
#chmod u+x /script
#vim /testscript
#!/bin/bash
cp -av /etc/sysconfig
/backup/sysconfig-$(date '+%y%m%d')
echo "back up of /etc/sysconfig
completed at: $(date)"
#find /etc -name
passwd
#find /etc -name
passwd > /redirect
#find /etc -name
passwd >> /redirect
#find /etc -name
passwd &>> /redirect
#ls -l /etc | tr
'A-Z ' 'a-z'
#ls -l /etc | less
#echo "test
mail" | mail -s test user1@localhost
#echo "test
printer" | lpr -P printer1
#ls -lR /etc | tee
stage1.out | sort | tee stage2.out | sort -r | tee stage3.out | less
#tr 'A-Z' 'a-z'
< .bash_profile
or
#cat .bash_profile
| tr 'A-Z' 'a-z'
#mail -s
"test" user1@localhost <<end
hi susan
please call me
brad
end
## looping#####
#vim /bin/script
#!/bin/bash
for n in {1..10}; do
ping -c2 192.168.0.$n
done
#chmod u+x
/bin/script
####Test all host
at a time######
#vim /bin/script1
#!/bin/bash
for n in {1..10}; do
host = 192.168.0.$n
ping
-c2 $host > /dev/null
if [ $? = 0 ]; then
echo "$host is success"
else
echo "$host is failed"
fi
done
#chmod u+x
/bin/script
#####shutdown all
workstation from server
#vim /bin/script1
#!/bin/bash
for n in {1..10}; do
host = 192.168.0.$n
ping -c2 $host > /dev/null
if [ $? = 0 ]; then
ssh root@$host reboot/poweroff
else
echo "$host is blocked"
fi
done
#### conditional
exicution#####
#!/bin/bash
for x in $(seq 1
10); do
echo adding
testuser$x
(
echo -ne
"testuser$x\t"
useradd testuser$x
2>&1 > /dev/null && passwd testuser$x
) >>
/tmp/userlog
done
echo 'cat
/tmp/userlog to see new paswrds'
#cat
/etc/passwd
#less /etc/paswd
q to quit
#cat -b
/proc/meminfo (with number of each line)
#cat -A
/proc/meminfo (show all character,including non printing)
#head /etc/passwd
#head -n 15
/etc/passwd
#tail -n 3
/etc/passwd
#tail -f
/var/log/cron
#tail -f
/var/log/messages
#grep 'user1'
/etc/passwd
#date --help | grep
year
#grep -n user1
/etc/passwd (prints the number of matches)
#ps ax | grep init
(shows all process and grep init strings)
#grep root
/etc/passwd | cut d : -f 7 (cut practice)
#cut -f3 -d:
/etc/passwd
#wc /etc/passwd
#wc -m /etc/passwd
(bytes)
#wc -l /etc/passwd
(only lines)
#wc -w /etc/passwd
(only words)
#sort -r
/etc/passwd
#cut -f7 -d:
/etc/passwd | sort | uniq (uniq)
#diff -u
/practice/file /practice/file1 > file2.patch
#patch -b
/practice/file1 file2.patcch
#aspell check
/newfile
#aspell list <
/newfile
#look wh
/practice/file (looks for word begins with wh string)
what
why
#sed 's/cat/dog/gi'
#sed
'1,50s/cat/dog/gi'
#sed
'/digby/,/duncan/s/cat/dog/gi'/practice/file1
#sed -e
's/cat/dog/gi'-e 's/cow/goat/gi'
#vim /practice/file
insert mode
I (inser at begining of line)
A(append to end)
O(insert a new line above)
o(insert a new line below)
command mode
u,U ctrl+r
#vim .vimrc
:set number
#/sbin/ifconfig
eth0
#/sbin/ifup eth0
#/sbin/ifdown eth0
#system-config-network
#vim
/etc/sysconfig/network-script/ifcfg-eth0
#system-config-printer
# /etc/cups/printer.conf
#lpr -P printer1
-#3 /file1 (3 copy)
#lpq
#lprm 6
#lpstat -a (list
configured printer)
#system-config-date
#date 10 21 05 42
2011
#ps -ax | grep init
#ps -U root
#pgrep -G
accounting
#pidof cupsd
#kill 2372 (if
ctrl+c or 'term' not working)
#kill -term 2372
#man 7 signal
#nice -n 5 cat
#renice 5 -p pid
#top
#jobs
#bg 4
#fg 6
#at now+5min
cat /etc/passwd
ping -c3 server.example,com
ctrl+d
#at -l
#at -c 7
#crontab
25 15 24 07 1,3,5 (0-6)
min hour day month week
#crontab -u
testuser
#crontab -r;
crontab -l (remove cron)
#date > /logfile
| cat /logfile
#who | wc -l
>> /logfile
#ping -c2
192.168.0.12 &> /dev/null
#echo $? (0
success,1-255 failure)
#vim .bashrc
alias c='clear'
#vim /bin/script2
#!/bin/bash
read -P "enter server1 values:"
value1 value2
echo "value1 is $value1"
echo "value2 is $value2"
No comments:
Post a Comment