Links

   Quran Explorer - Interactive Audio Recitations & Translations

Monday, July 6, 2009

Basic Commands

1. Find:
find / -perm -4000 -print
find / -atime +10 -print
2. Changing file permissions:
4=read, 2=write, 1=execute
permissions are always in the order; user, group, other

$ chmod 755 file
means 7 (rwx-user) , 5 (rx-group), 5 (rx-others)
3. add default gateway
route add default gw 10.0.0.1
4. adding many routes + gateways
route add -net 10.1.0.0 gw 10.0.0.10
route add -net 10.2.0.0 gw 10.0.0.20
5. Accessing remote file systems
mount [-tnfs] 1.2.3.4:/usr/files /mnt/files
6. Allowing users to mount drives
With a special command in the etc/fstab file.....
Typical eg for fd0(A:) drive in etc/fstab:
/dev/fdo /mnt auto noauto,user 1 1
noauto: tells mount not to mount drive A on boot
user: allows any user to mount the drive into /mnt
auto: tells mount to try to find out the FS on the drive
7. Allowing users to run root programs
You can set a cmd to be suid root with chmod command
chmod _s mybin : sets mybin suid root
8. Change locales (keyboad)
loadkeys cf (others fr,us,etc)
9. Default file permissions ?
A. Linux
The default is 755
To change the default from 755 to 700, use this cmd:
umask 077 (base 8)

10. Default boot mode (3 in total)
They are defined in /etc/inittab
>Runlevel 1 is a single user mode (with no networking?)
>Runlevel 3 is the default. loads net servers + login txt
>Runlevel 5 displays the graphical login prompt
Modify the initdefault line in /etc/inittab to:
id:3:initdefault:
11. Change password:
passwd

12. File Permissions in Unix
Change group access on the file shrc in ur home dir
chmod g=rw- ~/.shrc
Make group and others have read permission only
chmod go=r-- ~/.shrc
Direclty:
chmod u=rwx,go=r-x foo
13. List directory contents
ls -l /lib/l* :long
ls -r /lib/l* :recursively down the dir tree
ls -l -r

14.
netstat -an ! more

15. See user and process owning a port
fuser -v -n tcp 6000

16.To make a symbolic link:
$ ln -s
Eg: $ ln -s /usr/doc/g77/DOC g77manual.txt

17. Make a file executable
chmod +x
Now u can refer to g77manual.txt instead of /usr/doc/g77/DOC

18. Setting Enviroment Variables
PATH : export PATH=$JAVA_HOME/bin:$PATH
JAVA_HOME: export JAVA_HOME=/usr/local/blackdown/jdk1.2.2



========
DOs Vs Linux
========
DOS Linux Notes
--------------------------------------------------

ATTRIB (+-)attr file chmod file
BACKUP tar -Mcvf device dir/
CD dirname\ cd dirname/
COPY file1 file2 cp file1 file2
DEL file rm file
DELTREE dirname rm -R dirname/
DIR ls
DIR file /S find . -name file
EDIT file vi file
jstar file
EDLIN file ed file
FORMAT fdformat,
mount, umount
HELP command man command,
info command
MD dirname mkdir dirname/
MORE < file less file
MOVE file1 file2 mv file1 file2
NUL /dev/null
PRINT file lpr file
PRN /dev/lp0,
/dev/lp1
RD dirname rmdir dirname/
REN file1 file2 mv file1 file2
RESTORE tar -Mxpvf device
TYPE file less file
WIN startx

No comments:

Post a Comment

Feel free to leave a comment