No Such file or directory


 
Thread Tools Search this Thread
Operating Systems Linux No Such file or directory
# 1  
Old 02-14-2014
No Such file or directory

Hi,

I am facing issue when I am trying to run any command from /usr/bin/ folder. I can see a link to the files exists in this folder but when I run giving absolute path it gives me below error.

Code:
1. $ /usr/bin/awk
-bash: /usr/bin/awk: No such file or directory

2. $ man awk
sh: /usr/bin/gunzip: No such file or directory
fgets: No such file or directory
Error reading man page /usr/share/man/man1/awk.1.gz
No manual entry for awk

Below command shows that the links exist in the folder

Code:
$ ls -ltr /usr/bin/awk
lrwxrwxrwx. 1 root root 14 Nov 28 10:16 /usr/bin/awk -> ../../bin/gawk

$ ls -ltr /usr/bin/gunzip
lrwxrwxrwx. 1 root root 16 Nov 28 10:25 /usr/bin/gunzip -> ../../bin/gunzip

# 2  
Old 02-14-2014
Check if the actual gawk is present in /bin/gawk or whichever path it is pointing to.

--ahamed
# 3  
Old 02-14-2014
Yes, I can see that is also present.
# 4  
Old 02-14-2014
Do you have the right permissions to access /bin/awk?
# 5  
Old 02-14-2014
'no such file or directory' can mean 'important library is missing'. Try 'ldd /bin/awk' and see if it can find all its libraries.
This User Gave Thanks to Corona688 For This Post:
# 6  
Old 02-16-2014
Hi Corona,

When I run the command I get the below output.

Code:
$ ldd /bin/awk
        linux-vdso.so.1 =>  (0x00007fff06920000)
        libdl.so.2 => /lib64/libdl.so.2 (0x00000036f2c00000)
        libm.so.6 => /lib64/libm.so.6 (0x00000036f4400000)
        libc.so.6 => /lib64/libc.so.6 (0x00000036f3000000)
        /lib64/ld-linux-x86-64.so.2 (0x00000036f2800000)

and when I am running the command without pointing to /usr/bin I am getting the below message. Seems like the commands are find just like the links are not working. Does that mean I have to rebuild the links? is there a quick way to rebuild them?

Thanks!!

Code:
$ /bin/awk
Usage: awk [POSIX or GNU style options] -f progfile [--] file ...
Usage: awk [POSIX or GNU style options] [--] 'program' file ...
POSIX options:          GNU long options:
        -f progfile             --file=progfile
        -F fs                   --field-separator=fs
        -v var=val              --assign=var=val
        -m[fr] val
        -O                      --optimize
        -W compat               --compat
        -W copyleft             --copyleft
        -W copyright            --copyright
        -W dump-variables[=file]        --dump-variables[=file]
        -W exec=file            --exec=file
        -W gen-po               --gen-po
        -W help                 --help
        -W lint[=fatal]         --lint[=fatal]
        -W lint-old             --lint-old
        -W non-decimal-data     --non-decimal-data
        -W profile[=file]       --profile[=file]
        -W posix                --posix
        -W re-interval          --re-interval
        -W source=program-text  --source=program-text
        -W traditional          --traditional
        -W usage                --usage
        -W use-lc-numeric       --use-lc-numeric
        -W version              --version

To report bugs, see node `Bugs' in `gawk.info', which is
section `Reporting Problems and Bugs' in the printed version.

gawk is a pattern scanning and processing language.
By default it reads standard input and writes standard output.

Examples:
        gawk '{ sum += $1 }; END { print sum }' file
        gawk -F: '{ print $1 }' /etc/passwd

# 7  
Old 02-16-2014
The link looks ok to me. But do you have permission to navigate it? Post the result of the following command...
Code:
$ ls -ld / /bin /usr /usr/bin
drwxr-xr-x 36 root root  4096 Jan 23 15:05 /
drwxr-xr-x  2 root root  4096 Jun 25  2010 /bin
drwxr-xr-x 17 root root  4096 Jun 24  2010 /usr
drwxr-xr-x  2 root root 73728 May 17  2013 /usr/bin
$

Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

How to find and get a file in an entire directory with an excluded directory specified?

How to get a file 'zlib.h' in an entire directory with an excluded directory specified lives under that starting directory by using find command, as it failed on: $ find . -name 'zlib.h' -a -ipath 'CHROME.TMP' -prune -o -print it'll just list entirely up (2 Replies)
Discussion started by: abdulbadii
2 Replies

2. Shell Programming and Scripting

Shell script cannot create directory and move the file to that directory

I have a script, which is checking if file exists and move it to another directory if then mkdir -p ${LOCL_FILES_DIR}/cool_${Today}/monthly mv report_manual_alloc_rpt_A_I_ASSIGNMENT.${Today}*.csv ${LOCL_FILES_DIR}/cool_${Today}/monthly ... (9 Replies)
Discussion started by: digioleg54
9 Replies

3. Shell Programming and Scripting

Shell scripting-I need a script which should watch a directory for a file with specific directory

I need a script which should watch a directory for a file with specific directory. If it finds a file in directory, it should search for few specific keyword in the file. if the keyword exists, it should trim string from specific column. The file should be moved to another directory and the a... (8 Replies)
Discussion started by: akashdeepak
8 Replies

4. Shell Programming and Scripting

Change to directory and search some file in that directory in single command

I am trying to do the following task : export ENV=aaa export ENV_PATH=$(cd /apps | ls | grep $ENV) However, it's not working. What's the way to change to directory and search some file in that directory in single command Please help. (2 Replies)
Discussion started by: saurau
2 Replies

5. Shell Programming and Scripting

Grepping file names, comparing them to a directory of files, and moving them into a new directory

got it figured out :) (1 Reply)
Discussion started by: sHockz
1 Replies

6. Shell Programming and Scripting

Script which removes files from the first directory if there is a file in the second directory

Script must removes files from the first directory if there is a file with same name in the second directory Script passed to the two directories, it lies with them in one directory: sh script_name dir1 dir2 This is my version, but it does not work :wall: set - $2/* for i do set -... (6 Replies)
Discussion started by: SLAMUL
6 Replies

7. Shell Programming and Scripting

Move the latest or older File from one directory to another Directory

I Need help for one requirement, I want to move the latest/Older file in the folder to another file. File have the datetimestamp in postfix. Example: Source Directory : \a destination Directory : \a\b File1 : xy_MMDDYYYYHHMM.txt (xy_032120101456.txt) File2: xy_MMDDYYYYHHMM.txt... (1 Reply)
Discussion started by: pp_ayyanar
1 Replies

8. Shell Programming and Scripting

File transfer from one directory to another directory in unix

Hi, I have to transfer five files from one directory to another directory in unix with the help of shell scripts. This shell script calling the param file as input parameter. Every day one file will come and fall on my source directory. Remaining files will fall on any one of the day of the... (5 Replies)
Discussion started by: easterraj
5 Replies

9. Shell Programming and Scripting

Move a file from windows directory to unix directory

Move a file from windows directory to unix directory, is this possible? if it is, can someone help me on this? Thanks! God bless! (1 Reply)
Discussion started by: kingpeejay
1 Replies

10. UNIX for Dummies Questions & Answers

Copying one file at a time from one directory to another directory.

Hi All i want to write a script which could copy one file at a time from one directory to another directory. Scenerio: Let's say i have 100 file in a dirctory,so i want to copy one file at a time to another directory with a sleep statement in between that of 30 secs. please help me... (1 Reply)
Discussion started by: Nikhilindurkar
1 Replies
Login or Register to Ask a Question