Posts

Showing posts with the label Linux

How to remove a filename with strange characters on Linux

Image
 I learnt how to remove a filename with strange characters in its name. I say:     ls -li to get the inode number, and then delete the file with:       find . -type f -inum 155192 -exec rm {} \; I adapted this from an article on 'distrowatch.com' I tried to use the graphical file manager 'Midnight Commander' but I have mapped the function keys it uses to letters that do not work anymore on my keyboard. I can use 'Midnight Commander' outside of X Windows though. My old 'find' command does not support the '-delete' option.

I first put '#' before 'rm -rf'

Image
 I always put a '#' before a 'rm -rf' before clearing out old backups. I think a bit and then remove the '#' and then run the command. I once ran '/bin/rm -rf' as the user 'root' and deleted lots of files I wanted.  I even deleted the '/etc/passwd' file and got the famous 'you do not exist' error. I work as the user 'root' because my 'X Windows' system needs this. This is because I upgraded my Linux system myself 'from scratch' and did it slightly wrong.   I get a smiley '(:0)' next to my 'root' user's 'pseudo-terminal' when I run 'who' to show who is logged on

Rename and wait before removing directories

 I deleted a 'postgres' directory when I should have renamed it and waited a few weeks to see if I needed it. Part of my browser was linked to a 'postgres' library which I deleted. My browser is now missing a panel.  I wanted to free up some space. 'postgres' is a free database but I have not used it for a while There are more tips at:  bbingo.xyz/t