0

(1)HOW TO RELEASE A PATCH

Suppose you make a program by the name techviolation.c, and you distributed your program to different users. But now you have made changes in your program and you want that users should have these changes as a patch. Then firstly you should have an old copy of your program lets say techviolation.c.old, now use the following commands.

#diff -c techviolation.c.old techviolation.c > techviolation.patch

now users can get the latest updates by

patch > techviolation.patch


(2)CREATING DIRECTORIES WITH USER DEFINED PERMISSIONS

Generally when we make a directory(with mkdir command), the permission assigned are the default permissions and if we need to change those default permissions then we use chmod command. But we can give the desired file permissions at the time of creation of the directory itself. Lets see how

#mkdir /techviolation -v -m 1777

here -m flag is used to set the permission(in above case 1777 i.e read,write,execute to everyone) -v is used for verbose mode.

Check the permissions by

#ls -lhd /techviolation

(3)SOME SHELL-PROMPT TIPS THAT YOU MUST TRY

(a)Setting up an alias for a command that is used many times is a general habit. But sometimes we want that the original command should execute. Lets see how it can be done

#alias ls=’ls -la’

this will create an alias of ls command

But to run ls as original command use any of the following method

#command ls

#”ls”

#\ls

(b)If you are puzzled with too many aliases and want to know whether an alias is assigned to a particular command or not, you can do this by this

#type ls

this command is used to find whether alias is there for ls command or not

#unalias ls

to remove the alias and recover the original ls effect

(c)Finding files.

Suppose you want to find files with extension ‘.txt’ and ‘.jpg’ in the rot directory then use this command

#find / -type f -iname “*.txt” -or -iname”*.jpg”

-type f is used to find all the files

to exclude hidden files in the result use ‘!’ operator

#find / -type f -iname “*.txt” ! -iname”*.jpg”

(d)To open an application in command line(in GNOME), use gnome-open

#gnome-open techviolation.xis

File and the application associated with it will be opened

(4)How to identify Zombie processes

When a process dies it immediately moves to Zombie state, until the parent process picks the child’s exit status from the process table. You can get the list of Zombie processes from the following command

#ps aux | awk ‘{print $8 ” ” $2}’ | grep -w Z

you will get process id of Zombie processes as the output

(5)TO DISPLAY PROCESSES THAT ARE CONSUMING MORE RESOURCES

#top | head -n 10 | tail -n 1
via

Δημοσίευση σχολίου