Sponsored Content
Top Forums UNIX for Dummies Questions & Answers Print all the directory with no directory name mydir Post 302769616 by lxdorney on Tuesday 12th of February 2013 11:02:28 PM
Old 02-13-2013
thank for the response and yes that what exactly I want, but executing the script I got error message:

and here is my process:
Code:
pwd
/root

Code:
ls server
ab_1234510_40  ab_1234511_1  ab_1234567_1  ab_1234567_2  ab_1234567_3  ab_1234569_1  ab_1234569_4  ab_1731458_9

Code:
nano test3.sh
then copy and paste your script

Code:
./test3.sh
du: cannot access `server/ab__*': No such file or directory
0k
du: cannot access `server/ab__*/mydir': No such file or directory
du: cannot access `server/ab_file.txt_*': No such file or directory
0k file.txt
du: cannot access `server/ab_file.txt_*/mydir': No such file or directory
du: cannot access `server/ab_mydir_*': No such file or directory
0k mydir
du: cannot access `server/ab_mydir_*/mydir': No such file or directory
du: cannot access `server/ab_server/ab_1234510_40/:_*': No such file or directory
0k server/ab_1234510_40/:
du: cannot access `server/ab_server/ab_1234510_40/:_*/mydir': No such file or directory
du: cannot access `server/ab_server/ab_1234511_1/:_*': No such file or directory
0k server/ab_1234511_1/:
du: cannot access `server/ab_server/ab_1234511_1/:_*/mydir': No such file or directory
du: cannot access `server/ab_server/ab_1234567_1/:_*': No such file or directory
0k server/ab_1234567_1/:
du: cannot access `server/ab_server/ab_1234567_1/:_*/mydir': No such file or directory
du: cannot access `server/ab_server/ab_1234567_2/:_*': No such file or directory
0k server/ab_1234567_2/:
du: cannot access `server/ab_server/ab_1234567_2/:_*/mydir': No such file or directory
du: cannot access `server/ab_server/ab_1234567_3/:_*': No such file or directory
0k server/ab_1234567_3/:
du: cannot access `server/ab_server/ab_1234567_3/:_*/mydir': No such file or directory
du: cannot access `server/ab_server/ab_1234569_1/:_*': No such file or directory
0k server/ab_1234569_1/:
du: cannot access `server/ab_server/ab_1234569_1/:_*/mydir': No such file or directory
du: cannot access `server/ab_server/ab_1234569_4/:_*': No such file or directory
0k server/ab_1234569_4/:
du: cannot access `server/ab_server/ab_1234569_4/:_*/mydir': No such file or directory
du: cannot access `server/ab_server/ab_1731458_9/:_*': No such file or directory
0k server/ab_1731458_9/:
du: cannot access `server/ab_server/ab_1731458_9/:_*/mydir': No such file or directory


Last edited by lxdorney; 02-13-2013 at 12:12 AM..
 

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

print all files of a directory

At the moment I do not know anything UNIX script :rolleyes: but i need to make script that prints the content of the archives (of text) that are deposited in a directory and Later erases these archives, leaving the directory emptiness It would be like repository for print please... (9 Replies)
Discussion started by: monica
9 Replies

2. Shell Programming and Scripting

How to print a directory list to a file?

I have directory of files listed with stats. I need to print only files with the same stats to a file. I tried this, and it printed a blank document. *1556 > tmp/list it did not work any suggestions? (3 Replies)
Discussion started by: rocinante
3 Replies

3. Solaris

delete buffer from print directory

Hi all, Operting system : Solaris 9 Oracle application: 11.5.10 i would like to ask query related to buffer area of pinter on solaris server. we are trying to print cheques using oracle application on network printer. some times it is printing the cheques with out any problem but... (1 Reply)
Discussion started by: maooah
1 Replies

4. Shell Programming and Scripting

Print directory name along with their path

Can any one tell me that how can i print all directory with their path in a given parent directory. i.e. parent directory /home/usr/ Now this shoe directory may contain sevral directory /home/usr dir1/ dir1.1/ dir1.2/ dir2 dir2.1/ dir2.2/ ... (5 Replies)
Discussion started by: jadoo_c2
5 Replies

5. Shell Programming and Scripting

[awk] print all filenames in directory

Hello, I was given a (I suppose) a simple task which I don't know how to do. Before coming here I have read a dozen of awk tutorials (full read, not just line-skipping) but I still don't know how to do this. Task: Write an script file 'check.awk' with a parameter current directory that... (5 Replies)
Discussion started by: c0dehunter
5 Replies

6. Shell Programming and Scripting

Print the current directory using perl

Hi I have this code to print the current directory using Perl use Cwd qw(abs_path); my $path = abs_path($0); print "$path\n"; But it is displaying my perl source code file along with the directory. like this C:\Perl\duration.pl But I want it only to display this... (1 Reply)
Discussion started by: srijith
1 Replies

7. Shell Programming and Scripting

Directory containing files,Print names of the files in the directory that are exactly same content.

Given a directory containing say a few thousand files, please output a list of all the names of the files in the directory that are exactly the same, i.e. have the same contents. func(a_directory_name) output -> {“matches”: , ... ]} e.g. func(“/home/my/files”) where the directory... (7 Replies)
Discussion started by: anuragpgtgerman
7 Replies

8. UNIX for Advanced & Expert Users

A way to print only part of directory path

Hi, So I struggled to find a solution to the following problem: I want to make sed print only part of multiple different paths. So lets say we have /path/path1/path2/logs/bla/blabla /path/path1/path2/path3/logs/yadda/yadda/yadda Can someone suggest a way to make sed or other... (5 Replies)
Discussion started by: dampio
5 Replies

9. UNIX for Beginners Questions & Answers

Loop through directory and print on line

In the bash below I am trying to loop through all the R1.gz in a directory (always 1), store them in ARRAY, and cut them before the second _. That is being done but I can't seem to print then one a single line seperated by a space. Is the below the best way or is there a better solution? Thank you... (3 Replies)
Discussion started by: cmccabe
3 Replies
hardlink(1)						      General Commands Manual						       hardlink(1)

NAME
hardlink - Consolidate duplicate files via hardlinks SYNOPSIS
hardlink [-c] [-n] [-v] [-vv] [-h] directory1 [ directory2 ... ] DESCRIPTION
This manual page documents hardlink, a program which consolidates duplicate files in one or more directories using hardlinks. hardlink traverses one or more directories searching for duplicate files. When it finds duplicate files, it uses one of them as the mas- ter. It then removes all other duplicates and places a hardlink for each one pointing to the master file. This allows for conservation of disk space where multiple directories on a single filesystem contain many duplicate files. Since hard links can only span a single filesystem, hardlink is only useful when all directories specified are on the same filesystem. OPTIONS
-c Compare only the contents of the files being considered for consolidation. Disregards permission, ownership and other differ- ences. -f Force hardlinking across file systems. -n Do not perform the consolidation; only print what would be changed. -v Print summary after hardlinking. -vv Print every hardlinked file and bytes saved. Also print summary after hardlinking. -h Show help. AUTHOR
hardlink was written by Jakub Jelinek <jakub@redhat.com>. Man page written by Brian Long. Man page updated by Jindrich Novy <jnovy@redhat.com> BUGS
hardlink assumes that its target directory trees do not change from under it. If a directory tree does change, this may result in hardlink accessing files and/or directories outside of the intended directory tree. Thus, you must avoid running hardlink on potentially changing directory trees, and especially on directory trees under control of another user. hardlink(1)
All times are GMT -4. The time now is 07:16 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy