Grep error "No such file or directory" not solved


 
Thread Tools Search this Thread
Top Forums UNIX for Beginners Questions & Answers Grep error "No such file or directory" not solved
# 1  
Old 10-20-2016
Grep error "No such file or directory" not solved

Dear all,
I run a simple command:
Code:
grep -f GTEx_snps.txt chr1_r2.txt>chr1_r2_GTEx.txt

and got error: "chr1_r2_GTEx.txt: No such file or directory" while "chr1_r2_GTEx.txt is an non-existent file. I google searched some solutions and tried to add -s and --no-messages option
Code:
grep -s --no-messages -f GTEx_snps.txt chr1_r2.txt>chr1_r2_GTEx.txt

and it still doesn't work. Anyone know how to solve it? thank you.
Lin
# 2  
Old 10-20-2016
This is a very strange scenario. I could imagine there's invisible/control characters in the file name. How did you produce the line (e.g. what editor)?
Could you try with simpler, straight forward file names?
# 3  
Old 10-20-2016
Dear RudiC,
You are right. When I delete everything and re-type it . It works. Thank you very much!
Lin
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. AIX

Apache 2.4 directory cannot display "Last modified" "Size" "Description"

Hi 2 all, i have had AIX 7.2 :/# /usr/IBMAHS/bin/apachectl -v Server version: Apache/2.4.12 (Unix) Server built: May 25 2015 04:58:27 :/#:/# /usr/IBMAHS/bin/apachectl -M Loaded Modules: core_module (static) so_module (static) http_module (static) mpm_worker_module (static) ... (3 Replies)
Discussion started by: penchev
3 Replies

2. Shell Programming and Scripting

Bash script - Print an ascii file using specific font "Latin Modern Mono 12" "regular" "9"

Hello. System : opensuse leap 42.3 I have a bash script that build a text file. I would like the last command doing : print_cmd -o page-left=43 -o page-right=22 -o page-top=28 -o page-bottom=43 -o font=LatinModernMono12:regular:9 some_file.txt where : print_cmd ::= some printing... (1 Reply)
Discussion started by: jcdole
1 Replies

3. UNIX for Dummies Questions & Answers

Using "mailx" command to read "to" and "cc" email addreses from input file

How to use "mailx" command to do e-mail reading the input file containing email address, where column 1 has name and column 2 containing “To” e-mail address and column 3 contains “cc” e-mail address to include with same email. Sample input file, email.txt Below is an sample code where... (2 Replies)
Discussion started by: asjaiswal
2 Replies

4. Shell Programming and Scripting

mv error " file is not a directory" ?

Hi; This script part: sudo find *.deb -mmin +10 | sudo xargs mv /var/cache/apt/archives/*.* /var/mobile/Library/iFile/Trash/var/cache/apt/archives/ Always returns : " mv: test.deb is not a directory" Any idea what I'm missing ? Thanks in advance: Pasc (2 Replies)
Discussion started by: pasc
2 Replies

5. UNIX for Dummies Questions & Answers

Unix "look" Command "File too large" Error Message

I am trying to find lines in a text file larger than 3 Gb that start with a given string. My command looks like this: $ look "string" "/home/patrick/filename.txt" However, this gives me the following message: "look: /home/patrick/filename.txt: File too large" So, I have two... (14 Replies)
Discussion started by: shishong
14 Replies

6. Shell Programming and Scripting

awk command to replace ";" with "|" and ""|" at diferent places in line of file

Hi, I have line in input file as below: 3G_CENTRAL;INDONESIA_(M)_TELKOMSEL;SPECIAL_WORLD_GRP_7_FA_2_TELKOMSEL My expected output for line in the file must be : "1-Radon1-cMOC_deg"|"LDIndex"|"3G_CENTRAL|INDONESIA_(M)_TELKOMSEL"|LAST|"SPECIAL_WORLD_GRP_7_FA_2_TELKOMSEL" Can someone... (7 Replies)
Discussion started by: shis100
7 Replies

7. Shell Programming and Scripting

ps -ef | grep "string1" "string2" " "string3"

Hi all, can any one suggest me the script to grep multiple strings from ps -ef pls correct the below script . its not working/ i want to print OK if all the below process are running in my solaris system. else i want to print NOT OK. bash-3.00$ ps -ef | grep blu lscpusr 48 42 ... (11 Replies)
Discussion started by: steve2216
11 Replies

8. AIX

AIX cp error: "A file or directory in the path does not exist"

Hello fellow UNIX fans, I'm running AIX 4.3 and getting an error message “cp: /a/file2.db: A file or directory in the path does not exist” when I run the following command: cp /b/file.db /a/file2.db It stops every time about 95% of the way through the copy process at 1,073,741,312 bits. ... (3 Replies)
Discussion started by: Jackson123
3 Replies

9. UNIX for Dummies Questions & Answers

Explain the line "mn_code=`env|grep "..mn"|awk -F"=" '{print $2}'`"

Hi Friends, Can any of you explain me about the below line of code? mn_code=`env|grep "..mn"|awk -F"=" '{print $2}'` Im not able to understand, what exactly it is doing :confused: Any help would be useful for me. Lokesha (4 Replies)
Discussion started by: Lokesha
4 Replies

10. Shell Programming and Scripting

Keep getting error "No such file or directory"

Hi, When I try to run this script I keep getting the error "/quota.sh: fgrep 5162 /home/nasadmin/quotas_michel/userlist.txt: No such file or directory" but when i run this command typed in I do get the correct output. Can somebody help me? This is the script: # Omgevingsvariabelen... (16 Replies)
Discussion started by: vanloonmichel
16 Replies
Login or Register to Ask a Question