CTRL-C NOT WORKING
Posted: May 27, 2012 Filed under: UNIX | Tags: ctrl, ctrl c, ctrl-c is not working, ctrl-c not working, not working, oracle, Unix Leave a comment »Remove this line in /etc/profile:
trap “” 1 2 3
Logout-Login
chmod: WARNING: can’t change /home
Posted: May 14, 2012 Filed under: UNIX Leave a comment »problem: chmod 700 /home chmod: WARNING: can't change /home By default /home is used by automounter. /home is used to mount remote users' home. solution: Create and use /export/home instead. * You can also remove /home in the /etc/auto_master file
HOW TO EMPTY MULTIPLE FILES USING WILDCARD (CLEAR CONTENTS)
Posted: April 9, 2012 Filed under: UNIX Leave a comment »Hi,
You can empty some files using the same wildcard:
### This command clears data in your files. Please be careful and take your own risk !
$ for i in your_wilcard*; do dd if=/dev/null of=$i; done
This command also does the same thing, but 1st one is my fav ![]()
$ find . -name "your_wildcard*" -exec basename {} \; | awk '{print "> "$1}' > a.sh
$ . ./a.sh
try and pray
E212: Can’t open file for writing
Posted: December 6, 2011 Filed under: UNIX | Tags: can not open file for writing, Can't open file for writing, E212, E212: Can't open file for writing, open file for writing, ORA, oracle, vi Leave a comment »Hi,
If you hit this error when saving in vi, probably the directory does not exist.
E212: Can’t open file for writing
vi /mydirectory/a.sql
:w
E212: Can’t open file for writing
quit vi
ls -ld /mydirectory
ls: mydirectory: No such file or directory
tray and pray
USING OR (-o) IN FIND COMMAND
Posted: November 21, 2011 Filed under: UNIX Leave a comment »
Hi,
You can use or option (-o) in unix find commands:
find . -name “a*” -o “b*”
and this comment retrieves a* and b* wildcarded files/dirs in current directory.
Be careful when using one or more parameters more. (-mtime, ..)
find . -name “a*” -o “b*” -mtime +1
This does not retrieve 1 day old or newer a*, b* files, it retrieves a* files; or 1 day old b* files.
So it’s better to use 2 seperate commands:
find . -name “b*” -mtime +1
find . -name “a*” -mtime +1
try and pray
USING NOT EQUAL(!=) IN SHELL SCRIPTS
Posted: November 21, 2011 Filed under: UNIX Leave a comment »Hi,
Be careful when using not equal (!=) in if statements in shell scripts.
works:
if [[ "X"$VER1 != "X" && "X"$VER2 != "X" ]]
does not work properly (must be inserted white spaces before and after !=)
if [[ "X"$VER1!="X" && "X"$VER2!="X" ]]
try and pray