June 2, 2009 at 6:17 am
· Filed under Linux, Unix
Here we see that we have a back slash created by mistake.
user:/var/www/core# ls -l
total 56
-rw-r–r– 1 root root 213 2009-06-01 07:14 \
-rw-r–r– 1 user user 378 2009-05-21 09:14 ads.php
We try to delete it but it is not possible because the back slash is a special charter.
user:/var/www/core# rm \
>
So we have to go and list out the inode numbers. Those are the inode numbers in the first collum.
user:/var/www/core# ls -li
total 56
458132 -rw-r–r– 1 root root 213 2009-06-01 07:14 \
457759 -rw-r–r– 1 user user 378 2009-05-21 09:14 ads.php
So now we use find to delete the inode number which in turn deletes the file.
user:/var/www/core# find . -inum 458132 -exec rm -i {} \;
rm: remove regular file `./\\’? y
user:/var/www/core# ls -l
total 52
-rw-r–r– 1 user user 378 2009-05-21 09:14 ads.php
Permalink
July 11, 2008 at 8:12 am
· Filed under Unix
So you just logged into your unix system and you started typing and then oops you typed a wrong letter I mean charater.
root@server# ssfdkjfkjf^?^?^?^?
What are those funky charaters at the end, yup they are me trying to use the back space, but I just end up getting further away from the charaters that I am tryign to delete.
So now for the majick solution.
root@server# stty erase ^?
so the command stty sets options for the terminal session. Then you are telling it what key you want to use to erase with. Which is what the ^? is the erase key being used, so type stty erase space key then back space key then Enter, and you should be back to sanity once again.
Permalink
July 9, 2008 at 7:05 am
· Filed under Linux, Unix
So you go to use crontab -e and you get some strange stuff at the bottom of the line. Yup you are in ee, which is even older then vi. This can often happen when you are using a serial connection, and even when using ssh. This is a simple fix, with examples below.
TERM=vt100 ; export TERM ; EDITOR=vi;export EDITOR
user@server:~$ echo $TERM
xterm
user@server:~$ TERM=vt100 ; export TERM ; EDITOR=vi;export EDITOR
user@server:~$ echo $TERM
vt100
Permalink