Firstly,one cannot create a directory or a file through command-line with its name starting with '-'. That is one cannot give command like 'mkdir -test' or 'touch -test' where '-test' is the directory name and file name respectively.But in other way,one can easily create or work with such directory or file in GUI,but that file or directory cannot be accessed or handled through command-line.It has been tested in Suse Linux and Ubuntu,maybe it is universal bug for linux
Not a bug, kernel or otherwise. You're simply seeing mkdir & touch interpret "-t" as an option. Preface with "./" to avoid this: [sandeen@sandeen ~]$ mkdir ./-testdir [sandeen@sandeen ~]$ cd ./-testdir [sandeen@sandeen -testdir]$ pwd /home/sandeen/-testdir [sandeen@sandeen -testdir]$ touch ./-test [sandeen@sandeen -testdir]$ ls -l total 0 -rw-rw-r--. 1 sandeen sandeen 0 Aug 10 12:34 -test
Hi Eric,thanks for explaining this,it works now
Created attachment 292835 [details] attachment-23156-0.html unsubscribe linux-ext4 2015년 8월 10일 (월) 오후 6:38, <bugzilla-daemon@bugzilla.kernel.org>님이 작성: > https://bugzilla.kernel.org/show_bug.cgi?id=102621 > > Bug ID: 102621 > Summary: Directory name or file name staring with '-' cannot be > handled through command line,i.e.,terminal > Product: File System > Version: 2.5 > Kernel Version: 3.16.7-21-desktop > Hardware: All > OS: Linux > Tree: Mainline > Status: NEW > Severity: normal > Priority: P1 > Component: ext2 > Assignee: fs_ext2@kernel-bugs.osdl.org > Reporter: saptarshinag620@gmail.com > Regression: No > > Firstly,one cannot create a directory or a file through command-line with > its > name starting with '-'. That is one cannot give command like 'mkdir -test' > or > 'touch -test' where '-test' is the directory name and file name > respectively.But in other way,one can easily create or work with such > directory > or file in GUI,but that file or directory cannot be accessed or handled > through > command-line.It has been tested in Suse Linux and Ubuntu,maybe it is > universal > bug for linux > > -- > You are receiving this mail because: > You are watching the assignee of the bug. > -- > To unsubscribe from this list: send the line "unsubscribe linux-ext4" in > the body of a message to majordomo@vger.kernel.org > More majordomo info at http://vger.kernel.org/majordomo-info.html >
(In reply to Eric Sandeen from comment #1) > Not a bug, kernel or otherwise. You're simply seeing mkdir & touch > interpret "-t" as an option. Preface with "./" to avoid this: One can also use '--' to stop parsing for options, e.g., $ touch -- -test $ mkdir -- -test-dir $ ls -1d -- -test* -test -test-dir
(Note that this bug is five years old, and was closed years ago. The only reason why it got activity recently is because a spammer tried to upload a malware / phishing attachment to kernel bugzilla.)