Hot answers tagged

6

Try this: rm -iv -- .\<\?php\ passthru\(\$_GET\[cmd\]\)\;echo\ m3rg3\;\?\> And for future, when you have really weird filename try to make use of the shell glob mechanism, for example: ls .*php* should be a good start. If you have many files with similar filenames, just use any unique regular substring ls .*php*cmd*echo*m3rg3* And at the end ...


6

Use ls -li to see the inode them remove the inode with find [root@server tmp]# ls -li .\<* 16163346 -rw-r--r-- 1 root root 0 Jun 23 12:02 .<?php passthru($_GET[cmd]);echo [root@server tmp]# find . -inum 16163346 -exec rm -i {} \; rm: remove regular empty file `./.<?php passthru($_GET[cmd]);echo'? y Reference: http://www.cyberciti.biz/tips/...


6

You should be able to just escape the pipe use a backslash mv te\|st test Or in your case with the space mv first\ \|\ last first_last If that does not work you can escape all the special characters by warping them with double quotes. mv "first | last" first_last


3

In my answer I will not concern myself with Vim, but instead look at the underlying mechanisms, that you have stumbled upon. It is important to understand these, as it affects the security of your entire system. It has nothing to do with owner: try it, make a file not owned by you, then give your self read not write. You will get the same results. So why is ...


3

With "wq", "!" asks Vim to ignore the read-only attribute. From the documentation: :wq [++opt] Write the current file and quit. Writing fails when the file is read-only or the buffer does not have a name. Quitting fails when the last file in the argument list has not been edited. :wq! [++opt] ...


1

In Unix everything is a file. These files are organized in a tree structure, beginning at the root /. Your filesystem or filesystems will then be mounted at the appropriate places in your / according your /etc/fstab file. This file contains information about your filesystems, which device they belong to and to which point they will get mounted to - the ...


1

Use grep to find the string at the start of the line and an array to save the results: IFS=$'\n' lines=( $(grep '^string' file.txt) ) grep '^string' file.txt finds the string string at the start of lines of file file.txt The array lines contains the matched lines, the IFS=$'\n' makes each line an array element Now you can iterate over the results using ...


1

In order to truly understand, I'd recommend some reading about I/O operations in the C programming language. I find it easiest to understand that from a programming perspective when you deal with devices, socket, pipes, etc just as you do with files just like the Linux/Unix OSs do. Moreover you can read this value in wikipedia.


1

rm is a smart beast, you can use glob patterns in the argument For your case a simple rm .\<* is sufficient *be careful when using rm with glob patterns as it will delete multiple files matching the pattern



Only top voted, non community-wiki answers of a minimum length are eligible