Below is the out put i see when i give below command
root@us000xyz # ls -lia |grep us000xyz_R5|sed -n l
If I'm reading that correctly, the first entry has a tab or a bunch of spaces after a newline in the name (!?!?). Or your copy-paste went a bit wrong
My prefered method of getting to the bottom of weirdness like this is the cat-vet trick:
That will show you any trailing spaces (the cause of 90% of these IME) and/or other oddnesses.
You can even leave off the -li but if you want even simpler output and don't need the inode num right now.
Then you can either attack the dir by name (suggest renaming it via mv first) or by inode number as listed above (find -inum)
This User Gave Thanks to Smiling Dragon For This Post:
I have a TAR (compressed) file that I uncompressed using the following command
$ tar xvf uagent.tar
It created a directory structure as follows
<root>/arcagent/UAGENT/reloc/$UAGENT_HOME/
How do I access files under the $UAGENT_HOME? Every time I do change directory command, the OS... (3 Replies)
The script below was written to select files and convert a particular string to something other and replace that file. However, I came across some issues with filenames that contain spaces, any suggestions to get around this? Any other suggestions that may apply to this code would also be... (5 Replies)
Hi, I know that inode for each file is unique, but is it the for the directory? So far I found different directories has the same inode nubmer when you do ls -i, could some one explain why? Thanks a lot. (9 Replies)
I need help writing a bash script for the windows cygwin environment. I'm not sure if bash is the optimal tool. Perhaps perl would be better? Either would work.
I have directories whose names include the date they were created. The directory names are in the format of... (0 Replies)
Sun Solaris Unix Question
Haven't been able to find any solution for this situation. Let's just say the file names listed below exist in a directory. I want the find command to find all files in this directory but at the same time I want to eliminate certain file names or files with certain... (2 Replies)
hai,
I am new to Unix, I have a requirement to display owner name , directory or sub directory name, who's owner name is not equal to "oasitqtc".
(here "oasitqtc" is the owner of the directory or sub directory.)
i have a command (below) which will display all folders and sub folders, but i... (6 Replies)
I am trying to loop through folders and extract the name of the lowest level subfolder
I was running the script below, it returns
/bb/bin/prd/newyork
/bb/bin/prd/london
/bb/bin/prd/tokyo
I really want
newyork
london
tokyo
I couldn't find a standard variable for the lowest level... (1 Reply)
Hi guys,
I have lots of files that look like:
ABC.packed.dir
DEF.packed.dir
GHI.packed.dir
etc...
I would like them to have more of the usual naming convention
ABC
DEF
GHI
etc...
so I was thinking that I could: (2 Replies)
Some guidance is highly appreciated.
I have 10 directories with names ending with 'xyz', each of them have about 30000 files. I want to loop through the contents of each directory and produce a single output per directory. So I want to have 10 output files named 'directory_name'_out.
With... (1 Reply)
Discussion started by: newbie83
1 Replies
LEARN ABOUT NETBSD
fsdb
FSDB(8) BSD System Manager's Manual FSDB(8)NAME
fsdb -- FFS debugging/editing tool
SYNOPSIS
fsdb [-dFn] -f fsname
DESCRIPTION
fsdb opens fsname (usually a raw disk partition) and runs a command loop allowing manipulation of the file system's inode data. You are
prompted to enter a command with ``fsdb (inum X)>'' where X is the currently selected i-number. The initial selected inode is the root of
the filesystem (i-number 2). The command processor uses the editline(3) library, so you can use command line editing to reduce typing if
desired. When you exit the command loop, the file system superblock is marked dirty and any buffered blocks are written to the file system.
The -d option enables additional debugging output (which comes primarily from fsck(8)-derived code).
The -F option indicates that filesystem is a file system image, rather than a raw character device. It will be accessed 'as-is', and no
attempts will be made to read a disklabel.
The -n option disables writing to the device, preventing any changes from being made to the filesystem.
COMMANDS
Besides the built-in editline(3) commands, fsdb supports these commands:
help Print out the list of accepted commands.
inode i-number
Select inode i-number as the new current inode.
back Revert to the previously current inode.
clri Clear the current inode.
lookup name
cd name
Find name in the current directory and make its inode the current inode. Name may be a multi-component name or may begin with slash
to indicate that the root inode should be used to start the lookup. If some component along the pathname is not found, the last
valid directory encountered is left as the active inode.
This command is valid only if the starting inode is a directory.
active
print Print out the active inode.
uplink Increment the active inode's link count.
downlink
Decrement the active inode's link count.
linkcount number
Set the active inode's link count to number.
ls List the current inode's directory entries. This command is valid only if the current inode is a directory.
blks List the current inode's blocks numbers.
findblk disk block number ...
Find the inode(s) owning the specified disk block(s) number(s). Note that these are not absolute disk blocks numbers, but offsets
from the start of the partition.
rm name
del name
Remove the entry name from the current directory inode. This command is valid only if the current inode is a directory.
ln ino name
Create a link to inode ino under the name name in the current directory inode. This command is valid only if the current inode is a
directory.
chinum dirslot inum
Change the i-number in directory entry dirslot to inum.
chname dirslot name
Change the name in directory entry dirslot to name. This command cannot expand a directory entry. You can only rename an entry if
the name will fit into the existing directory slot.
chtype type
Change the type of the current inode to type. type may be one of: file, dir, socket, or fifo.
chmod mode
Change the mode bits of the current inode to mode. You cannot change the file type with this subcommand; use chtype to do that.
chflags flags
Change the file flags of the current inode to flags.
chown uid
Change the owner of the current inode to uid.
chgrp gid
Change the group of the current inode to gid.
chgen gen
Change the generation number of the current inode to gen.
mtime time
ctime time
atime time
Change the modification, change, or access time (respectively) on the current inode to time. Time should be in the format
YYYYMMDDHHMMSS[.nsec] where nsec is an optional nanosecond specification. If no nanoseconds are specified, the mtimensec, ctimensec,
or atimensec field will be set to zero.
quit, q, exit, <EOF>
Exit the program.
SEE ALSO editline(3), fs(5), clri(8), fsck(8)HISTORY
fsdb uses the source code for fsck(8) to implement most of the file system manipulation code. The remainder of fsdb first appeared in
NetBSD 1.1.
WARNING
Use this tool with extreme caution -- you can damage an FFS file system beyond what fsck(8) can repair.
BUGS
Manipulation of ``short'' symlinks doesn't work (in particular, don't try changing a symlink's type).
You must specify modes as numbers rather than symbolic names.
There are a bunch of other things that you might want to do which fsdb doesn't implement.
BSD January 3, 2004 BSD