Page 1 of 1

how to cat a file with giant name

Posted: Fri Nov 06, 2015 8:53 pm
by demecarv
I am getting "No such file or directory" while trying to cat a file which its name go beyond an unique line. Kindly, see below all steps:

Code: Select all

$ cd /WebSphere/was85/dtl85cel/wlemyAppa/AppServer/profiles/default/logs/ffdc
$ find . -name "*15.11.02_14.56.01.0475522723111132066961.txt"
./dtl85cel_wlemyAppa_WLEMYAPP_WLEMYAPP_STC05810_000007E0000007D7_9cb72cb6_15.11.02_
14.56.01.0475522723111132066961.txt
$ cat dtl85cel_wlemyAppa_WLEMYAPP_WLEMYAPP_STC05810_000007E0000007D7_9cb72cb6_11.02
_14.56.01.0475522723111132066961.txt
cat: dtl85cel_wlemyAppa_WLEMYAPP_WLEMYAPP_STC05810_000007E0000007D7_9cb72cb6_11.02_
14.56.01.0475522723111132066961.txt: EDC5129I No such file or directory.

Re: how to cat a file with giant name

Posted: Fri Nov 06, 2015 9:01 pm
by William Collins
cat *15.11.02_14.56.01.0475522723111132066961.txt is a workaround.

Re: how to cat a file with giant name

Posted: Fri Nov 06, 2015 9:08 pm
by demecarv
Thanks. I tried exactly this but with "". Now that I tried without "" it worked.

Re: how to cat a file with giant name

Posted: Fri Nov 06, 2015 9:56 pm
by William Collins
The quotes will treat whatever they bound as literal values. In your case, the asterisk (*) would be treated as an asterisk, instead of a wildcard. Without the quotes the asterisk is a wildcard, so the cat gets given a list of all the files which end with the remainder of the text. Which is only one, so you get your file.

Re: how to cat a file with giant name

Posted: Fri Nov 06, 2015 11:06 pm
by demecarv
Thank you so much!